Hi,
We have a concern regarding the quality of converted Bmp files into Pdf documents.
When we put a Bmp file inside a Pdf document, it is internaly converted to Jpeg. This sometimes produce an image of poor quality compared to the one used to generate the Pdf document.
Is it possible for the Bmp file to not be converted to Jpeg?
Is it possible to control the quality of the Jpeg written in the Pdf document?
Do you have any other clues about this issue?
I have included a sample solution to demonstrate the results.
Thank you!
Hi François,
Thanks for using our API’s.
Its an expected behavior of API to render images in JPEG format when placing them inside PDF file. During my testing, I have observed that image appears fine in resultant file when using following code snippet to convert BMP image to PDF format.
[C#]
using (Document pdfDocument = new Document())
{
pdfDocument.Pages.Add();
Aspose.Pdf.Image image = new Aspose.Pdf.Image();
image.File = @"C:\pdftest\Sample.bmp";
pdfDocument.Pages[1].Paragraphs.Add(image);
pdfDocument.Save(@"C:\pdftest\Sample_converted.pdf");
}
The resulting file is not fine.
Please, use the Sample.bmp file in my example with your code and see the results. Look closely at the resulting pdf file.
Phwanky:
The resulting file is not fine.
Please, use the Sample.bmp file in my example with your code and see the results. Look closely at the resulting pdf file.
Hi François,
Thanks for sharing the details.
I have logged above stated issue as PDFNET-41198 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.
Thank you!
Related to this, why the old API (Generator) stores image files (GIF, PNG, TIFF, etc.) as is in the pdf file and the new DOM API convert them to JPEG prior to putting them in the pdf?
I attached a sample project with the two conversion methods.
Thank you!
Hi François,
Thanks for sharing the sample project.
I have tested the scenario and have managed to reproduce the same problem that the output generated with new DOM approach is different than output generated with Aspose.Pdf.Generator. For the sake of further investigation, this information has been associated with earlier reported issue and as soon as we have some further updates, we will let you know.