eDocEngine VCL
Create documents and reports in 18 formats
Compatibility
Delphi C++Builder

Export From DevExpress ExpressPrinting System To PDF And Other Formats

Using eDocEngine VCL
By V. Subhash

The ExpressPrinting System from DevExpress allows you to output the contents of several VCL controls to paper with a great degree of control over print attributes such as font, color, headers, and footers.

eDocEngine can leverage the capabilities of ExpressPrinting System to export the contents of VCL to formats such as PDF, RTF, EMF, BMP, JPEG, etc. For this purpose, eDocEngine provides the TgtXPressPrntInterface interface component.

To make it work on an application built with ExpressPrinting System, an instance of this interface component needs to be paired up with an eDocEngine document-creation engine component. For example, to export the print output of a string grid to a PDF document, a TgtXPressPrntInterface instance needs to be paired with a TgtPDFEngine instance on the same form as a TdxComponentPrinter. Let us see an example.

From ExpressPrinting System To PDF

  1. Open your IDE and create a VCL Forms Application project. This will create a form.
  2. Drop the following components on the form.
    1. Tbutton (2 Nos.)
    2. TStringGrid
    3. TdxComponentPrinter
    4. TgtPDFEngine
    5. TgtRTFEngine
    6. TgtXPressPrntInterface (2 Nos.)
  • Back on the form, double-click the buttons and add these click-event handlers.
    // Populate the grid
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      With StringGrid1 do begin
        Cells[1,1] := '1, 1';
        Cells[2,2] := '2, 2';
        Cells[3,3] := '3, 3';
      end;
    end;
    
    // Print the grid content using ExpressPrinting System
    // and export the print output to PDF and RTF using
    // eDocEngine
    procedure TForm1.Button2Click(Sender: TObject);
    var
      BasedxReportLink1: TBasedxReportLink;
    begin
      // Connect the export interface components with
      // engine components
      gtXPressPrntInterface1.Engine := gtPDFEngine1;
      gtXPressPrntInterface2.Engine := gtRTFEngine1;
    
      // Specify the file names for PDF and RTF output
      gtPDFEngine1.FileName := 'eDoc_DevExpress_Demo.pdf';
      gtRTFEngine1.FileName := 'eDoc_DevExpress_Demo.rtf';
    
      // Disable engine dialogs
      gtPDFEngine1.Preferences.ShowSetupDialog := false;
      gtRTFEngine1.Preferences.ShowSetupDialog := false;
    
      // Specify controls whose contents need to be printed
      BasedxReportLink1 := dxComponentPrinter1.AddLink(StringGrid1);
    
      // Export print output to PDF and RTF
      gtXPressPrntInterface1.RenderDocument(dxComponentPrinter1, BasedxReportLink1);
      gtXPressPrntInterface2.RenderDocument(dxComponentPrinter1, BasedxReportLink1);
    end;
    
  • Run the project to start the application.
  • Click the first button on the application to populate the string grid with our test data.
  • Click the second button to print the contents of the string grid and export the print output to PDF and RTF.
  • ---o0O0o---

    Our Developer Tools
    eDocEngine VCL

    A Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools.

    PDFtoolkit VCL

    A Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents.

    XtremePDFConverter VCL

    A Delphi/C++Builder component to intelligently convert PDF to user-friendly Word RTF documents.

    PDFOne .NET

    A .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications.

    XtremeDocumentStudio .NET

    Multi-format document-processing component suite for .NET developers

    PDFOne (for Java™)

    A Java™ PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java™ applications.

    XtremeFontEngine (for Java)

    Java font engine to render glyphs from Type 1, Type 2 (CFF), and TrueType fonts

    Our Office Productivity Applications
    Free PDF Reader

    A free, fast, and portable application for viewing, printing and converting PDF documents.

    Privacy | Legal | Feedback | Newsletter | Resellers © 2002-2013 Gnostice Information Technologies Private Limited. All rights reserved.

    This site is best viewed on a screen with minimum resolution of 1152 x 864 pixels. Windows XP users are advised to use Microsoft ClearType Tuning for optimal experience. Also, please use the latest version of a standards-compliant browser such as Firefox, Opera, or Dragon (Chromium).