RTF strings or files
Convert an RTF string, for example a document built at run time, or an RTF file from the disk.
The RTF to PDF Converter library for .NET can be linked into any .NET application, ASP.NET websites or Windows Forms applications, to add RTF to PDF conversion to your application. Convert RTF strings and RTF files to PDF documents with selectable texts and images, from C# or VB.NET.
Get the PDF document as an array of bytes or as a PDF file. No additional installation is necessary: it is a .NET assembly that you reference in your application, with royalty free development libraries and samples.
The features grouped by how the RTF goes in and how the PDF document comes out: the conversion, the page setup and the output.
RTF strings and RTF files, converted to PDF documents with selectable texts and images.
Convert an RTF string, for example a document built at run time, or an RTF file from the disk.
The PDF documents have selectable texts and images. PNG, JPEG, EMF and WMF pictures in the RTF are rendered.
The RTF content is resized if necessary to fit the available width of the PDF page, and optionally the available height.
Embed the true type fonts in the PDF document.
Page size, orientation and margins, header and footer. Bytes, file or stream.
Choose a standard page size, such as A4, Letter or Legal, in portrait or landscape orientation.
Set the left, right, top and bottom margins of the PDF document.
Add a header with a title and a subtitle, and a footer with a text and page numbers.
Append existing PDF documents, from files or streams, to the converted document.
Get the PDF document as an array of bytes, save it to a file, or write it to a stream.
Set the title, author, subject, keywords and creation date with PdfDocumentInfo.
Protect the PDF with user and owner passwords and set its permissions, with RC4 40 or 128 bit encryption, through PdfSecurityOptions.
Produce PDF/A-1b documents for long-term archiving, with embedded fonts, by setting PdfStandardSubset.
Create a PdfConverter, set the PDF options, then call one conversion method. The tabs convert a file to a file, a string to bytes with a header and a footer, and a file to the HTTP response of an ASP.NET page.
using ExpertPdf.RtfToPdf; var pdfConverter = new PdfConverter(); pdfConverter.LicenseKey = "your license key"; // Page size, orientation and margins of the PDF document pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4; pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait; pdfConverter.PdfDocumentOptions.LeftMargin = 36; pdfConverter.PdfDocumentOptions.RightMargin = 36; pdfConverter.PdfDocumentOptions.TopMargin = 36; pdfConverter.PdfDocumentOptions.BottomMargin = 36; // Convert an RTF file to a PDF file pdfConverter.SavePdfFromRtfFileToFile("report.rtf", "report.pdf");
Install with Install-Package ExpertPdf.RtfToPdf, or reference eprtftopdf.dll from the download. C# and VB.NET samples for ASP.NET and Windows Forms are in the download, and the API reference describes every class and method.
Common questions about input, output, page setup and requirements.
GetPdfBytesFromRtfFile, GetPdfBytesFromRtfString), as a PDF file (SavePdfFromRtfFileToFile, SavePdfFromRtfStringToFile) or written to a stream (SavePdfFromRtfFileToStream, SavePdfFromRtfStringToStream).PdfDocumentOptions has the PdfPageSize, PdfPageOrientation, LeftMargin, RightMargin, TopMargin and BottomMargin properties, and the compression level of the PDF document.ShowHeader and ShowFooter, then set the header title and subtitle with PdfHeaderOptions, and the footer text and page numbers with PdfFooterOptions.PdfSecurityOptions sets the user and owner passwords and the permissions (RC4, 40 or 128 bit keys), PdfDocumentInfo the title, author, subject and keywords, and PdfStandardSubset produces PDF/A-1b. A PDF/A document cannot be encrypted, so the two cannot be combined.ExpertPdf.RtfToPdf. Samples and documentation are in the downloaded archive.Download the free trial with C# and VB.NET samples for ASP.NET and Windows Forms. When you are ready, license the RTF to PDF Converter on the pricing page.