I have trouble changing PDF compression level, and JPEG quality. Compressing is definitely present but changing it [1..9] i.e. [0..100] has no effect.
We are using GDPicture5 Active-X control - it is bought.
Here is what I am doing...
Since I want clients to have the opportunity to view all scanned pages, reorder them and delete them I have created an array of AxImaging objects and do TwainAcquireToGdPictureImage on each object. I want to save true type scanned color images (i.e. 24bpp) into PDF and be able to change JPEG compression.
What I do is practically this:
- Code: Select all
ar(0).TwainPdfStartEx("c:\lala.pdf")
For i = 0 to nCount-1
If iColor = TWPT_BW then
ar(i).ConvertTo1Bpp()
ar(i).PdfSetCompressionLevel(9)
ElseIf iColor = TWPT_GRAY
ar(i).ConvertTo8BppQ()
ar(i).PdfSetCompressionLevel(9)
Else iColor = TWPT_RGB
ar(i).ConvertTo24BppRGB()
ar(i).PdfSetJpegQuality(10)
End If
hScan = ar(i).GetNativeImage
ar(0).TwainAddGdPictureImageToPdf(hScan)
Next
ar(0).TwainPdfStop()
ar(0).CloseNativeImage()
PDF compression is evident, and color images have a slight compression, but no matter how I change PDF compression or JPEG quality in the code above nothing changes! What am I doing wrong?
Thank you in advance!
