PdfConverter

Inheritance: java.lang.Object, com.aspose.pdf.facades.IVentureLicenseTarget, com.aspose.pdf.facades.Facade

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

ConstructorDescription
PdfConverter()Initializes new PdfConverter object.
PdfConverter(IDocument document)Initializes new PdfConverter object on base of the document .

Methods

MethodDescription
getCoordinateType()Gets the page coordinate type (Media/Crop boxes).
setCoordinateType(int value)Sets the page coordinate type (Media/Crop boxes).
isShowHiddenAreas()Gets flag that controls visibility of hidden areas on the page.
setShowHiddenAreas(boolean value)
getRenderingOptions()Gets rendering options.
setRenderingOptions(RenderingOptions value)Sets rendering options.
getFormPresentationMode()Gets form presentation mode.
setFormPresentationMode(int value)Sets form presentation mode.
getResolution()Gets resolution during converting.
setResolution(Resolution value)Sets resolution during converting.
getStartPage()Gets start position which you want to convert.
setStartPage(int value)Sets start position which you want to convert.
getEndPage()Gets end position which you want to convert.
setEndPage(int value)Sets end position which you want to convert.
setRangeOfPages(int startPage, int EndPage)Sets range of pages between of which you want to convert.
getPassword()Gets document OwnerPassword.
setPassword(String value)Sets document OwnerPassword.
getUserPassword()Gets document UserPassword.
setUserPassword(String value)Sets document UserPassword.
getPageCount()Gets the page count.
doConvert()Do some initial works for converting a pdf document to images.
saveAsTIFF(String outputFile)Converts each pages of a pdf document to images and saves images to a single TIFF file.
saveAsTIFF(String outputFile, int compressionType)Converts each pages of a pdf document to images and saves images to a single TIFF file.
saveAsTIFF(String outputFile, int imageWidth, int imageHeight)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFF(String outputFile, PageSize pageSize)Converts each pages of a pdf document to images with page size and saves images to a single TIFF file.
saveAsTIFF(String outputFile, PageSize pageSize, TiffSettings settings)Converts each pages of a pdf document to images with page size and saves images to a single TIFF file.
saveAsTIFF(String outputFile, int imageWidth, int imageHeight, int compressionType)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFF(String outputFile, int imageWidth, int imageHeight, TiffSettings settings)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFF(String outputFile, int imageWidth, int imageHeight, TiffSettings settings, IIndexBitmapConverter converter)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.
saveAsTIFFClassF(String outputFile, int imageWidth, int imageHeight)Converts each pages of a pdf document to images and save images to a single TIFF ClassF file.
saveAsTIFFClassF(String outputFile, PageSize pageSize)Converts each pages of a pdf document to images and save images to a single TIFF ClassF file.
saveAsTIFFClassF(OutputStream outputStream, int imageWidth, int imageHeight)Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.
saveAsTIFFClassF(OutputStream outputStream, PageSize pageSize)Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.
saveAsTIFF(OutputStream outputStream)Converts each pages of a pdf document to images and saves images to a single TIFF stream.
saveAsTIFF(OutputStream outputStream, int compressionType)Converts each pages of a pdf document to images and saves images to a single TIFF file.
saveAsTIFF(OutputStream outputStream, PageSize pageSize)Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream.
saveAsTIFF(OutputStream outputStream, PageSize pageSize, TiffSettings settings)Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream.
saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, int compressionType)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, TiffSettings settings)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, TiffSettings settings, IIndexBitmapConverter converter)Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.
hasNextImage()Indicates whether the pdf file has more images or not.
getNextImage(String outputFile)Saves image to file with default image format - jpeg.
getNextImage(String outputFile, PageSize pageSize)Saves image to file with ith given page size and default image format - jpeg.
convertPageToPNGMemoryStream(Page page)For internal usage only
getNextImage(String outputFile, ImageType format)Saves image to file with the givin image format.
getNextImage(String outputFile, PageSize pageSize, ImageType format)Saves image to file with given page size and image format.
getNextImage(OutputStream outputStream)Saves image to stream with default image format - jpeg.
getNextImage(OutputStream outputStream, PageSize pageSize)Saves image to stream with given page size.
getNextImage(OutputStream outputStream, ImageType format)Saves image to stream with given image format.
getNextImage(OutputStream outputStream, PageSize pageSize, ImageType format)Saves image to stream with given page size.
getNextImage(String outputFile, ImageType format, int imageWidth, int imageHeight, int quality)Saves image to file with the given image format, dimensions and quality.
getNextImage(OutputStream outputStream, ImageType format, int imageWidth, int imageHeight, int quality)Saves image to stream with the givin image format, dimensions and quality.
getNextImage(String outputFile, ImageType format, double imageWidth, double imageHeight, int quality)Saves image to file with the givin image format, image size, and quality.
getNextImage(OutputStream outputStream, ImageType format, double imageWidth, double imageHeight, int quality)Saves image to stream with the givin image format, size and quality.
bindPdf(String inputFile)Binds a Pdf file for converting.
bindPdf(InputStream inputStream)Binds a Pdf Stream for convert.
close()Close the instance of PdfConverter and release the resources.
saveAsTIFFClassF(String outputFile)Converts each pages of a pdf document to images and save images to a single TIFF ClassF file.
saveAsTIFFClassF(OutputStream outputStream)Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.
saveAsTIFF(String outputFile, TiffSettings settings)Converts each pages of a pdf document to images with and saves images to a single TIFF file.
saveAsTIFF(String outputFile, TiffSettings settings, IIndexBitmapConverter converter)Converts each pages of a pdf document to images with and saves images to a single TIFF file.
saveAsTIFF(OutputStream outputStream, TiffSettings settings)Converts each pages of a pdf document to images and saves images to a single TIFF stream.
saveAsTIFF(OutputStream outputStream, TiffSettings settings, IIndexBitmapConverter converter)Converts each pages of a pdf document to images and saves images to a single TIFF stream.
getNextImage(String outputFile, ImageType format, int imageWidth, int imageHeight)Saves image to file with the given image format and dimensions.
getNextImage(OutputStream outputStream, ImageType format, int imageWidth, int imageHeight)Saves image to stream with the givin image format, size and quality.
getNextImage(OutputStream outputStream, ImageType format, int quality)Saves image to stream with given image format and quality.
getNextImage(OutputStream outputStream, PageSize pageSize, ImageType format, int quality)Saves image to stream with given page size, image format and quality.
getNextImage(String outputFile, ImageType format, int quality)Saves image to file with given image format and quality.
getNextImage(String outputFile, PageSize pageSize, ImageType format, int quality)Saves image to file with given page size, image format and quality.
dispose()Close the instance of PdfConverter and release the resources.
mergeImages(List inputImagesStreams, int outputImageFormat, ImageMergeMode mergeMode, Integer horizontal, Integer vertical)Merges list of image streams as one image stream.
mergeImagesAsTiff(List inputImagesStreams)Merges list of tiff streams as one multiple frames tiff stream.

PdfConverter()

public PdfConverter()

Initializes new PdfConverter object.

PdfConverter(IDocument document)

public PdfConverter(IDocument document)

Initializes new PdfConverter object on base of the document .

Parameters:

ParameterTypeDescription
documentIDocumentPdf document.

getCoordinateType()

public int getCoordinateType()

Gets the page coordinate type (Media/Crop boxes). CropBox value is used by default.

Returns: int - PageCoordinateType element

setCoordinateType(int value)

public void setCoordinateType(int value)

Sets the page coordinate type (Media/Crop boxes). CropBox value is used by default.

Parameters:

ParameterTypeDescription
valueintPageCoordinateType element

isShowHiddenAreas()

public boolean isShowHiddenAreas()

Gets flag that controls visibility of hidden areas on the page. Method is Deprecated.

Returns: boolean - boolean value

setShowHiddenAreas(boolean value)

public void setShowHiddenAreas(boolean value)

Parameters:

ParameterTypeDescription
valueboolean

getRenderingOptions()

public RenderingOptions getRenderingOptions()

Gets rendering options.

Returns: RenderingOptions - rendering options.

setRenderingOptions(RenderingOptions value)

public void setRenderingOptions(RenderingOptions value)

Sets rendering options.

Parameters:

ParameterTypeDescription
valueRenderingOptionsrendering options.

getFormPresentationMode()

public int getFormPresentationMode()

Gets form presentation mode.

Returns: int - form presentation mode.

setFormPresentationMode(int value)

public void setFormPresentationMode(int value)

Sets form presentation mode.

Parameters:

ParameterTypeDescription
valueintform presentation mode.

getResolution()

public Resolution getResolution()

Gets resolution during converting. The higher resolution, the slower converting speed. The default value is 150.

Returns: Resolution - Resolution element

setResolution(Resolution value)

public void setResolution(Resolution value)

Sets resolution during converting. The higher resolution, the slower converting speed. The default value is 150.

Parameters:

ParameterTypeDescription
valueResolutionResolution element

getStartPage()

public int getStartPage()

Gets start position which you want to convert. The minimal value is 1.

Returns: int - int value

setStartPage(int value)

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:

ParameterTypeDescription
valueintint value

getEndPage()

public int getEndPage()

Gets end position which you want to convert.

Returns: int - int value

setEndPage(int value)

public void setEndPage(int value)

Sets end position which you want to convert. use setEndPage(int) before setStartPage(int)

Parameters:

ParameterTypeDescription
valueintint value

setRangeOfPages(int startPage, int EndPage)

public void setRangeOfPages(int startPage, int EndPage)

Sets range of pages between of which you want to convert.

Parameters:

ParameterTypeDescription
startPageintint value
EndPageintint value

getPassword()

public String getPassword()

Gets document OwnerPassword.

Returns: java.lang.String - String value

setPassword(String value)

public void setPassword(String value)

Sets document OwnerPassword.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getUserPassword()

public String getUserPassword()

Gets document UserPassword.

Returns: java.lang.String - String value

setUserPassword(String value)

public void setUserPassword(String value)

Sets document UserPassword.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getPageCount()

public int getPageCount()

Gets the page count.

Returns: int - int value

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++;
  }

saveAsTIFF(String outputFile)

public void saveAsTIFF(String outputFile)

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

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file to save the TIFF image.

saveAsTIFF(String outputFile, int compressionType)

public void saveAsTIFF(String outputFile, int compressionType)

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

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe output file.
compressionTypeintType of the compression.

saveAsTIFF(String outputFile, int imageWidth, int imageHeight)

public void saveAsTIFF(String outputFile, int imageWidth, int imageHeight)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.

saveAsTIFF(String outputFile, PageSize pageSize)

public void saveAsTIFF(String outputFile, PageSize pageSize)

Converts each pages of a pdf document to images with page size and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
pageSizePageSizeThe page size of the image.

saveAsTIFF(String outputFile, PageSize pageSize, TiffSettings settings)

public void saveAsTIFF(String outputFile, PageSize pageSize, TiffSettings settings)

Converts each pages of a pdf document to images with page size and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
pageSizePageSizeThe page size of the image.
settingsTiffSettingsSettings object that defines TIFF parameters.

saveAsTIFF(String outputFile, int imageWidth, int imageHeight, int compressionType)

public void saveAsTIFF(String outputFile, int imageWidth, int imageHeight, int compressionType)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
compressionTypeintType of the compression.

saveAsTIFF(String outputFile, int imageWidth, int imageHeight, TiffSettings settings)

public void saveAsTIFF(String outputFile, int imageWidth, int imageHeight, TiffSettings settings)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
settingsTiffSettingsSettings object that defines TIFF parameters.

saveAsTIFF(String outputFile, int imageWidth, int imageHeight, TiffSettings settings, IIndexBitmapConverter converter)

public void saveAsTIFF(String outputFile, int imageWidth, int imageHeight, TiffSettings settings, IIndexBitmapConverter converter)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
settingsTiffSettingsSettings object that defines TIFF parameters.
converterIIndexBitmapConverterExternal converter

saveAsTIFFClassF(String outputFile, int imageWidth, int imageHeight)

public void saveAsTIFFClassF(String outputFile, int imageWidth, int imageHeight)

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

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe stream to save the TIFF image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.

saveAsTIFFClassF(String outputFile, PageSize pageSize)

public void saveAsTIFFClassF(String outputFile, PageSize pageSize)

Converts each pages of a pdf document to images and save images to a single TIFF ClassF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe stream to save the TIFF image.
pageSizePageSizeThe page size of the image.

saveAsTIFFClassF(OutputStream outputStream, int imageWidth, int imageHeight)

public void saveAsTIFFClassF(OutputStream outputStream, int imageWidth, int imageHeight)

Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.

saveAsTIFFClassF(OutputStream outputStream, PageSize pageSize)

public void saveAsTIFFClassF(OutputStream outputStream, PageSize pageSize)

Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
pageSizePageSizeThe page size of the image.

saveAsTIFF(OutputStream outputStream)

public void saveAsTIFF(OutputStream outputStream)

Converts each pages of a pdf document to images and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.

saveAsTIFF(OutputStream outputStream, int compressionType)

public void saveAsTIFF(OutputStream outputStream, int compressionType)

Converts each pages of a pdf document to images and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe output stream.
compressionTypeintType of the compression.

saveAsTIFF(OutputStream outputStream, PageSize pageSize)

public void saveAsTIFF(OutputStream outputStream, PageSize pageSize)

Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
pageSizePageSizeThe page size of the image.

saveAsTIFF(OutputStream outputStream, PageSize pageSize, TiffSettings settings)

public void saveAsTIFF(OutputStream outputStream, PageSize pageSize, TiffSettings settings)

Converts each pages of a pdf document to images with page size and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
pageSizePageSizeThe page size of the image.
settingsTiffSettingsSettings object that defines TIFF parameters.

saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight)

public void saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.

saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, int compressionType)

public void saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, int compressionType)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
compressionTypeintType of the compression.

saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, TiffSettings settings)

public void saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, TiffSettings settings)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
settingsTiffSettingsSettings object that defines TIFF parameters.

saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, TiffSettings settings, IIndexBitmapConverter converter)

public void saveAsTIFF(OutputStream outputStream, int imageWidth, int imageHeight, TiffSettings settings, IIndexBitmapConverter converter)

Converts each pages of a pdf document to images with dimensions, and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
settingsTiffSettingsSettings object that defines TIFF parameters.
converterIIndexBitmapConverterExternal converter

hasNextImage()

public boolean hasNextImage()

Indicates whether the pdf file has more images or not.

Returns: boolean - Can get more images or not, true if can, or false.

getNextImage(String outputFile)

public void getNextImage(String outputFile)

Saves image to file with default image format - jpeg.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.

getNextImage(String outputFile, PageSize pageSize)

public void getNextImage(String outputFile, PageSize pageSize)

Saves image to file with ith given page size and default image format - jpeg.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
pageSizePageSizeThe page size of the image.

convertPageToPNGMemoryStream(Page page)

public System.IO.MemoryStream convertPageToPNGMemoryStream(Page page)

For internal usage only

Parameters:

ParameterTypeDescription
pagePageInternal object

Returns: com.aspose.ms.System.IO.MemoryStream - Internal object

getNextImage(String outputFile, ImageType format)

public void getNextImage(String outputFile, ImageType format)

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++;
  }

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
formatImageTypeThe format of the image.

getNextImage(String outputFile, PageSize pageSize, ImageType format)

public void getNextImage(String outputFile, PageSize pageSize, ImageType format)

Saves image to file with given page size and image format.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
pageSizePageSizeThe page size of the image.
formatImageTypeThe format of the image.

getNextImage(OutputStream outputStream)

public void getNextImage(OutputStream outputStream)

Saves image to stream with default image format - jpeg.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.

getNextImage(OutputStream outputStream, PageSize pageSize)

public void getNextImage(OutputStream outputStream, PageSize pageSize)

Saves image to stream with given page size.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
pageSizePageSizeThe page size of the image.

getNextImage(OutputStream outputStream, ImageType format)

public void getNextImage(OutputStream outputStream, ImageType format)

Saves image to stream with given image format.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
formatImageTypeThe format of the image.

getNextImage(OutputStream outputStream, PageSize pageSize, ImageType format)

public void getNextImage(OutputStream outputStream, PageSize pageSize, ImageType format)

Saves image to stream with given page size.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
pageSizePageSizeThe page size of the image.
formatImageTypeThe format of the image.

getNextImage(String outputFile, ImageType format, int imageWidth, int imageHeight, int quality)

public void getNextImage(String outputFile, ImageType format, int imageWidth, int imageHeight, int quality)

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++;
  }

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
formatImageTypeThe format of the image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

getNextImage(OutputStream outputStream, ImageType format, int imageWidth, int imageHeight, int quality)

public void getNextImage(OutputStream outputStream, ImageType format, int imageWidth, int imageHeight, int quality)

Saves image to stream with the givin image format, dimensions and quality.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
formatImageTypeThe format of the image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

getNextImage(String outputFile, ImageType format, double imageWidth, double imageHeight, int quality)

public void getNextImage(String outputFile, ImageType format, double imageWidth, double imageHeight, int quality)

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++;
  }

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
formatImageTypeThe format of the image.
imageWidthdoubleThe image width, the unit is pixels.
imageHeightdoubleThe image height, the unit is pixels..
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

getNextImage(OutputStream outputStream, ImageType format, double imageWidth, double imageHeight, int quality)

public void getNextImage(OutputStream outputStream, ImageType format, double imageWidth, double imageHeight, int quality)

Saves image to stream with the givin image format, size and quality.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
formatImageTypeThe format of the image.
imageWidthdoubleThe image width, the unit is pixel.
imageHeightdoubleThe image height, the unit is pixel.
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

bindPdf(String inputFile)

public void bindPdf(String inputFile)

Binds a Pdf file for converting.

Parameters:

ParameterTypeDescription
inputFilejava.lang.StringThe pdf file.

bindPdf(InputStream inputStream)

public void bindPdf(InputStream inputStream)

Binds a Pdf Stream for convert.

Parameters:

ParameterTypeDescription
inputStreamjava.io.InputStreamThe pdf Stream.

close()

public void close()

Close the instance of PdfConverter and release the resources.

saveAsTIFFClassF(String outputFile)

public void saveAsTIFFClassF(String outputFile)

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

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe stream to save the TIFF image.

saveAsTIFFClassF(OutputStream outputStream)

public void saveAsTIFFClassF(OutputStream outputStream)

Converts each pages of a pdf document to images and save images to a single TIFF ClassF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.

saveAsTIFF(String outputFile, TiffSettings settings)

public void saveAsTIFF(String outputFile, TiffSettings settings)

Converts each pages of a pdf document to images with and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
settingsTiffSettingsSettings.

saveAsTIFF(String outputFile, TiffSettings settings, IIndexBitmapConverter converter)

public void saveAsTIFF(String outputFile, TiffSettings settings, IIndexBitmapConverter converter)

Converts each pages of a pdf document to images with and saves images to a single TIFF file.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file name to save the TIFF image
settingsTiffSettingsSettings.
converterIIndexBitmapConverterExternal converter

saveAsTIFF(OutputStream outputStream, TiffSettings settings)

public void saveAsTIFF(OutputStream outputStream, TiffSettings settings)

Converts each pages of a pdf document to images and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
settingsTiffSettingsSettings object that defines TIFF parameters.

saveAsTIFF(OutputStream outputStream, TiffSettings settings, IIndexBitmapConverter converter)

public void saveAsTIFF(OutputStream outputStream, TiffSettings settings, IIndexBitmapConverter converter)

Converts each pages of a pdf document to images and saves images to a single TIFF stream.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the TIFF image.
settingsTiffSettingsSettings object that defines TIFF parameters.
converterIIndexBitmapConverterExternal converter

getNextImage(String outputFile, ImageType format, int imageWidth, int imageHeight)

public void getNextImage(String outputFile, ImageType format, int imageWidth, int imageHeight)

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++;
  }

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
formatImageTypeThe format of the image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.

getNextImage(OutputStream outputStream, ImageType format, int imageWidth, int imageHeight)

public void getNextImage(OutputStream outputStream, ImageType format, int imageWidth, int imageHeight)

Saves image to stream with the givin image format, size and quality.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
formatImageTypeThe format of the image.
imageWidthintThe image width, the unit is pixel.
imageHeightintThe image height, the unit is pixel.

getNextImage(OutputStream outputStream, ImageType format, int quality)

public void getNextImage(OutputStream outputStream, ImageType format, int quality)

Saves image to stream with given image format and quality.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
formatImageTypeThe format of the image.
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

getNextImage(OutputStream outputStream, PageSize pageSize, ImageType format, int quality)

public void getNextImage(OutputStream outputStream, PageSize pageSize, ImageType format, int quality)

Saves image to stream with given page size, image format and quality.

Parameters:

ParameterTypeDescription
outputStreamjava.io.OutputStreamThe stream to save the image.
pageSizePageSizeThe page size of the image.
formatImageTypeThe format of the image.
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

getNextImage(String outputFile, ImageType format, int quality)

public void getNextImage(String outputFile, ImageType format, int quality)

Saves image to file with given image format and quality.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
formatImageTypeThe format of the image.
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

getNextImage(String outputFile, PageSize pageSize, ImageType format, int quality)

public void getNextImage(String outputFile, PageSize pageSize, ImageType format, int quality)

Saves image to file with given page size, image format and quality.

Parameters:

ParameterTypeDescription
outputFilejava.lang.StringThe file path and name to save the image.
pageSizePageSizeThe page size of the image.
formatImageTypeThe format of the image.
qualityintThe Jpeg file’s quality (0~100), 0 is lowest and 100 is highest

dispose()

public void dispose()

Close the instance of PdfConverter and release the resources.

This method is obsolete, use close() instead.

mergeImages(List inputImagesStreams, int outputImageFormat, ImageMergeMode mergeMode, Integer horizontal, Integer vertical)

public static InputStream mergeImages(List<InputStream> inputImagesStreams, int outputImageFormat, ImageMergeMode mergeMode, Integer horizontal, Integer vertical)

Merges list of image streams as one image stream. Png/jpg/tiff outputs formats are supported, in case of using non supported format output stream encoded as Jpeg by default.

Parameters:

ParameterTypeDescription
inputImagesStreamsjava.util.List<java.io.InputStream>The list of image streams to merge.
outputImageFormatintImage output format for merged stream.
mergeModeImageMergeModeMerge mode. Used for Png/Jpg formats.
horizontaljava.lang.IntegerHorizontal ratio to set canvas width for output image stream. Used for Png/Jpg formats with ImageMergeMode.Center only.
verticaljava.lang.IntegerVertical ratio to set canvas height for output image stream. Used for Png/Jpg formats with ImageMergeMode.Center only.

Returns: java.io.InputStream - Image stream encoded as output image format.

mergeImagesAsTiff(List inputImagesStreams)

public static InputStream mergeImagesAsTiff(List<InputStream> inputImagesStreams)

Merges list of tiff streams as one multiple frames tiff stream.

Parameters:

ParameterTypeDescription
inputImagesStreamsjava.util.List<java.io.InputStream>The list of tiff streams.

Returns: java.io.InputStream - Multiple frames tiff stream.