Developer Tools
|
Office Productivity Applications
|
Platform-Agnostic APIs
|
Home | Online Demos | Downloads | Buy Now | Support | About Us | News | Working Together | Contact Us
In March this year, we released a version of XtremeDocumentStudio Delphi that added the ability to display data-aware form fields on the VCL document viewer control. Two new properties have been introduced to make this possible - FieldDataSource
and FieldMapping
. You need to first connect FieldDataSource
to a data source on your computer. Then, you need to use FieldMapping
to map the names of the form fields in the PDF document to column names in the data source.
public property FieldDataSource: TDataSource; public function FieldMapping(FieldName: string): TgtFieldDataLink; virtual;
public: __property TDataSource FieldDataSource; public: virtual __fastcall TgtFieldDataLink FieldMapping(AnsiString FieldName);
In the TgtFieldDataLink
type, you will be mostly interested in DataFieldName
and ValueMappings
properties. The former is for identifying the form field. The latter is a name-value pair that is used to set the value of the form field in the document and the actual value that is submitted when the former gets chosen by the end-user or code.
public property DataFieldName: string; public property ValueMappings: TDictionary;
public: __property AnsiString DataFieldName; public: __property TDictionary ValueMappings;
Here is an example of using this new feature.
TDBGrid
TDataSource
TgtDocumentViewer
TButton
(2)TDataSource
needs to be linked to a data set object. For simplicity, I have used a TADODataSet
to load values from an Access database (NorthWind). You can choose some other component for your data source.
gtDocumentViewer1.FieldDataSource := DataSource1; gtDocumentViewer1.FieldMapping('f1_1[0]').DataFieldName := 'FirstName'; gtDocumentViewer1.LoadFromFile( 'C:\Users\egg\Documents\Gnostice\XtremeDocumentStudio Delphi'+ '\Demos\Delphi\VCL\7. Document Viewer - Data aware Interactive forms'+ '\Sample_tax_form.pdf');
gtDocumentViewer1.SaveToFile('Sample_tax_form_MODIFIED.pdf');
Of course, this example does not exactly map the form fields to columns in the database. For that, you will need to create a specialized database "view" and then display it in the grid.
---o0O0o---
Our .NET Developer Tools | |
---|---|
Gnostice Document Studio .NETMulti-format document-processing component suite for .NET developers. |
PDFOne .NETA .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 DelphiMulti-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms. |
eDocEngine VCLA Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools. |
PDFtoolkit VCLA Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents. |
Our Java developer tools | |
---|---|
Gnostice Document Studio JavaMulti-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 | |
---|---|
StarDocsCloud-hosted and On-Premises REST-based document-processing and document-viewing APIs |
Privacy | Legal | Feedback | Newsletter | Blog | Resellers | © 2002-2025 Gnostice Information Technologies Private Limited. All rights reserved. |