eDocEngine VCL
Create documents and reports in 18 formats
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);
      With StringGrid1 do begin
        Cells[1,1] := '1, 1';
        Cells[2,2] := '2, 2';
        Cells[3,3] := '3, 3';
    // Print the grid content using ExpressPrinting System
    // and export the print output to PDF and RTF using
    // eDocEngine
    procedure TForm1.Button2Click(Sender: TObject);
      BasedxReportLink1: TBasedxReportLink;
      // 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);
  • 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 .NET Developer Tools
    Gnostice Document Studio .NET

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

    PDFOne .NET

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

    Our Delphi/C++Builder developer tools
    Gnostice Document Studio Delphi

    Multi-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms.

    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.

    Our Java developer tools
    XtremeDocumentStudio (for Java)

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

    PDFOne (for Java)

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

    Our Platform-Agnostic Cloud and On-Premises APIs

    Cloud-hosted and On-Premises REST-based document-processing and document-viewing APIs

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