FAQ: How can I export to PDF

    • Offizieller Beitrag

    Q: How can I export a PDF file

    A: You need to use the interface IWPPdfCreator. The interface is provided by the demo version and if you have the full version with integrated PDF support.

    Code
    IWPPdfCreator PDFCreator = WPDLLInt1.PDFCreator;if (PDFCreator!=null){    PDFCreator.PDFFile = "MyDocument.pdf";    PDFCreator.Print();} else MessageBox.Show("PDF Creation not available");

    It is also possible to create a PDF from multiple documents. Then you have to use BeginDoc/EndDoc. In this C# example we use MergeText to replace replace the contents of the datafields.

    Regards,

    Julian Ziersch

  • I am using the trial version of the TextDynamic control in a Visual FoxPro 9 form and am trying to export the contents of the editor to a PDF file. This is the code I am running

    oPDF = GETINTERFACE(Thisform.oleControl1.PDFCreator, "{C6B1B485-6EB5-4360-9C19-7BCBA4E43529}", "WPTDynInt.ocx")
    If Not IsNull(oPDF)
    oPDF.PDFFile = "C:\O32\2014P3\Opera32\DEMODATA\GRE0001_DebtorLetter1.pdf"
    oPDF.Print()
    oPDF = NULL
    EndIf

    The code runs without error but the PDF file is not being created. I really need this to work before I can make the decision to purchase the product or not.