Maybe it is a bug or maybe I am not using your library correctly. I hope it’s the latter and that you could show me please how to do it better.
In our processing of merging differents documents types to a pdf document, we encountered something strange, depending on the documents used for the merge, dimensions are or are not preserved.
The used documents are in the “resources” directory of the project :
(1) ppt2.pdf : a file resulting from the conversion of ppt2.pptx to pdf format. Since they come from a slide, it is ok that pages are smaller than standard PDF pages and are in landscape mode.
(2) demo0002.tif : a A4 scanned tif image
(3) test1.pdf : a A4 simple one page pdf
=> if merging (1) + (3) : the pages dimensions of ppt2.pdf are preserved in merged_result.pdf.
=> if merging (1) + (2) or (1) + (2) + (3) : the ppt2.pdf pages have not the right width and height in merged_result.pdf.
I attached this eclipse project with a small program and data files to reproduce : TestAspose.zip (2.2 MB)
Before running the test, please :
- in the main() method, replace “D:/src/workspace_20220316/TestAspose/” with your own project directory
- add aspose-pdf-22.2.jar in the /lib directory. (too big to put in the zip)
- add aspose-slides-22.3-jdk16.jar in the /lib directory. (too big to put in the zip)
- add Aspose.Total.Product.Family.lic in the root directory
Sorry I could download the aspose-pdf-22.2.jar, but the download of the last 22.3 version does not work : your repository show it but returns this error :
<Message>The specified key does not exist.</Message>
In the source TestAspose.java, if one comments out the bloc (lines 59-62) which adds the image (loadImage(…)) then this is the case (1) + (3) and the dimensions of the 2 firsts pages are OK in merged_result.pdf.
But if the bloc which adds the image (lines 59-62) is compiled and executed, then this is the case (1) + (2) + (3) then you can find the bad dimensions of pages 1 and 2 in the file merged_result.pdf.
My question : how could I do to have dimensions preserved in all cases ?