Session.ConvertRTFToPDF Method

This method converts an RTF document to a PDF document.

When converting an RTF document to PDF, HotDocs Server uses a built-in PDF converter, which analyzes the codes contained in the RTF file and translates them to PDF. This differs from the method used by other third-party PDF converters, which rely on an instance of Microsoft Word on the server from which the document is "printed" using a driver to create the PDF document. PDF documents created using a PDF driver can typically handle a greater number of formatting variations, while the PDF conversion method used by HotDocs Server works best for documents with simpler formatting. If you use HotDocs Server's built-in PDF conversion, some formatting differences will exist between the original RTF and the PDF.

You can also convert an RTF to PDF using the UtilityTools.ConvertRTFFile method, but this method takes fewer parameters. If you must specify custom PDF permissions, however, use the UtilityTools.ConvertRTFFile method instead.

Syntax

public void ConvertRTFToPDF ( string rtfPath, string pdfPath, int options )

Parameters Description
rtfPath The file name and path to the RTF document that will be converted.
pdfPath The file name and path to the PDF document that will be created.
options  A number that indicates which options to use during the conversion. Currently, the only valid option is 0.

Example

The following Visual C# code converts an RTF file to PDF.

public class ExampleCode
{
    static void Main()
    {
        HotDocs.Server.Session HDSSession = new HotDocs.Server.Session();
        HDSSession.ConvertRTFToPDF("c:\\temp\\original.rtf", "c:\\temp\\converted.pdf",0);
    }
}