Issue with ExportAsFixedFormat PDF (and solution)

T

Taylor

I am posting this because it was a vexing problem and I found no guidance online. Hoping this may show up in someone's google search and help them out.. (Not looking for someone to tell me how I'm going about it all wrong or that it's the answer to a question nobody asked.)

Scenario: I am trying to export a series of charts to PDF format (for lateruse in an InDesign document, which might be a clue as to why I was being so picky with the fonts).

This feels like a very particular situation, but I felt it was worth documenting because there are not a lot of powerful options for creating charts in Indesign - other than Excel (which many already have), there are only a few $$$ options. Charts are not an optional feature in quarterly reports, etc, but I was tired of fighting with MS Word to build an elegantly formattedreport.

Using the adobe tab in Excel 2010 to create a pdf works great. I double checked and confirmed by recording a macro that this process used the ExportAsFixedFormat method.

But when I automated this - e.g.:

chartObj.ExportAsFixedFormat xlTypePDF, fileBase & chartObj.Name & ".pdf", xlQualityStandard, True


I found that the fonts I was using (Myriad Pro Cond) were not being embedded and a generic sans font was being substituted. Very frustrating, as Indesign would throw up a warning every time a pdf was imported, saying the font"Myriad Pro Cond" was not available.

I spent a while messing with the .joboptions settings for the PDF creator, etc. to no effect.

Finally I was comparing the pdfs in Acrobat (one successfully-embedded-manually-created, the other missing-font-generic-substituted-vba-created, and noticed that the successful one, under Document Properties>Fonts said:

MyriadPro-Cond (Embedded Subset)

while the unsuccessful one said

Myriad Pro Cond (Actual Font: Adobe Sans MM)

So, yadda yadda yadda, I realized that ExportAsFixedFormat was relying on afont name attribute known as the postscript findfont name (theoretically "MyriadPro-Cond" but blank, in the case of this particular font) to locate the fonts for embedding.

When it fails to find this attribute, instead of looking for the "postscript name" ("MyriadPro-Cond") it defaults to looking the "family name" ("Myriad Pro Cond") and can't find it in the list of fonts, and fails to embed andsubstitutes "Adobe Sans MM.")

Adobe's .otf font did not have this property filled in. (Perhaps omitting this attribute is the norm for these modern OpenType fonts, what with all it's fancy subsets etc.)

I opened the font in Type Light 3.2 (an excellent freeware "lite" font editor), went to Font>Names>Advanced, copy/pasted the "postscript name"into the"ps findfont name" field, and suddenly Excel was embedding the fonts correctly and I could automatically export 100 charts (linked in an InDesign document) at the drop of a hat.
 
T

Taylor

I am posting this because it was a vexing problem and I found no guidanceonline. Hoping this may show up in someone's google search and help them out. (Not looking for someone to tell me how I'm going about it all wrong orthat it's the answer to a question nobody asked.)



Scenario: I am trying to export a series of charts to PDF format (for later use in an InDesign document, which might be a clue as to why I was beingso picky with the fonts).



This feels like a very particular situation, but I felt it was worth documenting because there are not a lot of powerful options for creating chartsin Indesign - other than Excel (which many already have), there are only afew $$$ options. Charts are not an optional feature in quarterly reports, etc, but I was tired of fighting with MS Word to build an elegantly formatted report.



Using the adobe tab in Excel 2010 to create a pdf works great. I double checked and confirmed by recording a macro that this process used the ExportAsFixedFormat method.



But when I automated this - e.g.:



chartObj.ExportAsFixedFormat xlTypePDF, fileBase & chartObj.Name & ".pdf", xlQualityStandard, True





I found that the fonts I was using (Myriad Pro Cond) were not being embedded and a generic sans font was being substituted. Very frustrating, as Indesign would throw up a warning every time a pdf was imported, saying the font "Myriad Pro Cond" was not available.



I spent a while messing with the .joboptions settings for the PDF creator, etc. to no effect.



Finally I was comparing the pdfs in Acrobat (one successfully-embedded-manually-created, the other missing-font-generic-substituted-vba-created, andnoticed that the successful one, under Document Properties>Fonts said:



MyriadPro-Cond (Embedded Subset)



while the unsuccessful one said



Myriad Pro Cond (Actual Font: Adobe Sans MM)



So, yadda yadda yadda, I realized that ExportAsFixedFormat was relying ona font name attribute known as the postscript findfont name (theoretically"MyriadPro-Cond" but blank, in the case of this particular font) to locatethe fonts for embedding.



When it fails to find this attribute, instead of looking for the "postscript name" ("MyriadPro-Cond") it defaults to looking the "family name" ("Myriad Pro Cond") and can't find it in the list of fonts, and fails to embed and substitutes "Adobe Sans MM.")



Adobe's .otf font did not have this property filled in. (Perhaps omittingthis attribute is the norm for these modern OpenType fonts, what with all it's fancy subsets etc.)



I opened the font in Type Light 3.2 (an excellent freeware "lite" font editor), went to Font>Names>Advanced, copy/pasted the "postscript name"into the "ps findfont name" field, and suddenly Excel was embedding the fonts correctly and I could automatically export 100 charts (linked in an InDesign document) at the drop of a hat.

Okay, so, embarassingly, I'm not sure I found the solution. In fishing around for a solution, I think I replaced the OpenType Myriad Pro with a TrueType Version (converted in TypeLight). It fit right into the family and everything. That's my only guess, since I tried my own solution and couldn't getit to work.

So maybe the issue is embedding OpenType fonts with ExportAsFixedFormat?

Gah. I felt so smart.
 
T

Taylor

Yep.

http://support.microsoft.com/kb/908475

Okay, so, embarassingly, I'm not sure I found the solution. In fishing around for a solution, I think I replaced the OpenType Myriad Pro with a TrueType Version (converted in TypeLight). It fit right into the family and everything. That's my only guess, since I tried my own solution and couldn't get it to work.



So maybe the issue is embedding OpenType fonts with ExportAsFixedFormat?



Gah. I felt so smart.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top