"Create PDF from Images" with preservation of the PNG in the document

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
User avatar
Jensen Head
User
Posts: 412
Joined: Mon Sep 13, 2021 8:12 am

"Create PDF from Images" with preservation of the PNG in the document

Post by Jensen Head »

On the "Image To PDF Options" screen, there is no PNG option in the "Image Compression" category. Do I understand correctly that when creating a PDF from a PNG, the images will always be re-encoded? And there is no way to save images in PDF in their original format, without loss of quality and / or size?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: "Create PDF from Images" with preservation of the PNG in the document

Post by Tracker Supp-Stefan »

Hello Jensen Head,

The PDF specification does not really store images in their original file formats. It refers to image XForm objects that contain all the pixel information, but yes - that has to be reformatted when you are adding raster content to a PDF file.
When the image data is added to the file - it has to be encoded, and then when the file is to be rendered - this has to be decoded back to an image. These are the standard decoding filters in the PDF Specification:
image.png
So we need to store image data in a way that can then be decoded using one of the above. As you can see there are only JPEG/JPEG2000 options in there, and it's not possible for us to preserve the lossless png encoding of the source image - sorry.

Kind regards,
Stefan
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: "Create PDF from Images" with preservation of the PNG in the document

Post by Tracker Supp-Stefan »

Hello again Jensen Head,

Actually - I had a talk with my colleagues from the dev team, and they told me that if the correct type of PNG is fed to the Editor then we will store the image data from this PNG inside the file using "Flate" compression.
The 'correct type of PNG means that there are no interlace and no alpha channels in the file, however transparent colours are allowed.

I just tested - and if I create a PNG (took a screenshot of this forum discussion), and create a PDF file out from it (compression turned off for "Create PDF from images") - then the file created while a bit large can then be used in PDF Tools so that you can extract the PNG image back. (If you need a smaller file - you can "Create from images" with compression off, and then "Save as Optimized" inside the Editor, and select to retain the existing compression for images - and this will give you a small file)

Kind regards,
Stefan
Post Reply