WPCubed Product Support

Input fields in PDF - a little urgent

9.8k Views 2 users read 2 min

Hi Julian,

i got quite far now, though i did not solve some Problems with check-boxes in supermerge (edit fields working).

But now :

Is there a product from wpcubed to read the field-contents out of filled PDF forms?

#7 ♥ 0

Thank you, it works….

Checkboxes i try shortly

var

obj: TWPTextObj;

multiline : boolean;

autosize : boolean;

fontindex : integer;

begin

fontindex := 0;

multiline := false;

autosize := false;

if multiline

*then obj := wpedit.TextObjects.InsertClass('TWPOEditControl', 360*5, 260*5 )*

*else obj := wpedit.TextObjects.InsertClass('TWPOEditControl', 360*5, 260 );*

if obj.IsImage then begin

obj.ObjRef.ObjName := 'AFieldName';

// (obj.ObjRef as TWPOEditControl)._AllowFrame := true;

(obj.ObjRef as TWPOEditControl).Text.Text := 'extEdit.Text';

(obj.ObjRef as TWPOEditControl).Hint := 'intEdit.Text';

(obj.ObjRef as TWPOEditControl).PDFFont := TWPOEditControlPDFFont(fontindex);

if not autosize

then (obj.ObjRef as TWPOEditControl).PDFOptions :=

(obj.ObjRef as TWPOEditControl).PDFOptions - [wpecAutosizeFont];

(obj.ObjRef as TWPOEditControl).Multiline := multiline;

if multiline

then (obj.ObjRef as TWPOEditControl).FontSize := 10;

end;

end;

#6 ♥ 0
wpsupport

Please first try with a visible text to check if the field is displayed by wptools.

I tested with

// uses WPObj_Controls
procedure TForm1.Button3Click(Sender: TObject);
var obj : TWPTextObj;
begin
 if Multiline.Checked then
       obj := WPRichText1.TextObjects.InsertClass('TWPOEditControl', 360*5, 260*5 )
 else  obj := WPRichText1.TextObjects.InsertClass('TWPOEditControl', 360*5, 260 );
end;

and that creates a field.

#5 ♥ 0

pdf := TWPPDFExport.Create(nil);

if EmbeddedFonts

then pdf.FontMode := wpEmbedTrueTypeFonts;
rtf := TWPRichText.CreateDynamic;

try

rtf.InsertPointAttr.Hidden := true;

rtf.AsString := ASource;

rtf.ReformatAll(true);

pdf.Source := rtf;

pdf.AutoLaunch := LaunchReader;

pdf.FileName := AFileName;

try
pdf.Print;

Result := true;

except

Result := false;

end;

......

#4 ♥ 0

with WPEdit.InputTextFieldName('FORMCHECKBOX') do

begin

Source := 'Test1';

Params := 'true'; //'false'

end;

and

with WPedit.InputTextFieldName('FORMEDITFIELD') do

begin

Source := 'XXX';

Params := 'testtext' + '@@HINT@@' + 'testhint hint hint';

end;

end;

I see the entries in PDF, but they are not editable

#3 ♥ 0

Hi Julian,

I have to generate a PDF-Form with Input fields.

A Tried to do it like it is described in the documentation, but

i cannot see input fields (or check boxes) that can be edited.

Anything to look for or did i get the whole thing wrong?

Chuck

#1 ♥ 0