Overview
I am generating a four page PDF document in an iPad application that uses a custom font, Trade Gothic. It is embedding correctly into the application, and looks great.
However, part of the app is to email the PDF as a leave behind. This sent file displays all font as a default sans type and on a few systems, I received the error Cannot find or create the font 'RVYPRT+TradeGothicLTStd-Light'. Some characters may not display or print correctly.
I am generating the PDF using the UIKit Framework. Here is a tutorial that uses the same process: http://www.ioslearner.com/generate-pdf-programmatically-iphoneipad/
My Question
How do I embed the font into the PDF output so that it is rendered correctly as the custom font rather than default type after it is sent.
Thanks in advance!
Update 1: Similar unanswered questions I have found
IOS embed font in PDF
iOS Quartz embed font in pdf
Update 2: More Information on fonts
The font, http://store1.adobe.com/cfusion/store/html/index.cfm?store=OLS-US&event=displayFont&code=TRDQ10003000, is an OpenType Font and does allow embedding by the license.
Also, the default font used is standard.
If certain fonts are missing from the PDF file, Adobe Acrobat and Adobe Reader will automatically try to emulate the missing font by using one of the Multiple Master fonts that are built into these programs. This way, the document will not be represented exactly as the designer wanted it to, but at least the text won’t reflow. The Multiple Master fonts that are used for this are: Adobe Serif MM and Adobe Sans MM
source: http://www.prepressure.com/pdf/basics/fonts
Update 3: Fonts are referenced in the PDF, but not embedded
It appears that the app is attempting to embed the fonts but they are not being embedded correctly. Here is a screenshot of the embedded fonts under File -> Document Properties:
The first problem that I see is that the font is being listed as Type 1, when it is actually an OpenType font. And as expected, the "Actual Font" is Sans MM (the font used when an embedded font is not found.)
Update 4: In another PDF (generated using Adobe, not iPad application) the fonts that are needed are embedded as subsets. I am not sure, but this leads me to believe that it should be possible to do the same thing programmatically.
Once you have opened the correct PDF in Acrobat, go to File > Document Properties. 3. Select the tab at the top that says Fonts and then look for the fonts that have (Embedded Subset) at the end of their name. These are the fonts that are already embedded.
Then open up the PDF in question in Adobe Acrobat and ensure you are logged in to your account. 2. Once you have opened the correct PDF in Acrobat, go to File > Document Properties. 3. Select the tab at the top that says Fonts and then look for the fonts that have (Embedded Subset) at the end of their name.
For example, your version of a font, not your print provider’s version, can always be used by the provider for both viewing and printing the PDF file.
The font you are using and which is 'looking great', TradeGothic, does not allow embedding into PDF (or other) documents, according to its license.
(Why a font designer would want to do that is beyond my little brain. After all they sold a license to use it for documents, no? -- And why [as I've experienced first-hand recently] a big corporation would design their Corporate Identity around one such font, but then being 'too cheap' and buying only font licenses which don't allow embedding, hence forcing their employees to send out crappy PDFs to their customers adds only more madness to this story...)
As can be seen from your second update, you have discovered that fact already.
What you seem to misunderstand is the 'Document Properties' screenshot:
Those PDF-receiving systems which give that warning about "Can not find or create the font 'RVYPRT+TradeGothicLTStd-Light'. Some characters may not display or print correctly" are not at fault. They simply...
My simple advice, repeated hundreds of times in front of my customers over the years:
Update:
Basically, the "embedding flag" can express be four (important) different levels of restrictions. (In practical terms, this flag applies to TrueType and OpenTypes only, not to the more old-fashioned PostScript Type1 fonts. Technically speaking: the name of this flag is fsType, it is a bitmask, and it is contained in the OS/2 table of TrueType and OpenType fonts....)
These levels specify where and when and for which purpose the type foundry allows embedding of the font in documents (not only PDF but also Word, OpenOffice or any other document type:
There are two more (less important) restrictions that the 'embedding' flag of a font may indicate:
Adobe software in many cases, when there is no fsType flag at all contained in the font itself, will treat this font as one that allows Print + Preview-only embedding.
Details about this topic may be learned from an Adobe Whitepaper about 'Font Embedding Guidelines for Third-party Developers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With