You are not logged in.
Pages: 1
Hello,
I use TPdfImage to add HighResolution bitmaps to the (Pdf)Canvas (Not the VCL one).
Dow not matter which value I set for the ForceJPEGCompression (Tested values 0, 30, 60 and 90 (At least)). File will have exact same size, no matter of the value of the property.
I even made 850mb .pdf file, and compressed it with 7-zip and it compressed into about 8.5MB, so it definitely have some room for compression.
Same results with an .CompressionMethod := cmFlateDecode;
Don't know will this lib support compressing images with (de)Flate/Zip/Zlib (What ever called )
Any ideas, is this an bug in library, or in my code??? What could cause this.
This is not an issue for me now, but maybe later it is... (so no panic, for me, just wondering )
And BTW. Could do some good to have comment like this in the code
0 = Disabled
1 = Low compression (Large files, good quality)
100 = High compression (Small files, poor quality)
(Or other way round, can't remember which way it was
-TP-
Offline
SynPdf supports:
1) deflate compression (zlib);
2) JPEG compression
I suspect you've some problems of parameters / methods calls.
Check that:
1) TPdfDocument.CompressionMethod equals cmFlateDecode (this is the default set in TPdfDocument.Create, but you may have changed this);
2) you add TJpegImage pictures in order to enable Jpeg compression.
The ForceJPEGCompression parameter is available only if you call TPdfImage.Create with TJpegImage kind of TGraphic (not TBitmap).
See TPdfImage.Create code.
Online
Another possibility is to use TPdfDocumentGDI, and its VCLCanvas property to draw your bitmaps.
In this case, if the ForceJPEGCompression is not set to 0, it will create automatically creates the bitmap as JPEG.
Online
OK,
I need to add something else than Jpeg image, but I could change it into it. (I just Assign TBitmap into it)
I just tough it would compress all images as Jpeg if property set Because it says it'll Force it
Thanks for your support!!!
I'll look into it...
-TP-
Offline
Pages: 1