[Lazarus] fpPDF: cannot embed DejaVu font

Michael Van Canneyt michael at freepascal.org
Wed Apr 13 20:26:13 CEST 2016



On Wed, 13 Apr 2016, Ondrej Pokorny wrote:

> 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.

Yes. 
So in 3.0 there is no time gain. You read the image anyway.
The detection works by reading the whole image, because it needs the size.

>
>> - 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 know you will have JPEG, you can use the JPEG function.

>
>> 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 :)

Sure. When 3.0.4 is out, then we can switch the default.

Michael.




More information about the Lazarus mailing list