TPDFlibSBDataMerge

Editions

Description

TPDFlibSBDataMerge (unit PDFlibSBDataMerge) descends from TPDFlibSBBates and implements the Small Business methods for the PDF/VCR-1 data merge: they fill the marked-content placeholders of a variable-content template with field values and append the result as an incremental update, for a template file, for the selected document and for a batch of records.

It belongs to the Small Business edition; the Enterprise edition includes every Small Business class, so it is part of both editions. TPDFlibSBLayers descends from it and adds the next feature group.

Syntax

Delphi

TPDFlibSBDataMerge = Class(TPDFlibSBBates);

Key members

ExecuteVCRDataMergeMerges FieldValues into the template file InputFileName and writes the merged document to OutputFileName; returns 1 when the file was written
ExecuteVCRDataMergeCurrentSaves the selected document to memory, merges FieldValues into that copy and loads the merged result as a new selected document, keeping the template open; a new document is selected only after the merge succeeded, and Options has to be 0
ExecuteVCRDataMergeBatchMerges the 1 to 64 records of the JSON request into one template and writes each result as record- followed by the record ID and .pdf into the output directory; returns a JSON envelope with the outcome of every record

Remarks

A merge the PDF/VCR engine rejects sets LastErrorCode to PDFLIB_ERROR_PDFVCR_COMPLIANCE; any other failure of the file merge sets it to 401.

The batch reads one template of at most 64 MiB and needs an existing output directory. The template must have a valid PDF/VCR replacement structure without a page selection field. With preflightOnly set, the records are checked but no file is written.

Applications normally create TPDFlibSmallBusiness or TPDFlibEnterprise and get the methods of this class through them. The same methods on a plain TPDFlib return 0, an empty string or False and set LastErrorCode to PDFLIB_ERROR_SMALLBUSINESS_REQUIRED.

See also

TPDFlibSBBates, TPDFlibSBLayers, TPDFlibSmallBusiness, TPDFlibEnterprise