Welcome to RTF2PDF

[Top]  [Chapter]  [Next]

clip0163

Welcome to wRTF2PDF - a powerful library to load / create formatted text + export to different file formats such as HTM, RTF and PDF.

 

The DLL wPDFControl was created to make it easy for programmers to add PDF support to their application. It is based on the popular PDF engine 'wPDF' which has been successful on the Delphi and C++Builder market since the year 2000.

 

wPDFControl can be used in developing languages which can use DLLs, such as C and C++. It comes with an OCX wrapper which makes it easy to use it in VB. wPDFControl also comes with a wrapper class for .NET so you can access the PDF engine much much easier since .NET self explanatory properties, enums and flags have been extensively used.

 

The component wRTF2PDF is based on our word processing component TextDynamic plus the PDF engine wPDFControl. It does everything what wPDFControl and much of what TextDynamic does. It has been optimized to work on a server, or webserver. It does not print but it can produce PDF and other file formats fast and effectively. Please see our demo web server www.rtf-net.com.

 

We recommend to program with RTF2PDF similar to TextDynamic - but as an invisible, server control. Using the interface IWPEditor you have access to powerful and effective means to create text or tables in code.

 

While TextDynamic is a visual tool, RTF2PDF has been optimized to work in the background. It can be easily used with ASP or ASP.NET to create HTML or PDF response output. Since the API is so similar to the API of TextDynamic you can use almost the same code in your ASP page as you used for your desktop application. Due to its nature it does not offer any GUI elements and does not implement the wpa actions used by TextDynamic.

 

Instead of the interface IWPMemo which is implemented by TextDynamic; RTF2PDF implements the interface IWPEditor. It contains a subset of the IWPMemo methods and properties.

 

 

Product Page RTF2PDF

Product Page PDFControl

API Reference

Support forum

 

 

Example to create the text "Hello World" in ASP.NET (language C#):

 

RTF2PDF pdf = New RTF2PDF();

WPDynamic.IWPEditor Memo = pdf.Memo;

Memo.TextCursor.Clear();

Memo.CurrAttr.SetFontface("Verdana");

Memo.CurrAttr.SetFontSize(10);

Memo.TextCursor.InputString("Hello World\r ",0);

 

Only the first two lines would be different when using TextDynamic. There you probably use a control dropped on the form (the default name is wpdllint1) and the interface name IWPMemo instead of IWPEditor!

 

The export to PDF as ASP Result can be done like this. No temporary file will be written! (Requires "Internet Server" License)

 

// reformat the text when we have completely created it

Memo.ReformatAll(false,false); 

 

// Set PDF properties. Note that the interface IWPPDFCreator is being used

pdf.PdfCreator.PDFFile = "memory"// We want to use "ResultBuffer"

pdf.PdfCreator.FontMode = 0;  // i.e. embed all fonts

pdf.Print();

 

// remove any output

Response.Clear();

// Add new header

Response.ContentType = "application/pdf";

Response.AddHeader("Content-Type""application/pdf");

// Set a file name which is displayed when download starts

Response.AddHeader("Content-Disposition","inline;filename=PortableDocument.pdf");

// Write the PDF data

Response.Clear();

Response.BinaryWrite(pdf.ResultBuffer);

 

Legal Note:

Microsoft, VisualBasic, ActiveX, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. WPTools and TextDynamic are registered trademarks of Julian Ziersch.


[rtf_to_pdf_conversion.htm]    Copyright © 2007 by WPCubed GmbH