Skip to content

EF.FOP ​

Support for generating documents by FOP (Formatting Objects Processor)

<seealso href="http://xmlgraphics.apache.org/fop/"> Apache FOP Project </seealso>

EFopEngineError class ​

Exception raised by the FOP report engine on configuration or document-generation errors.

TEFFopReport class ​

Non-visual component that drives the Apache FOP engine to generate PDF (or PCL/PS/TXT/RTF) documents from an XSL-FO file, or from an XML data file plus an XSL stylesheet, and optionally previews or prints them.

pascal
function GetOutpustring: string;

Returns the output file name to be generated: the explicit OutputFile if set, otherwise the XSL-FO (or XML) file name with the output extension.

pascal
function GetOutputFileExt: string;

Returns the output file extension matching the current FOPOutputType (e.g. '.pdf', '.rtf').

pascal
procedure Print;

Generate file by FOP engine and call OnPrintDocument event.

pascal
procedure Preview;

Generate file by FOP engine and call OnShowDocument event to open it.

pascal
procedure Build;

Generate file by FOP engine.

pascal
constructor Create(AOwner : TComponent);

Creates the component, defaulting FOPBatch to FOP.BAT and the output type to PDF.

pascal
property FOPBatch : string read FFOPBatch write FFOPBatch;

Name of the FOP batch/command file used to launch the engine (default 'FOP.BAT').

pascal
property DebugMode : boolean read FDebugMode write FDebugMode default False;

When True, runs the FOP engine with the -d (debug) option.

pascal
property FOPPath : string read FFopPath write SetFopPath;

Folder that contains the FOP engine batch file. When a file name is assigned at design time, its path is extracted.

pascal
property XMLDataFile : string read FXMLDataFile write SetXMLDataFile;

XML data file to transform (used together with XSLReportFile). Setting it clears XSL_FOFile.

pascal
property XSLReportFile : string read FXSLReportFile write SetXSLReportFile;

XSL stylesheet used to transform XMLDataFile into XSL-FO. Setting it clears XSL_FOFile.

pascal
property XSL_FOFile : string read FXSL_FOFile write SetXSL_FOFile;

Ready-made XSL-FO file to render directly. Setting it clears XMLDataFile and XSLReportFile.

pascal
property OutputFile : string read FOutputFile write SetOutputFile;

Explicit output file name; its extension also determines FOPOutputType. If empty, the name is derived from the input file.

pascal
property BeforeGenerateXML : TNotifyEvent read FBeforeGenerateXML write FBeforeGenerateXML;

Fired before XML generation begins.

pascal
property OnGenerateXML : TNotifyEvent read FOnGenerateXML write FOnGenerateXML;

Fired to let the application generate the XML data file to be transformed.

pascal
property BeforePrint : TNotifyEvent read FBeforePrint write FBeforePrint;

Fired before the document is printed.

pascal
property AfterPrint : TNotifyEvent read FAfterPrint write FAfterPrint;

Fired after the document has been printed.

pascal
property BeforePreview : TNotifyEvent read FBeforePreview write FBeforePreview;

Fired before the document is previewed.

pascal
property AfterPreview : TNotifyEvent read FAfterPreview write FAfterPreview;

Fired after the document has been previewed.

pascal
property OnShowDocument : TDocumentEvent read FOnShowDocument write FOnShowDocument;

Fired to display the generated document. If unassigned on Windows, the file is opened with the default associated viewer.

pascal
property OnPrintDocument : TDocumentEvent read FOnPrintDocument write FOnPrintDocument;

Fired to print the generated document. Must be assigned for Print to work, otherwise an exception is raised.

pascal
property ShowCommand : Boolean read FShowCommand write FShowCommand default False;

When True, shows the batch command line before executing it.

pascal
property DeleteXMLAfterCreate : Boolean read FDeleteXMLAfterCreate write FDeleteXMLAfterCreate default False;

When True, deletes the XML data file after the output document has been generated.

pascal
property DeleteAfterShow : Boolean read FDeleteAfterShow write FDeleteAfterShow default False;

When True, deletes the output file after it has been shown.

pascal
property DeleteAfterPrint : Boolean read FDeleteAfterPrint write FDeleteAfterPrint default False;

When True, deletes the output file after it has been printed.

pascal
property BeforeCreatePDF : TNotifyEvent read FBeforeCreatePDF write FBeforeCreatePDF;

Fired before the output document is generated by the engine.

pascal
property AfterCreatePDF : TNotifyEvent read FAfterCreatePDF write FAfterCreatePDF;

Fired after the output document has been generated by the engine.

pascal
property FOPOutputType : TFopOutputType read FFOPOutputType write FFOPOutputType default otPdf;

Output document format produced by the engine (default otPdf).

Released under Apache License, Version 2.0.