Use PNG instead of converting to JPEG?

This Forum is for the use of End Users requiring help and assistance for Tracker Software's OFFice2PDF and MS Office Addin Applications - supplied with PDF-XChange.

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

Post Reply
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Use PNG instead of converting to JPEG?

Post by HExSM »

When using the MS Office Addin it seems to convert PNGs to JPEG. This causes JPEG artifacts. If we are using Adobe Acrobat or the Microsoft built in option to save the document as PDF, then there are no JPEG artifacts for the same image. It seems to keep the original image.

Here is an example at zoom level 1200%:
PDF-XChange
PDF-XChange
Adobe Acrobat
Adobe Acrobat
I tried turning off the image compression and change the image compression method to Flate. Both worked, but the files size of the PDF was way to big.

Is there a way to optimize that behavior somehow?
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Use PNG instead of converting to JPEG?

Post by TrackerSupp-Daniel »

Hello, HExSM

Can I ask you to please send us a copy of the office document you are using for this conversion, and the original image, so that we can run a few tests on them here? I do see the artifacts you speak of in the images you sent, but having the original will help us to work on this more efficiently.

Also, I need to ask, are you using the current latest release? We are now in version 9.2, build 358.0, which can be downloaded here: https://www.pdf-xchange.com/product/downloads

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Daniel,

I'm using build 9.2.358.0 for my tests.
Attached you will find a simple word document with just the image, the image itself and the saved PDF.

Best regards,
Stefan
Attachments
PDF-XChange_Image-Issue.zip
(469.77 KiB) Downloaded 136 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17771
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Use PNG instead of converting to JPEG?

Post by Tracker Supp-Stefan »

Hello HExSM,

The results will vary based on the compression settings here:
image.png
And you can see the resulting files (and their respective sizes) in the attachments further below.
14.2KB with the standard compression (and degradation of quality)
21.4KB with the "Flate" compression as on my above screenshot
and
128KB with no compression.

Alternatively you can also drag and drop your file over the Editor - and let it do the conversion. The image quality will be preserved, and the file size will be comparable with the smallest produced by the add in with the standard compression.

Kind regards,
Stefan
Add-in_Flate_compression.pdf
(21.49 KiB) Downloaded 142 times
Add-in_standard_compression.pdf
(14.2 KiB) Downloaded 145 times
Add_in_No_image_compression.pdf
(128.93 KiB) Downloaded 146 times
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Stefan,

maybe my example wasn't that good.

I inserted a photo into the word document and did the export with compression type Flate. The size of the PDF is now ~10 MB when saved with PDF-XChange Office Add-In and ~200 KB when saved with the default Word save as function.

I couldn't upload the file. Is there a file size limit?

You can download it at https://www.file-upload.net/download-14737657/PDF-XChange_Image-Issue_Update.zip.html
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Use PNG instead of converting to JPEG?

Post by Paul - Tracker Supp »

Hi HExSM,

thanks for the samples of this. I tried using "Flate" for all three HighColor/Grey Scale, Indexed, and Monochrome and got a file size of 2.9M

I suspect tweaking these compression settings may yield further improvements. I will ask the devs opinion whether there is something we need to change here or just adjust the currently available settings. I will confess to not being an expert on them all.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Use PNG instead of converting to JPEG?

Post by Paul - Tracker Supp »

Hi again HExSM,

I learned that the reason for this is the printing. When MS convert the file they have access t the original image, when we convert via the Office Add-In or Standard Printer we are sent an upscaled version of the images. It all comes down to what we have to work with.

Now if you set the Standard printer to use the XPS engine then we can do a better job. Simply printing this Word file to PDF using Standard and the XPS engine with defaults produced a result much more like the one from Microsoft. It was actually 68 KB smaller and looks very similar when zoomed in on that warning logo.
Also if I drag and drop the Word file into the Editor it does a conversion on the fly, again using the XPS engine and again got a similar result
PDF-XChange_Image-Text-Document_Editor.pdf
(184.35 KiB) Downloaded 145 times
Do you see similar results using those approaches?
Attachments
PDF-XChange_Image-Text-Document_Editor_flate.pdf
(184.35 KiB) Downloaded 135 times
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Paul,

thank you for the researching. But there must be a way to get access to the original image for your Office Add-In, because the Adobe Acrobat Add-In also produces no artifacts, like the default Word export. I attached the PDF produces by the Adobe Acrobat Add-In. It's bigger than the Word export, because Acrobat seems to use JPEG quality of 95%.

I tried your suggested method and changed the print mode from GDI to XPS and can confirm your results. With Flate the file size was reduced from ~ 10 MB to ~ 2,9 MB, which is better but still to big. We produce documents with a lot of images and I guess we would end up with PDFs of several hundreds of MB with that method. I also tried dropping the Word File inside the editor and that works really good! But as you know, people are lazy. So it would be nice, if you could find a way to access the original images with the Office Add-In too.

Best regards
Stefan
Attachments
PDF-XChange_Image-Text-Document_Acrobat.pdf
(563.92 KiB) Downloaded 140 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17771
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Use PNG instead of converting to JPEG?

Post by Tracker Supp-Stefan »

Hello HExSM,

As you said yourself - Adobe is also using JPEG - as can be seen by the noise in the image in your latest sample when zoomed in:
image.png
image.png (58.34 KiB) Viewed 6634 times
So they also do not have access to the original PNG, and have to work with what is supplied to them.
The difference is that our default is 75% quality, and theirs is 95 - hence the visually different results.
I am not an expert in Adobe's product, but maybe they are also using XPS by default - and that would also influence the final result.

Please consider the XPS option for our driver - this is something you will need to set up once, and then people could continue to be 'lazy' ;)
And the alternative to drag and drop the files over the Editor is also always going to be there.

Kind regards,
Stefan
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Stefan,

you have to check the yellow warning icon and not the pizza image. There you can see, that Adobe uses the original image. When you zoom in, you will find NO artifacts. It has the same quality as the default Word export.

You can already find the noise of the other image in the source file. It has nothing to do with the export. I just inserted that image to show you the size difference between the exports of Word, Acrobat and PDF-XChange, when you use the Flate compression.

XPS does NOT solve the problem when you use the Office Add-In. There are still artifacts, because you don't use the original image. The only "solution" so far is to use the Editor, drop the DOCX there and save the PDF. I tried that with a real document and there where no bookmarks generated automatically. So it's no real solution to use the Editor.

Best regards
Stefan
Attachments
PDF-XChange Office Add-In (XPS)
PDF-XChange Office Add-In (XPS)
Word
Word
Adobe Acrobat Office Add-In
Adobe Acrobat Office Add-In
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17771
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Use PNG instead of converting to JPEG?

Post by Tracker Supp-Stefan »

Hello HExSM,

When using our Add-in or File -> Print in the Word menus - this has to go through our drivers, and unfortunately for the information to reach the driver - it IS processed by Word initially, and this extra step adds the blurriness to the source content.

It might be that Adobe's plug-in just takes the 'raw' word file and directly processes that in a way similar to how our Editor does it (and Word's internal conversion), but I am afraid that the Add-in and File-> Print do go through different internal mechanics in Word and as such the quality there will always be different.

Kind regards,
Stefan
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Stefan,

thank you for the explanation. So it's not possible to reach the same quality with the Microsoft Office Add-In. That means I have 2 options:
  1. Use the Office Add-In, which produces LOWER quality images, but does generate the bookmarks tree automatically.
  2. Use the Editor, which provides high quality images, but does NOT generate the bookmarks tree automatically.
Or is there a way to generate the bookmarks tree automatically, when I use the Editor to generate the PDF?

Best regards,
Stefan
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Use PNG instead of converting to JPEG?

Post by Willy Van Nuffel »

Hi all,

I know it is besides the original question, but I would like to ask @HExSM if there is a particular reason for not using Microsoft Word itself for executing the conversion to a PDF-document (File > Save As > PDF or File > Export > PDF/XPS), because hyperlinks keep working and Headings are converted to bookmarks, just like the PDF-XChange Office Add-in is doing.

Kind regards.

Willy
Attachments
Microsoft Word - Save As PDF - Options.png
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Willy,

the reason is that Microsoft Word allows a maximum of 275 dpi for images when exporting PDF. Images with a higher dpi are down-sampled to 200 dpi. But we need at least 300 dpi for many documents.

As a workaround, we could down-sample the images we use to 274 dpi in advance so that Word doesn't down-sample them to 200 dpi. But that would be extra work that we want to save.

Best regards
Stefan
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Use PNG instead of converting to JPEG?

Post by Willy Van Nuffel »

Thanks for your answer Stefan.

The limitation of dpi while saving to PDF is something I was not aware of.

I have searched a while on the internet, looking for more information, but it was not immediately clear.

It seems like the option "Optimize for image quality" (Options-button in the Save As pdf dialog-box) has no direct influence.
I wonder if the other options about "Compress Pictures..." available via the Tools-menu (also in the Save As pdf dialog-box) would have some influence. Did you already try these?

Regards.

Willy
Attachments
Microsoft Word - Save As PDF - Compress Pictures.png
Microsoft Word - Save As PDF - Compress Pictures.png (9.06 KiB) Viewed 6607 times
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Willy,

this setting is only relevant for saving Word documents. If you change it when saving as PDF, then down-scaling to 200 dpi still takes place.

Best regards,
Stefan
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Use PNG instead of converting to JPEG?

Post by Paul - Tracker Supp »

It seems to me that this is the crux of your issue:
Use the Office Add-In, which produces LOWER quality images, but does generate the bookmarks tree automatically.
Use the Editor, which provides high quality images, but does NOT generate the bookmarks tree automatically.
If we could either allow XPS via the Office Add-In which we currently don't, or make drag and drop generate the bookmarks tree automatically.

Now I do not know if either of these are a practical option, or if there is a technical reason we can't do this but I am going to find out.

Would you have a preference if offered?
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Use PNG instead of converting to JPEG?

Post by Paul - Tracker Supp »

So on discussing this with the devs I have raised a formal Feature Request to add the XPS engine option to the Office Add-In.

Generating bookmarks via Drag and Drop is not going to be possible.

I do not have a timeline for delivery, that will be at the discretion of the development team leader, but if you refer to RT#5785: Feature Request :: Office Addin :: Add support for the XPS engine when asking about this we can get you a status report.

cheers
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

Hi Paul,

thank you very much! I would have been happy with either option, but the Office Add-in would be my preferred choice.

Now I hope that the feature will be implemented in the near future and the graphics can be exported in the same quality as with Word. This is currently the biggest blocker that prevents us from switching from Acrobat to PDF-XChange.

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

Re: Use PNG instead of converting to JPEG?

Post by Tracker Supp-Stefan »

Hello Stefan,

There's no estimate yet as to when this feature will be ready, but as soon as it is - we will post again here in this topic to let you know!

Kind regards,
Stefan
HExSM
User
Posts: 15
Joined: Wed Oct 27, 2021 1:47 pm

Re: Use PNG instead of converting to JPEG?

Post by HExSM »

After 2 years, is there any update on that issue?
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Use PNG instead of converting to JPEG?

Post by TrackerSupp-Daniel »

Hello, HExSM

At the moment, I am afraid it does not appear there has been much progress on this issue. I have just prompted the team for some information on it, and will get back to you as soon as I hear something.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply