PictureExportPage

<< Click to Display Table of Contents >>

Navigation:  Picture Export Functions >

PictureExportPage

Previous pageReturn to chapter overviewNext page

[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 DefaultPictureDPI().

method boolean VPE.PictureExportPage(

string FileName,

long PageNo

)

string FileName

(path- and) filename of exported image

long PageNo

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:

ActiveX / VCL:

Doc.PictureExportColorDepth = PICEXP_COLOR_256

Doc.PictureExportDither = PICEXP_DITHER_MONO

Doc.SetDefaultPictureDPI(300, 300)

Doc.PictureExportPage("test.bmp", 1)

 

.NET:

Doc.PictureExportColorDepth = PictureExportColorDepth.Color256

Doc.PictureExportDither = PictureExportDither.DitherMono

Doc.SetDefaultPictureDPI(300, 300)

Doc.PictureExportPage("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:

ActiveX / VCL:

// Export as True-Color image
Doc.PictureExportColorDepth = 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:
Doc.PictureType = PIC_TYPE_PNG
 

// PNG is always written with Deflate (ZLib) compression

 
// Set 96 DPI resolution:
Doc.SetDefaultPictureDPI(96, 96)
Doc.PictureExportPage("image.001", 2);

 

.NET:

// Export as True-Color image
Doc.PictureExportColorDepth = PictureExportColorDepth.ColorTrue
 
// 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:
Doc.PictureType = PictureType.PNG
 

// Select ZIP compression:
Doc.PictureExportOptions = PictureExportOptions.WriteCompressed
 
// Set 96 DPI resolution:
Doc.SetDefaultPictureDPI(96, 96)
Doc.PictureExportPage("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:

ActiveX / VCL:

// Export as dithered Black and White image:
Doc.PictureExportDither = PICEXP_DITHER_MONO

 

// Export as TIFF image:
Doc.PictureType = PIC_TYPE_TIFF
 
// Select FaxG4 as export format:
Doc.PictureExportOptions = PICEXP_TIFF_CCITTFAX4
 
// Set 200 DPI resolution:
Doc.SetDefaultPictureDPI(200, 200)
Doc.PictureExportPage("image.002", 3)

 

.NET:

// Export as dithered Black and White image:
Doc.PictureExportDither = PictureExportDither.Mono

 

// Export as TIFF image:
Doc.PictureType = PictureType.TIFF
 
// Select FaxG4 as export format:
Doc.PictureExportOptions = PictureExportOptions.TIFF_CCITT_Fax4
 
// Set 200 DPI resolution:
Doc.SetDefaultPictureDPI(200, 200)
Doc.PictureExportPage("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".