Hi,
I'm using FreeSpire.PDF to convert JPEG-files to the PDF-format, I need that for a special application.
This is a very simple workflow in Spire.PDF, however I would like to have the imagequality as high as possible (off course the max quality is determined by the JPEG-sourcefiles).
I use the following code to put the image on the canvas:
page.Canvas.DrawImage(image, 0, 0, fitWidth, fitHeight)
In the lines before I have calculated the fitWidth and fiHeight for an optimal usage of the available space, which works fine.
I notice that the resulting PDF-files (each file just contains 1 image and nothing more) are much smaller than the original JPEG image, which imo means that I lose image quality.
It looks as if Spire.PDF compresses more heavy than the compression used in the Original JPEG-file
So I found the extra parameter of the page.canvas.DrawImage function that should give me control over the CompressionQuality in the PDF.
I played with values in the range 0~100 but constantly get an error in VB.net.
If I for instance try: page.Canvas.DrawImage(image, 50, 0, -575, fitWidth, fitHeight) Where 50 is the compressionquality, I get a System.NullReferenceException.
This happens with all values that I use for the compressionquality.
My questions are:
1. Do I oversee something?
2. How to preserve maximum quality of images with the Drawimage function?
3. Is this perhaps a limitation of the free version of Spire.PDF?
Finally, I want to compliment E-Iceblue with the product and thank you for the support in advance!
regards, Henk