pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: TTF embedding issue
Date Tue, 19 Sep 2017 16:21:44 GMT
Hi,

The two methods in PDCIDFontType2Embedder are "isolated" and both work 
with a cidToGid map. You need to create that yourself, have a look at 
Type0Font.java in the PDFDebugger subproject. The lower part of the 
constructor calls readMap() which builds a table that has CID and GIDs 
so you should modify that to your need.

When done, you should check your file not just with PDFBox preflight but 
also with verapdf.

If you need more help, please share your file (upload to sharehoster) 
and the code you've written. I suspect you may have to add CID 0 manually.

Tilman


Am 19.09.2017 um 09:05 schrieb Jan Petzold:
> Hi Tilman,
>
> thanks for your quick reply.
>
> The goal is indeed to create PDF/A documents. It is just a single
> file. I was able to fix/bypass all other issues reported, the only
> remaining ones are those I mentioned.
>
> Regarding
>
>> this would require to create the two items (CIDToGIDMap and CIDSet) from the existing
font subset.
> Can you give me some idea on how to do that? I saw the code in
> PDCIDFontType2Embedder but not sure how to "apply" it to my existing
> PDF.
>
> Thanks a lot!
>
> On Tue, Sep 19, 2017 at 7:35 AM, Tilman Hausherr <THausherr@t-online.de> wrote:
>> What exactly is your assignment? Convert some files so that they are
>> PDF/A-1b? Because you wrote "I'm trying to convert" but not to what.
>>
>> Is it just that one file, or many?
>>
>> Making files PDF/A compatible isn't just fixing some fonts... there may be
>> many issues. Callas and PDF-Tools have software for that.
>>
>> Re the two issues you mention, this would require to create the two items
>> (CIDToGIDMap and CIDSet) from the existing font subset. Would be some hours
>> of work, but possible... maybe look at the file with PDFDebugger whether the
>> font shows something useful re GIDs. See also PDCIDFontType2Embedder for how
>> it is calculated...
>>
>> What you did likely didn't work because it was subsets.
>>
>> Tilman
>>
>>
>> Am 19.09.2017 um 07:21 schrieb Jan Petzold:
>>> Hi, I'm new to pdfbox. I'm trying to convert an existing PDF which
>>> uses an embedded OpenSans font
>>> (https://fonts.google.com/specimen/Open+Sans) and receive these errors
>>> from preflight:
>>>
>>> 3.1.9: Invalid Font definition, FZUADF+OpenSans: mandatory CIDToGIDMap
>>> missing
>>> 3.1.11: Invalid Font definition, FZUADF+OpenSans: The CIDSet entry is
>>> missing for the Composite Subset
>>>
>>> Everything else seems to be fine, but for these I don't really have a
>>> starting point. I can modify the source font (TTF file) if I have to,
>>> the question would be how to do that and what exactly.
>>>
>>> I also tried to just replace the embedded font with a new one
>>> (basically iterate through PDF pages, get the resources, replace fonts
>>> with my new ones) which "fixes" the error but results in a garbage
>>> document not displaying valid text.
>>>
>>> Any advice would be very welcome :)
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message