The RasterizePageRange method converts page contents into a color or grey scale image. When archiving documents or performing OCR, it is sometimes preferable for all pages to be stored as images rather than complex text and graphic operations.
|
|
This method is available in version 4.5 of PDF Creator only. |
Public Function RasterizePageRange(ByVal StartPage As Integer, ByVal EndPage As Integer, ByVal Resolution As Integer, ByVal colorOption As Amyuni.PDFCreator.IacRasterizeColorOption, ByVal compression As Amyuni.PDFCreator.IacImageCompressionConstants) As Boolean
public bool RasterizePageRange(int StartPage, int EndPage, int Resolution, Amyuni.PDFCreator.IacRasterizeColorOption colorOption, Amyuni.PDFCreator.IacImageCompressionConstants compression)
StartPage, EndPage
Start and end page numbers to Rasterize. Page numbers start with page 1.
Resolution
Resolution in dots per inch (DPI) at which the documents are to be rasterized. A DPI of 150 is recommended in most situations. Higher resolutions will produce very large PDF files.
ColorOption
acColorOptionBW = 1 Black and White images
acColorOptionGray = 2 256 Grey level images
acColorOptionRGB = 3 RGB color images
Compression
acCompression256Colors = 1 256 Color level images
acCompressionJPegLow = 2 Low quality JPeg Compression
acCompressionJPegMedium = 7 Medium quality JPeg Compression
acCompressionJPegHigh = 9 High quality JPeg Compression
acCompressionCCITTFax = 10 CCITT Level 6 Black and White Compression
acCompressionPNG = 11 PNG (Flate) Compression
acCompressionJPG2000 = 12 JPeg 2000 Compression
acCompressionJBIG2 = 13 JBIG2 Compression
Member of Amyuni.PDFCreator.IacDocument.
Dim file1 As New System.IO.FileStream("Test.pdf", System.IO.FileMode.Open)
With PdfCreator1
.SetLicenseKey("Evaluation", "07EF0C71...28E79EE2F79")
.Document.Open(file1, "")
'Rasterize all the document and save as JBIG2
.Document.RasterizePageRange(1, PdfCreator1.Document.PageCount, 120, Amyuni.PDFCreator.IacRasterizeColorOption.acColorOptionGray, Amyuni.PDFCreator.IacImageCompressionConstants.acCompressionJBIG2)
End With
pdfCreator1.SetLicenseKey("Amyuni Tech.", "07EFC1000...FB9CFD");
System.IO.FileStream file1 = new System.IO.FileStream("Test1.pdf", FileMode.Open);
//pdf Creator1 is the control set on the form
pdfCreator1.Document.Open(file1, "");
//Rasterize all the document and save as JBIG2
pdfCreator1.Document.RasterizePageRange(1, pdfCreator1.Document.PageCount, 120, IacRasterizeColorOption.acColorOptionGray, IacImageCompressionConstants.acCompressionJBIG2);