ncjoes / office-converter

PHP Wrapper for LibreOffice
MIT License
197 stars 75 forks source link

Imagequality bad & not lossless #25

Open the-hotmann opened 3 years ago

the-hotmann commented 3 years ago

I now convert .docx documents to PDF and noticed a huge drop in Imagequality. When I insert a PNG into the document it converts it to JPEG which decrese imagequality and also makes it lose its transparency.

Is there a option to convert images in the same format, or even lossless? The Image I inserted is just 20Kb in the source so this would not matter, but let me show you what is happening by converting from DOCX to PDF:

PDF (screenshot) phpWord (original)

Here the same with high contrast: phpWord (modified)

Even higher contrast: phpWord (modified 2)

So you can clearly see where the image begins and ends as its background starts to have this pattern. phpWord (modified 2) - Kopie

But the original Image does not havw this and is a 100% transparent PNG with NO Background.. Does someone know how to force the office converter to not convert from PNG to JPEG and to not drop quality?

Best regards

the-hotmann commented 3 years ago

Seems like there normaly is an option to choose lossless export to PDF

  1. v4.2 https://help.libreoffice.org/4.2/Common/Export_as_PDF#Images
  2. v7.0 https://help.libreoffice.org/latest/en-US/text/shared/01/ref_pdf_export_general.html

Anyone knows how to force this in this converter?