PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 6:56 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Jul 19, 2017 1:18 pm 
Offline

Joined: Wed Jul 19, 2017 1:08 pm
Posts: 3
When embedding CID fonts into a PDF, a subset of the font is created using the font's index to location (loca) table. Therefore, the PdfCIDFont class will check whether the loca field is null in PrepareForSave(). We are using an OpenType Font that contains PostScript outlines. Since these never contain a loca table, but a CFF table instead, PDFSharp will not create a subset and always embed the entire font into the PDF. This will result in documents with a 27MB file size (the documents only contain two images with two lines of captions; they are only 200-300KB large when using a TrueType font). How can I use the CFF information to create a subset for PostScript fonts?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 19, 2017 1:37 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
hickhack wrote:
How can I use the CFF information to create a subset for PostScript fonts?
Not my area of expertise.
My guess is that support for OpenType fonts in PDFsharp is basic and/or indirect. Maybe you have to take the PDFsharp source code and implement support for OTF subsets.
Or convert the font to TTF. Or obtain a TTF version of that font if available.

I assume that you cannot simply use a similar TTF for sake of corporate identity.

See also:
http://www.pdfsharp.net/wiki/PostScript_fonts.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 19, 2017 1:58 pm 
Offline

Joined: Wed Jul 19, 2017 1:08 pm
Posts: 3
Actually, OpenType fonts that contain TrueType outlines work just fine. It's just the PostScript outlines that are fully embedded.
We are already working with the full source code, so extending it would be the option I am looking into. However, I don't know how to create the subset from the CFF table.

Quote:
Or convert the font to TTF. Or obtain a TTF version of that font if available.

We tried both of these options, even with TransType. So far without any luck.

Quote:
I assume that you cannot simply use a similar TTF for sake of corporate identity.

That is indeed the problem.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 19, 2017 2:47 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Have you tried to create a PDF with ANSI fonts (turn Unicode support in PDFsharp or MigraDoc off)?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 19, 2017 3:16 pm 
Offline

Joined: Wed Jul 19, 2017 1:08 pm
Posts: 3
Sorry for asking, but how do I turn off Unicode support?
We are creating the PDF from a WPF application using the MigraDoc Document class.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 118 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group