LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Issue with ExportAsFixedFormat PDF (and solution)

Yep.

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

On Tuesday, December 3, 2013 10:55:14 AM UTC-7, Taylor wrote:
On Saturday, November 23, 2013 10:31:21 AM UTC-7, Taylor wrote:

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 later use 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 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, and noticed that the successful one, under Document PropertiesFonts 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 a font 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 and substitutes "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 FontNamesAdvanced, 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 get it to work.



So maybe the issue is embedding OpenType fonts with ExportAsFixedFormat?



Gah. I felt so smart.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solution for stdole32.tlb issue with excel and vista sunny Setting up and Configuration of Excel 1 March 5th 09 07:56 PM
ExportAsFixedFormat printing issue Ramon Busboom Excel Programming 0 April 14th 08 05:13 AM
ExportAsFixedFormat? Robby Excel Programming 3 February 27th 08 09:23 AM
Excel solution deployment issue Lac Excel Programming 1 September 5th 06 02:49 PM
Solution for conditional formatting issue Fleone Excel Programming 2 March 10th 05 11:29 PM


All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"