Hi ,
-
Attached is the PDF Sample file and it is failing at Page#11.
-
Below is Code Snippet which we use for conversion, We are using DPI flow.
private void applyPDFConversion(Document pdfDocument, String[] requestData, int pageCount,
String asposeResultFileName) throws IOException {
OutputStream imageStream = new FileOutputStream(asposeResultFileName);
// Create Resolution object
Resolution resolution;
// Create JpegDevice object with particular resolution
JpegDevice jpegDevice;
// Get aspose conversion flow
AsposeConversionMode resolutionMode = AsposeConversionMode.valueOf(config.getAsposeConversionMode());
// ******* Use DPI flow *******
if (resolutionMode == AsposeConversionMode.DPI) {
resolution = new Resolution(config.getAsposeDpiValue());
jpegDevice = new JpegDevice(resolution);
} else if (resolutionMode == AsposeConversionMode.DIMENSION) {
// ******* Use DIMENSION Flow *******
int fixedWidth = config.getAsposeFixedWidth();
int heightCalculated = calculateHeight(fixedWidth,
Double.parseDouble(requestData[4]),
Double.parseDouble(requestData[5]));
resolution = new Resolution(fixedWidth, heightCalculated);
jpegDevice = new JpegDevice(fixedWidth, heightCalculated, resolution);
} else {
jpegDevice = new JpegDevice();
}
// Convert a particular page and save the image to stream
jpegDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);
// Close the stream
imageStream.close();
log.info("iteration {}, ASPOSE conversion process for image \"{}\" completed. Starting resizing flow.",
pageCount, asposeResultFileName);
}