PdfConverter
Inheritance: java.lang.Object, com.aspose.pdf.facades.Facade com.aspose.pdf.facades.PdfConverter, com.aspose.pdf.facades.Facade, com.aspose.pdf.facades.PdfConverter
All Implemented Interfaces: com.aspose.ms.System.IDisposable, IFacade, Closeable, AutoCloseable
public final class PdfConverter extends Facade
Represents a class to convert a pdf file’s each page to images, supporting BMP, JPEG, PNG and TIFF now. Supported content in pdfs: pictures, form, comment.
Constructors
| Constructor | Description |
|---|---|
| PdfConverter | Initializes new {@code PdfConverter} object. |
| PdfConverter | Initializes new {@code PdfConverter} object. |
Methods
| Method | Description |
|---|---|
| bindPdf | Binds a PDF document to the {@link PdfConverter} instance for further processing. |
| bindPdf | Binds a Pdf Stream for convert. |
| bindPdf | Binds a Pdf file for converting. |
| close | Close the instance of PdfConverter and release the resources. |
| convertPageToPNGMemoryStream | For internal usage only |
| dispose | Close the instance of PdfConverter and release the resources. This method is obsolete, use close() instead. |
| doConvert | Do some initial works for converting a pdf document to images. PdfConverter converter = new PdfConverter(); converter.bindPdf(“D:\\Test\\test.pdf”); converter.doConvert(); String prefix = “D:\\Test\\”; String suffix = “.jpg”; int imageCount = 1; while (converter.hasNextImage()) { converter.getNextImage(prefix + imageCount + suffix); imageCount++; } |
| getCoordinateType | Gets the page coordinate type (Media/Crop boxes). CropBox value is used by default. |
| getEndPage | Gets end position which you want to convert. |
| getFormPresentationMode | Gets form presentation mode. |
| getNextImage | Saves image to stream with default image format - jpeg. |
| getNextImage | Saves image to stream with given image format. |
| getNextImage | Saves image to stream with the givin image format, size and quality. |
| getNextImage | Saves image to stream with given image format and quality. |
| getNextImage | Saves image to stream with the givin image format, size and quality. |
| getNextImage | Saves image to stream with the givin image format, dimensions and quality. |
| getNextImage | Saves image to stream with given page size. |
| getNextImage | Saves image to stream with given page size. |
| getNextImage | Saves image to stream with given page size, image format and quality. |
| getNextImage | Saves image to file with default image format - jpeg. |
| getNextImage | Saves image to file with the givin image format. PdfConverter converter = new PdfConverter(); converter.bindPdf(@“D:\Test\test.pdf”); converter.DoConvert(); String prefix = @“D:\Test\”; String suffix = “.png”; int imageCount = 1; while (converter.HasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Png); imageCount++; } |
| getNextImage | Saves image to file with the givin image format, image size, and quality. PdfConverter converter = new PdfConverter(); converter.bindPdf(@“D:\Test\test.pdf”); converter.doConvert(); String prefix = @“D:\Test\”; String suffix = “.jpg”; int imageCount = 1; float pixelX=800f; float pixelY=600f; while (converter.HasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Jpeg, pixelX, pixelY, 50); imageCount++; } |
| getNextImage | Saves image to file with given image format and quality. |
| getNextImage | Saves image to file with the given image format and dimensions. PdfConverter converter = new PdfConverter(); converter.bindPdf(“D:\\Test\\test.pdf”); converter.DoConvert(); String prefix = “D:\\Test\\”; String suffix = “.jpg”; int imageCount = 1; while (converter.hasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Jpeg, 800, 1000); imageCount++; } |
| getNextImage | Saves image to file with the given image format, dimensions and quality. PdfConverter converter = new PdfConverter(); converter.bindPdf(@“D:\Test\test.pdf”); converter.doConvert(); String prefix = @“D:\Test\”; String suffix = “.jpg”; int imageCount = 1; while (converter.HasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Jpeg, 800, 1000, 50); imageCount++; } |
| getNextImage | Saves image to file with ith given page size and default image format - jpeg. |
| getNextImage | Saves image to file with given page size and image format. |
| getNextImage | Saves image to file with given page size, image format and quality. |
| getPageCount | Gets the page count. |
| getPassword | Gets document OwnerPassword. |
| getRenderingOptions | Gets rendering options. |
| getResolution | Gets resolution during converting. The higher resolution, the slower converting speed. The default value is 150. |
| getStartPage | Gets start position which you want to convert. The minimal value is 1. |
| getUserPassword | Gets document UserPassword. |
| hasNextImage | Indicates whether the pdf file has more images or not. |
| isShowHiddenAreas | Gets flag that controls visibility of hidden areas on the page. Method is Deprecated. |
| mergeImages | Merges list of image streams as one image stream. |
| mergeImagesAsTiff | Merges list of tiff streams as one multiple frames tiff stream. |
| saveAsTIFF | Converts each pages of a pdf document to images and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images and saves images to a single TIFF stream. |
| saveAsTIFF | Converts each pages of a pdf document to images and saves images to a single TIFF file. PdfConverter converter = new PdfConverter(); converter.bindPdf(@“D:\Test\test.pdf”); converter.doConvert(); converter.saveAsTIFF(@“D:\Test\test.tiff”); |
| saveAsTIFF | Converts each pages of a pdf document to images and saves images to a single TIFF file. PdfConverter converter = new PdfConverter(); converter.bindPdf(@“D:\Test\test.pdf”); converter.doConvert(); converter.saveAsTIFF(@“D:\Test\test.tiff”); |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with page size and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with page size and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with and saves images to a single TIFF file. |
| saveAsTIFF | Converts each pages of a pdf document to images with and saves images to a single TIFF file. |
| saveAsTIFFClassF | Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream. |
| saveAsTIFFClassF | Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream. |
| saveAsTIFFClassF | Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream. |
| saveAsTIFFClassF | Converts each pages of a pdf document to images and save images to a single TIFF ClassF file. PdfConverter converter = new PdfConverter(); converter.bindPdf(“D:\\Test\\test.pdf”); converter.doConvert(); converter.saveAsTIFFClassF(“D:\\Test\\test.tiff”); |
| saveAsTIFFClassF | Converts each pages of a pdf document to images and save images to a single TIFF ClassF file. PdfConverter converter = new PdfConverter(); converter.bindPdf(@“D:\Test\test.pdf”); converter.doConvert(); converter.saveAsTIFFClassF(@“D:\Test\test.tiff”,204,196); |
| saveAsTIFFClassF | Converts each pages of a pdf document to images and save images to a single TIFF ClassF file. |
| setCoordinateType | Sets the page coordinate type (Media/Crop boxes). CropBox value is used by default. |
| setEndPage | Sets end position which you want to convert. use setEndPage(int) before setStartPage(int) |
| setFormPresentationMode | Sets form presentation mode. |
| setPassword | Sets document OwnerPassword. |
| setRangeOfPages | Sets range of pages between of which you want to convert. |
| setRenderingOptions | Sets rendering options. |
| setResolution | Sets resolution during converting. The higher resolution, the slower converting speed. The default value is 150. |
| setShowHiddenAreas | Deprecated. |
| setStartPage | Sets start position which you want to convert. The minimal value is 1. use setEndPage(int) before setStartPage(int) |
| setUserPassword | Sets document UserPassword. |
PdfConverter
public PdfConverter()
Initializes new {@code PdfConverter} object.
PdfConverter
Initializes new {@code PdfConverter} object.
bindPdf
Binds a PDF document to the {@link PdfConverter} instance for further processing.
bindPdf
Binds a Pdf Stream for convert.
bindPdf
Binds a Pdf file for converting.
close
public void close()
Close the instance of PdfConverter and release the resources.
convertPageToPNGMemoryStream
For internal usage only
dispose
@Deprecated public void dispose()
Close the instance of PdfConverter and release the resources. This method is obsolete, use close() instead.
doConvert
public void doConvert()
Do some initial works for converting a pdf document to images.
PdfConverter converter = new PdfConverter(); converter.bindPdf("D:\\Test\\test.pdf"); converter.doConvert(); String prefix = "D:\\Test\\"; String suffix = ".jpg"; int imageCount = 1; while (converter.hasNextImage()) { converter.getNextImage(prefix + imageCount + suffix); imageCount++; } getCoordinateType
public PageCoordinateType getCoordinateType()
Gets the page coordinate type (Media/Crop boxes). CropBox value is used by default.
Returns: PageCoordinateType element @see PageCoordinateType
getEndPage
public int getEndPage()
Gets end position which you want to convert.
Returns: int value
getFormPresentationMode
public int getFormPresentationMode()
Gets form presentation mode.
Returns: form presentation mode. @see FormPresentationMode
getNextImage
Saves image to stream with default image format - jpeg.
getNextImage
Saves image to stream with given image format.
getNextImage
Saves image to stream with the givin image format, size and quality.
getNextImage
Saves image to stream with given image format and quality.
getNextImage
Saves image to stream with the givin image format, size and quality.
getNextImage
Saves image to stream with the givin image format, dimensions and quality.
getNextImage
Saves image to stream with given page size.
getNextImage
Saves image to stream with given page size.
getNextImage
Saves image to stream with given page size, image format and quality.
getNextImage
Saves image to file with default image format - jpeg.
getNextImage
Saves image to file with the givin image format.
PdfConverter converter = new PdfConverter(); converter.bindPdf(@"D:\Test\test.pdf"); converter.DoConvert(); String prefix = @"D:\Test\"; String suffix = ".png"; int imageCount = 1; while (converter.HasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Png); imageCount++; } getNextImage
Saves image to file with the givin image format, image size, and quality.
PdfConverter converter = new PdfConverter(); converter.bindPdf(@"D:\Test\test.pdf"); converter.doConvert(); String prefix = @"D:\Test\"; String suffix = ".jpg"; int imageCount = 1; float pixelX=800f; float pixelY=600f; while (converter.HasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Jpeg, pixelX, pixelY, 50); imageCount++; } getNextImage
Saves image to file with given image format and quality.
getNextImage
Saves image to file with the given image format and dimensions.
PdfConverter converter = new PdfConverter(); converter.bindPdf("D:\\Test\\test.pdf"); converter.DoConvert(); String prefix = "D:\\Test\\"; String suffix = ".jpg"; int imageCount = 1; while (converter.hasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Jpeg, 800, 1000); imageCount++; } getNextImage
Saves image to file with the given image format, dimensions and quality.
PdfConverter converter = new PdfConverter(); converter.bindPdf(@"D:\Test\test.pdf"); converter.doConvert(); String prefix = @"D:\Test\"; String suffix = ".jpg"; int imageCount = 1; while (converter.HasNextImage()) { converter.getNextImage(prefix + imageCount + suffix, ImageFormat.Jpeg, 800, 1000, 50); imageCount++; } getNextImage
Saves image to file with ith given page size and default image format - jpeg.
getNextImage
Saves image to file with given page size and image format.
getNextImage
Saves image to file with given page size, image format and quality.
getPageCount
public int getPageCount()
Gets the page count.
Returns: int value
getPassword
public String getPassword()
Gets document OwnerPassword.
Returns: String value
getRenderingOptions
public RenderingOptions getRenderingOptions()
Gets rendering options.
Returns: rendering options.
getResolution
public Resolution getResolution()
Gets resolution during converting. The higher resolution, the slower converting speed. The default value is 150.
Returns: Resolution element
getStartPage
public int getStartPage()
Gets start position which you want to convert. The minimal value is 1.
Returns: int value
getUserPassword
public String getUserPassword()
Gets document UserPassword.
Returns: String value
hasNextImage
public boolean hasNextImage()
Indicates whether the pdf file has more images or not.
Returns: Can get more images or not, true if can, or false.
isShowHiddenAreas
@Deprecated public boolean isShowHiddenAreas()
Gets flag that controls visibility of hidden areas on the page. Method is Deprecated.
Returns: boolean value
mergeImages
Merges list of image streams as one image stream.
mergeImagesAsTiff
Merges list of tiff streams as one multiple frames tiff stream.
saveAsTIFF
Converts each pages of a pdf document to images and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images and saves images to a single TIFF stream.
saveAsTIFF
Converts each pages of a pdf document to images and saves images to a single TIFF file.
PdfConverter converter = new PdfConverter(); converter.bindPdf(@"D:\Test\test.pdf"); converter.doConvert(); converter.saveAsTIFF(@"D:\Test\test.tiff");
saveAsTIFF
Converts each pages of a pdf document to images and saves images to a single TIFF file.
PdfConverter converter = new PdfConverter(); converter.bindPdf(@"D:\Test\test.pdf"); converter.doConvert(); converter.saveAsTIFF(@"D:\Test\test.tiff");
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with page size and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with page size and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with and saves images to a single TIFF file.
saveAsTIFF
Converts each pages of a pdf document to images with and saves images to a single TIFF file.
saveAsTIFFClassF
Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.
saveAsTIFFClassF
Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.
saveAsTIFFClassF
Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.
saveAsTIFFClassF
Converts each pages of a pdf document to images and save images to a single TIFF ClassF file.
PdfConverter converter = new PdfConverter(); converter.bindPdf("D:\\Test\\test.pdf"); converter.doConvert(); converter.saveAsTIFFClassF("D:\\Test\\test.tiff"); saveAsTIFFClassF
Converts each pages of a pdf document to images and save images to a single TIFF ClassF file.
PdfConverter converter = new PdfConverter(); converter.bindPdf(@"D:\Test\test.pdf"); converter.doConvert(); converter.saveAsTIFFClassF(@"D:\Test\test.tiff",204,196);
saveAsTIFFClassF
Converts each pages of a pdf document to images and save images to a single TIFF ClassF file.
setCoordinateType
Sets the page coordinate type (Media/Crop boxes). CropBox value is used by default.
setEndPage
public void setEndPage(int value)
Sets end position which you want to convert. use setEndPage(int) before setStartPage(int)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int value |
setFormPresentationMode
public void setFormPresentationMode(int value)
Sets form presentation mode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | form presentation mode. @see FormPresentationMode |
setPassword
Sets document OwnerPassword.
setRangeOfPages
public void setRangeOfPages(int startPage, int EndPage)
Sets range of pages between of which you want to convert.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| startPage | int value | |
| EndPage | int value |
setRenderingOptions
Sets rendering options.
setResolution
Sets resolution during converting. The higher resolution, the slower converting speed. The default value is 150.
setShowHiddenAreas
@Deprecated public void setShowHiddenAreas(boolean value)
Deprecated.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value |
setStartPage
public void setStartPage(int value)
Sets start position which you want to convert. The minimal value is 1. use setEndPage(int) before setStartPage(int)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int value |
setUserPassword
Sets document UserPassword.