Problem with Font Embedding with ExportAsFixedFormat

Discussion in 'Word VBA' started by Laura Villa, Apr 20, 2009.

  1. Laura Villa

    Laura Villa Guest

    Hi,

    I'm using word automation to create server-side PDF docs from .docx files.
    The word document uses a non-default font (TW Cen). The .pdf document created
    has a problem with font embedding: the TW Cen font is replaced with a
    similar, but different, font and the layout of the document is quite
    different.
    It happens even if I specify paramBitmapMissingFonts parameter = true.

    If I try to export the same file using the appropriate "Save as PDF" option
    in Word 2007 (on the same machine), it works.

    The code I use is the following:
    -------------------------------------------------------------------------
    Word.WdExportFormat paramExportFormat = Word.WdExportFormat.wdExportFormatPDF;
    bool paramOpenAfterExport = false;
    Word.WdExportOptimizeFor paramExportOptimizeFor =
    Word.WdExportOptimizeFor.wdExportOptimizeForOnScreen;
    Word.WdExportRange paramExportRange = Word.WdExportRange.wdExportAllDocument;
    int paramStartPage = 0;
    int paramEndPage = 0;
    Word.WdExportItem paramExportItem =
    Word.WdExportItem.wdExportDocumentWithMarkup;
    bool paramIncludeDocProps = true;
    bool paramKeepIRM = true;
    Word.WdExportCreateBookmarks paramCreateBookmarks =
    Word.WdExportCreateBookmarks.wdExportCreateWordBookmarks;
    bool paramDocStructureTags = true;
    bool paramBitmapMissingFonts = true;
    bool paramUseISO19005_1 = true;

    oWordDoc.ExportAsFixedFormat(fileName,
    paramExportFormat, paramOpenAfterExport,
    paramExportOptimizeFor, paramExportRange, paramStartPage,
    paramEndPage, paramExportItem, paramIncludeDocProps,
    paramKeepIRM, paramCreateBookmarks, paramDocStructureTags,
    paramBitmapMissingFonts, paramUseISO19005_1,
    ref missing);
    -------------------------------------------------------------------------
    Any idea?

    Thanks a lot,
    Laura
     
    Laura Villa, Apr 20, 2009
    #1
    1. Advertisements

  2. Laura Villa

    Taylor Guest

    Not actually convinced this works anymore, but anyone with similar problems could at least try this one:

    https://groups.google.com/forum/#!topic/microsoft.public.excel.programming/ugXcs7rxSiU

    On Monday, April 20, 2009 9:26:09 AM UTC-6, Laura Villa wrote:
    > Hi,
    >
    > I'm using word automation to create server-side PDF docs from .docx files.
    > The word document uses a non-default font (TW Cen). The .pdf document created
    > has a problem with font embedding: the TW Cen font is replaced with a
    > similar, but different, font and the layout of the document is quite
    > different.
    > It happens even if I specify paramBitmapMissingFonts parameter = true.
    >
    > If I try to export the same file using the appropriate "Save as PDF" option
    > in Word 2007 (on the same machine), it works.
    >
    > The code I use is the following:
    > -------------------------------------------------------------------------
    > Word.WdExportFormat paramExportFormat = Word.WdExportFormat.wdExportFormatPDF;
    > bool paramOpenAfterExport = false;
    > Word.WdExportOptimizeFor paramExportOptimizeFor =
    > Word.WdExportOptimizeFor.wdExportOptimizeForOnScreen;
    > Word.WdExportRange paramExportRange = Word.WdExportRange.wdExportAllDocument;
    > int paramStartPage = 0;
    > int paramEndPage = 0;
    > Word.WdExportItem paramExportItem =
    > Word.WdExportItem.wdExportDocumentWithMarkup;
    > bool paramIncludeDocProps = true;
    > bool paramKeepIRM = true;
    > Word.WdExportCreateBookmarks paramCreateBookmarks =
    > Word.WdExportCreateBookmarks.wdExportCreateWordBookmarks;
    > bool paramDocStructureTags = true;
    > bool paramBitmapMissingFonts = true;
    > bool paramUseISO19005_1 = true;
    >
    > oWordDoc.ExportAsFixedFormat(fileName,
    > paramExportFormat, paramOpenAfterExport,
    > paramExportOptimizeFor, paramExportRange, paramStartPage,
    > paramEndPage, paramExportItem, paramIncludeDocProps,
    > paramKeepIRM, paramCreateBookmarks, paramDocStructureTags,
    > paramBitmapMissingFonts, paramUseISO19005_1,
    > ref missing);
    > -------------------------------------------------------------------------
    > Any idea?
    >
    > Thanks a lot,
    > Laura
     
    Taylor, Dec 3, 2013
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam
    Replies:
    0
    Views:
    85
  2. Paolo Martinelli

    Problems embedding objects

    Paolo Martinelli, Oct 17, 2003, in forum: Word VBA
    Replies:
    0
    Views:
    109
    Paolo Martinelli
    Oct 17, 2003
  3. Uri Kahn
    Replies:
    1
    Views:
    124
    Cindy M -WordMVP-
    Nov 17, 2003
  4. Robin Tucker

    Embedding OLE Links in a word document?

    Robin Tucker, Sep 29, 2004, in forum: Word VBA
    Replies:
    1
    Views:
    114
    Robin Tucker
    Sep 29, 2004
  5. revstead
    Replies:
    2
    Views:
    501
    revstead
    Oct 30, 2006
  6. Marty
    Replies:
    3
    Views:
    202
    Anand.V.V.N
    Nov 15, 2006
  7. Vagabond
    Replies:
    1
    Views:
    332
    Doug Robbins - Word MVP
    Dec 15, 2009
  8. Vagabond
    Replies:
    4
    Views:
    188
    Vagabond
    Dec 24, 2009
Loading...