locked
how to embed fonts whilst exporting doc to pdf in the code RRS feed

  • Question

  • Hello 

    I have a VB.net code which exports the document to the pdf on the fly and send to the printer to print, however I am having problems in printing as the printer guy said that the fonts not being embedded into PDF I am exporting.

    I have been advised to use a adobe distiller to do some settings before exporting to the PDF manually. However because I am doing this on the fly, I think I would have to incorporate distiller/word settings in the code.

    I hope this makes sense?

    Please can someone advise?

    Try MSdoc = New Microsoft.Office.Interop.Word.ApplicationClass() MSdoc.Visible = False MSdoc.Documents.Open(tempFile, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown)
     MSdoc.Application.Visible = False
     MSdoc.WindowState = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateMinimize
     Dim format As Object = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF
    Const wrdFormatDocument = 0
    MSdoc.ActiveDocument.SaveAs(dstFile, format, Unknown, Unknown, Unknown, Unknown, Unknown, True, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown)
    Catch ex As Exception Throw ex CommonFunctions.SendErrorEmail("Unable to export the template to the PDF. Filename :" & dstFile, ex.ToString) Finally
    Wednesday, October 14, 2009 12:13 PM

Answers