Loss of Image Quality.zip (423.1 KB)
Based on your code suggestion I created this console app to test jpeg quality:
static void Main(string args)
Console.WriteLine("Hello Aspsoe World to PDF!");
License lic = new License();
Document doc = new Document("Y0096_MRK_IL_PDPFRM_Value19_C.docx");
//var pdfOptions = new PdfSaveOptions
// ImageCompression = PdfImageCompression.Auto,
// JpegQuality = 100
I tested WITH and WITHOUT setting PdfSaveOptions. Here is the explanation for the different files:
Logo_From_Word.jpg > This is the original image saved directly from the .docx document.
Logo_From_AsposePDF.jpg > This images was saved from the PDF generated by the above code
Logo_From_WordToPDFExport.jpg > This image was saved directly from the PDF generatade by MS Word’s Export to PDF command
Logo_From_AsposePDFwithPdfOptions100.jpg > This image was saved from PDF generated by the above code with PdfSaveOptions uncommented
The result shows the following, please see attached LogoJpegComparision.jpg:
A. Aspose’s v19.10 doc.Save() does compresses and/or changes jpeg image quality
B. MS Word’s Export to PDF function compresses and/or changes jpeg image quality
C. Aspose’s v19.10 doc.Save() function with PdfSaveOptions.JpegQuality = 100 will produce the same compressed jpeg result as MS Word’s Export to PDF function
All 3 options, Aspose and MS Word cuts back the original image’s quality.
We would like to know if Aspose Word is able to generate PDF from Word .docx document without changing the quality of the jpeg image of the Word document and if yes, how.
I have attached the first page of the Word .docx document as well.
Please let me know if you need any other information from us.
PS: I realized that I did not include test with ImageCompression = PdfImageCompression.Jpeg, JpegQuality = 100. the result of this was identical with 2. Logo_From_AsposePDF.jpg, thus unfortunately it also had loss of quality.