[pdftex] Merging duplicate embedded fonts

Peter Rolf peter.rolf at arcor.de
Thu Oct 10 14:12:03 CEST 2013


Am 10.10.2013 10:29, schrieb Maarten Bezemer:
> On Wednesday 09 October 2013 22:26:28 Ross Moore wrote:
>> On 09/10/2013, at 6:58 AM, Ross Moore wrote:
>>> Presumably you want a size-reduction in your final PDF. This can only come
>>> as a compromise in the functionality according to the browser used by
>>> your audience, and/or at the expense of extra processing when the full
>>> document is created.
>>>
>>> Ghostscript has been suggested already.
>>> Or try using Acrobat Pro to save a "reduced size" PDF, as an extra step
>>> after pdfTeX. Whether this latter will work may depend upon the
>>> characteristics of the font; in particular whether it is known already to
>>> the software installation, and it's licensing conditions.> 
>>>> The resulting PDF  file is set online [1],
>>>
>>> I'll give APro a try and get back to you with the results.
>>
>> When you resave your example file using Acrobat Pro, the two font
>> instances are indeed combined and also subsetted.
>> Other Metadata is also added, with the perhaps surprising result
>> in an overall *gain* in size: 16kb has become 34kb.
>>
>> Due to the different way compression is handled within the two files,
>> it is hard to identify just where all the size-difference lies.
>>
>> The attached image shows a schematic view of the internal structures
>> (without MetaData) of both the original and APro-produced file.
> 
> Thanks for trying in Acrobat Pro.
> 
> When I look at your screenshot, I do not see that the font instances are 
> combined. Both sides show the same amount of fonts. It is nicely shown that 
> each instance is part of an embedded PDF file (XObject) though.

Both instances refer to the same object (28 0 R), so the fonts are merged.
The size increase if probably document overhead (XMP,...), inserted by
Acrobat. Nothing to worry about, as the optimization will save a lot
more bytes for bigger documents.

BTW: you get a better overview by using the [Audit space usage...]
button in the 'PDF Optimizer' dialogue of Acrobat (here Acrobat Pro 9;
menu 'Advanced->PDF Optimizer'; button is located at the top,right). It
shows how much bytes of the document are used for the fonts.


> I assumed the PDF images would have been 'better' merged, I now see why it is 
> more complex to merge the duplicate fonts, as they are not really duplicate, 
> but part of the embedded PDF files...
> 
> Too bad, I hoped to solve this 'problem', but I see now that this is fairly 
> complex. I could see whether I can embed the images as LaTeX files, so they are 
> properly merged, but I am afraid I do not have enough time to do so before my 
> deadline.
>
> Thanks for your help and provided details!
> Regards,
>   Maarten
> 
Hope that helps,

Peter


More information about the pdftex mailing list