Example |
[Top] [Chapter] [Previous] [Next] |
Code to convert a RTF file to PDF
Example VB.NET
If PDF.StartEngine(DLLNAME.Text, "", "", 0) Then ' you your license info here ! If PDF.BeginDoc(PDFNAME.Text, 0) > 0 Then ' Start a PDF document PDF.ExecIntCommand(1000, 0) ' Initialize the RTF engine PDF.ExecStrCommand(1002, RTFNAME.Text) ' Load a RTF file PDF.ExecIntCommand(1100, 0) ' Export this RTF file to PDF PDF.EndDoc() ' Close the PDF document End If End If
Example C#
System.Windows.Forms.OpenFileDialog OpenDia = new System.Windows.Forms.OpenFileDialog(); OpenDia.Filter = "RTF Files|*.RTF"; if(OpenDia.ShowDialog()==System.Windows.Forms.DialogResult.OK) { rtF2PDF1.LoadRTF(OpenDia.FileName); rtF2PDF1.Export("C:\\Test.PDF"); } |