![]() ![]() Some of the 3rd party PDF libraries for Delphi may also be able to fill in Acrobat fields. Obvious ly it is a trivial matter to fill in existing fields instead. If AddedFields.IndexOf(FieldName) '' thenĪ(PDSaveFull, OutputFile) Īs written, this code adds the fields defined in the XML and fills them in as it goes along. If CompareText(MappedFieldType, 'checkbox') = 0 then begin If CompareText(FieldType, 'checkbox') = 0 then beginįield.Set_Value(Format('(%s)', )) ![]() S := GetHeritableAttribute(E, 'TextSize', 'FieldTextSize') If True or (AddedFields.IndexOf(FieldName) '' then S := GetHeritableAttribute(E, 'Height', 'FieldHeight') įield := (FieldName, MappedFieldType, PageNo, ALeft, ATop, ARight, ABottom) as IField S := GetHeritableAttribute(E, 'Width', 'FieldWidth') S := GetHeritableAttribute(E, 'XPos', 'FieldXPos') S := TxpElement(E.ParentNode).GetAttribute('Page') If (CompareText(MappedFieldType, 'Text') = 0) or (CompareText(MappedFieldType, 'Memo') = 0) thenĪlign := LowerCase(E.GetAttribute('Align')) IsMultiLine := CompareText(MappedFieldType, 'memo') = 0 If CompareText(MappedFieldType, 'checkbox') = 0 then If CompareText(FieldName, 'Name1') = 0 thenįieldType := LowerCase(E.GetAttribute('PdfFieldType')) TGenerateFlag = (gfShowAcrobat, gfUseDefaultValues, gfGenerateTestData, gfAddCalibration, gfAlwaysFillCheckboxes) įunction CreateAcrobatFieldsInner(eStartNode: TxpElement Ĭonst Path: String Flags : TGenerateFlags const OutputFile : String): Boolean unit AcrobatXMLu ĪFORMAUTLib_TLB // Acrobat Forms COM objects The Calibrate routine adds some markings to assist field placement. ![]() It's not compilable as is because of some external dependencies, and in need of a bit of refactoring, but it should give you the general idea. Here is some example code which uses the form-filling COM objects of Acrobat to fill in Acrobat fields from XML data parsed using the XML Partner library from Turbopower.
0 Comments
Leave a Reply. |