Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Solution for stdole32.tlb issue with excel and vista | Setting up and Configuration of Excel | |||
ExportAsFixedFormat printing issue | Excel Programming | |||
ExportAsFixedFormat? | Excel Programming | |||
Excel solution deployment issue | Excel Programming | |||
Solution for conditional formatting issue | Excel Programming |