- 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.
Code
IWPPdfCreator PDFCreator = WPDLLInt1.PDFCreator;
if (PDFCreator!=null)
{
WPDLLInt1.PDFCreator.PDFFile = "c:\\all_letters.pdf";
WPDLLInt1.PDFCreator.BeginDoc();
GotoFirstDataRow();
while (! AtEndOfData() )
{
WPDLLInt1.Memo.MergeText("");
WPDLLInt1.Memo.ReformatAll(false,false);
WPDLLInt1.PDFCreator.Print();
GotoNextDataRow();
}
WPDLLInt1.PDFCreator.EndDoc();
} else MessageBox.Show("PDF Creation not available");
Alles anzeigen
Regards,
Julian Ziersch