Hi,

createFromFile is best for JPEG files. Because there the files are used unchanged. With createFromImage they are decompressed and recompressed with the Flate filter, this is a lossless compression.

I am surprised that the original JPEG would be 794 kb and the PDF 766 kb. The PDF shouldn't be smaller than the image. Please upload both files on a sharehoster for analysis.

Tilman

Am 27.05.2020 um 15:32 schrieb andreas.sta...@dachser.com:
Hello togehter,

if i create a inline jpeg inside a pdf file, with
LosslessFactory.createFromImage(..) the created pdf file have a size of
3293 kb. The same file created with PDImageObject.createFromFile(..) have
a size of
766 kb. The resolution of the jpeg image is 2480 x 3488 pixels. The size
of the image is 794 kb. The image should be inserted unchanged in the pdf
file.

What is the main difference between creating images with LosslessFactory
and PDImageObject.createFromFile ? What is in my case the best method?



Freundliche Grüße / Best Regards

Andreas Staiti




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to