Hi,
I’m using Aspose to create a PDF file and add images.
Here is the code I’m using:
try(Document documentPDF = new Document())
{
Page pageJPG;
com.aspose.pdf.Image imageJPG;
for (final String image : imageList) {
pageJPG = documentPDF.getPages().add();
imageJPG = new com.aspose.pdf.Image();
imageJPG.setFile(folder + File.separator + image + "_temp.jpg");
pageJPG.getPageInfo().getMargin().setBottom(0);
pageJPG.getPageInfo().getMargin().setTop(0);
pageJPG.getPageInfo().getMargin().setRight(0);
pageJPG.getPageInfo().getMargin().setLeft(0);
pageJPG.getParagraphs().add(imageJPG);
}
documentPDF.save(folder + File.separator + outputPDF);
}
The thing that for some input images, the result in the PDF is not good. The image is resized.
chq.jpg (78.3 KB)
chq.pdf (94.8 KB)
Do you know how to do to make the Image in the PDF has its original size ?
Thanks a lot