On 13.04.2016 18:06, Michael Van Canneyt wrote:


On Wed, 13 Apr 2016, Ondrej Pokorny wrote:

On 13.04.2016 17:52, Michael Van Canneyt wrote:

I prefer more options, it gives more fine-grained control.

We can make a
  CompressAll = [poCompressText, poCompressFonts, poCompressImages];
constant if you want, which will be kept up-to-date with all compression
options.

No, not needed. As I said, it's not that important.

Still could you please use poUseRawJPEG by default in TPDFDocument.Create? IMO poUseRawJPEG is very useful - it reduces both processing time because JPEG images don't have to be resampled by fpPDF and also keeps the exported PDF small.

I prefer not to, because of several reasons:
- it depends on 3.1 features.

No. In 3.1 the size detection is just faster/better.

- It forces the examination of all added images.
  Examining is a waste of time for me, since I do not use JPEG, only PNG.

No. The only check it does more is "Handler.InheritsFrom(TFPReaderJPEG)". I don't think it is that time-consuming. If you disable poUseRawJPEG and you feed fpPDF with a JPEG image, it actually wastes time and resources to resample/resave(/+recompress if poCompressImages is enabled) the image.


In each case, for an advanced user as you, I would expect that the first
thing you do is create a TOndrejPDFDocument subclass (or whatever the name). You can set all options there to defaults that you like. (I subclass all components I use for exactly such reasons)

Of course enabling it for myself isn't a problem. The problem is that I don't see any advantage disabling poUseRawJPEG and enabling poCompressImages by default - there is no :)

Ondrej

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to