Exporting TRichView (.RVF) Files to PDF Using eDocEngine VCL
Learn to create a PDF version of your TRichView files in just five lines of code.
By Ashwini
In this tip, we will see how to convert RichView documents to PDF using eDocEngine VCL. Here are the steps:
- Drop TRichViewEdit, TRVPrint, and TRVStyle components from RichView palette on a Delphi form application.
- Connect RichViewEdit1.Style property to RVStyle1.
- From eDocEngine Additionals tab, add TgtRichViewInterface interface to the form.
- From eDocEngine tab, add TgtPDFEngine component to the form.
- To connect Gnostice RichView Interface to the eDocEngine component:
- On the form, select gtRichViewInterface1.
- In the Properties window, select the Engine property and click the drop-down icon to select the PDF engine gtPDFEngine1.
- In the code window, add the following code:
procedure TForm1.Button1Click(Sender: TObject);
begin
// Load the input .RVF file into the
// TRichViewEdit component
RichViewEdit1.InsertRVFFromFileEd('C:\Input.rvf');
// Assign the TRichViewEdit component as the
// source for the TRVPrint object.
RVPrint1.AssignSource(RichViewEdit1);
// Apply formatting for all pages
RVPrint1.FormatPages(rvdoALL);
// Specify output PDF filename
gtPDFEngine1.FileName := 'Output.pdf';
// Export the RVF file to PDF
gtRichViewInterface1.RenderDocument(RVPrint1, False);
end;
---o0O0o---
Downloads:
This site is best viewed on a screen with minimum resolution of 1152 x 864 pixels.
Windows users are advised to use Microsoft ClearType Tuning for optimal experience.
Linux and other users can enable font smoothing, as supported by their OS.
Also, please use the latest version of a standards-compliant browser such as Opera, FireFox, Chrome or Safari.