RTF2PDF Version 2 API |
[Top] [Chapter] [Previous] [Next] |
The RTF2PDF component inherits all properties and methods of PDFControl.
It adds methods to load, manage and export RTF files to PDF.
To convert a RTF file you first load it and then export it.
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"); }
//Loads a RTF file public void LoadRTF(String FileName)
//Loads RTF from a string public void LoadRTFString(String RTFFormat)
//Appends RTF from a string public void AppendRTFString(String RTFFormat)
//Saves the RTF file public void SaveRTF(String FileName)
//Appends RTF file to the data stored in the RTF Engine public void AppendRTF(String FileName)
//Converts <fieldnames> in the loaded RTF data into the special fields //(insertpoints) which can be used for mailmerge. public void MergePrepare()
//Starts the mailmerge process. Please note that you can execute this, // write a PDF file and execute it again without having to reload the RTF data! //The data is retrieved using the OnGetText event procedure. public void MergeExec()
//writes the RTF data to an intern data storage. To restore it use the procedure MergeRestore. public void MergeBackup()
//Restores text saved with MergeBackup() public void MergeRestore()
//Define how many pages should be printed on one PDF page side by side. //The standard is 1 to print one RTF page on one PDF page. // "2" would print 2 RTF pages on one PDF pages and also double the width of the PDF page. public void SetColumns(int Value)
// Start the RTF to PDF conversion. During the conversion process the // callbacks are executed to let you fill in graphics if you need to. // This makes it possible to create a watermark on each page. // It uses the 'Filename' property as output name public void Export()
// Start the RTF to PDF conversion. During the conversion process the // callbacks are executed to let you fill in graphics if you need to. // This makes it possible to create a watermark on each page. public void Export(String OutputFileName)
//Sets the zoom value for the RTF to PDF conversion. // It can be used to shrink or enlarge the text. // To print 2 A4 pages on one A3 page use columns=2, Rotation=90, zoom=100. // To print 2 A4 pages on one A4 page use zoom=50! public void SetZoom(int Value)
//Changes the rotation of the PDF page. To print landscape use the value 90. public void SetRotation(int Value)
|