<< Click to Display Table of Contents >> VpePictureExportPage |
[Windows platform only, Professional Edition and above]
Exports the page specified in parameter "page_no" to file. The settings for the export options of the specific file type, PictureExportColorDepth and PictureExportDither are used.
The type of image is automatically determined by the suffix of FileName (e.g. ".JPG" = JPEG). If FileName contains no suffix or a suffix which does not specify an image type (e.g. ".001"), the image type can be specified with the property PictureType.
The resolution of the image is defined with VpeSetPictureDefaultDPI().
int VpePictureExportPage(
VpeHandle hDoc,
LPCSTR file_name,
int page_no
)
VpeHandle hDoc
Document Handle
LPCSTR file_name
(path- and) filename of exported image
int page_no
page number of the page that shall be exported from the document
Returns:
Value |
Description |
True |
success |
False |
failure |
Remarks:
In case of an error, LastError is set.
During export, the BusyProgressBar is shown.
The higher the color depth and the higher the resolution, the more memory is needed during export to create the image. The color depth and resolution can not be specified for metafiles (WMF / EMF), metafiles are always exported in true-color with a resolution of 600 x 600 DPI.
Example:
VpeSetPictureExportColorDepth(hDoc, PICEXP_COLOR_256)
VpeSetPictureExportDither(hDoc, PICEXP_DITHER_MONO)
VpeSetDefaultPictureDPI(hDoc, 300, 300)
VpePictureExportPage(hDoc, "test.bmp", 1)
Instructs VPE, to generate from page one of the document internally a 256 color image with 300 x 300 DPI resolution first, and to dither it down afterwards to b/w (monochrome) in the same 300 x 300 DPI resolution when writing it to a BMP file named "test.bmp".
Example 2:
VpeSetPictureExportColorDepth(hDoc, PICEXP_COLOR_TRUE)
// VPE determines the file type from the filename suffix. Because we
// use here for the suffix ".001", ".002", etc., we tell VPE the
// type of file:
VpeSetPictureType(hDoc, PIC_TYPE_PNG)
// PNG is always written with Deflate (ZLib) compression
// Set 96 DPI resolution:
VpeSetDefaultPictureDPI(hDoc, 96, 96)
VpePictureExportPage(hDoc, "image.001", 2);
Instructs VPE, to export page 2 of the document as true-color Deflate-compressed PNG image with 96 x 96 DPI resolution named "image.001".
Example 3:
VpeSetPictureExportDither(hDoc, PICEXP_DITHER_MONO)
VpeSetPictureType(hDoc, PIC_TYPE_TIFF);
// Select FaxG4 as export format:
VpeSetPictureExportOptions(hDoc, PICEXP_TIFF_CCITTFAX4)
// Set 200 DPI resolution:
VpeSetDefaultPictureDPI(hDoc, 200, 200)
VpePictureExportPage(hDoc, "image.002", 3)
Instructs VPE, to export page 3 of the document as dithered b / w Fax G4 TIFF image with 200 x 200 DPI resolution named "image.002".