IacDocument.ExportToJPeg Method

The ExportToJPeg method is used to export a PDF document to multiple JPEG or BMP files.

Syntax

Visual Basic .NET:

public Function ExportToJPeg(ByVal filename As String, ByVal resolution As System.UInt32, System.UInt32, ByVal jpegLevel As fromPage As Integer, ByVal toPage As Integer) As Boolean

C#:

public System.Boolean ExportToJPeg ( System.String filename , System.UInt32 resolution , System.UInt32 jpegLevel, System.Int32 fromPage, System.Int32 toPage)

Parameters

FileName

Name of the file with .jpg extension to export to.

Resolution

72, 150, 300, 600

JPegLevel

1 (highest compression, lowest quality) to 9 (lowest compression, highest quality)

0 Creates a Bitmap (.bmp) file with no compression

fromPage

Starting page for export

toPage

Ending page for export

Return Value

Returns True on success, False otherwise.

Remarks

 

The document attribute UseCropBoxWhenExporting can be set to 1 in order to export the portion of each page that is within the margins (CropBox in PDF terminology.) The size of the exported image will be limited to the size of the page excluding the margins.

 

Example

//Set the license key
pdfCreator1.SetLicenseKey("Amyuni Tech.", "07EFCD010…76BCB9CFD");
 
System.IO.FileStream testfile = new System.IO.FileStream("TestFile2.pdf", FileMode.Open, FileAccess.Read, FileShare.Read);
 
pdfCreator1.Document.Open(testfile, "");
 
//paragraph optimization is recommended to export the file to Jpeg
pdfCreator1.Document.OptimizeDocument(0);
pdfCreator1.Document.ExportToJPeg("test.jpg", 300, 7);