IacDocument.RasterizePageRange Method

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.



Visual Basic .NET:

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 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.





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);