With the RTF to PDF Converter library for .NET you can easily convert RTF strings and RTF files to PDF documents. You can convert the RTF document to a PDF document
in a memory buffer or to a PDF file. The integration is extremely easy and no other third party tools are necessary to be installed.
The library is distributed as a simple .NET assembly that you reference in your applications. Samples and documentation are available in the downloadable software package.
- Easy integration, no installation or setup is necessary on the server
- Delivered as a single strong named .NET assembly (can be installed in GAC)
- Can be deployed on the server by simple copy (xcopy deployment support)
- Can be used from ASP.NET, Windows Forms, WPF, Web Service or Console applications
- The same assembly can be used both on 32-bit and 64-bit Windows servers
- Convert RTF strings to PDF documents
- Convert RTF files to PDF documents
Code Sample
1: protected void btnConvert_Click(object sender, EventArgs e)
2: {
3: PdfConverter pdfConverter = new PdfConverter();
4:
5: pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
6: pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
7: pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
8:
9:
10:
11: pdfConverter.PdfDocumentOptions.ShowFooter = false;
12: pdfConverter.PdfDocumentOptions.ShowHeader = false;
13:
14: pdfConverter.LicenseKey = "MyLicenseKeyString";
15:
16: byte[] downloadBytes = pdfConverter.GetPdfBytesFromRtfString(MyRTFString);
17:
18: System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
19: response.Clear();
20: response.AddHeader("Content-Type", "binary/octet-stream");
21: response.AddHeader(
"Content-Disposition",
22: "attachment; filename=" + "Rendered.pdf" + "; size="
+ downloadBytes.Length.ToString());
23: response.Flush();
24: response.BinaryWrite(downloadBytes);
25: response.Flush();
26: response.End();
27: }