2017-02-27 4 views
1

Ich bin ein wenig verwirrt, wie man multitiple Werte in einzelne Textbox mit pdftk füllen.PDFtk füllen mehrere Werte in einzelne PDF-Formular Textfeld

Was ich bisher versucht habe:

$dataFields = `pdftk $pdf_path dump_data_fields`; 

Ich bin in der Lage, die Datenfelder mit diesem commnad zu erhalten.

Die Ausgabe dieses:

--- 
FieldType: Text 
FieldName: <<ProjectName>> 
FieldNameAlt: <<ProjectName>> 
FieldFlags: 0 
FieldJustification: Left 
--- 
FieldType: Text 
FieldName: *<<ProjectAddress>><<ProjectCityState>>* 
FieldNameAlt: <<ProjectAddress>><<ProjectCityState>> 
FieldFlags: 0 
FieldJustification: Left 

Aber es gibt zwei Werte, die ich will, für ex <<ProjectAddress>><<ProjectCityState>> mit einigen anderen Werten ersetzen :, 21 jump street NY .Ich einzigen Wert ersetzen kann, sondern, wie mehrere Werte ersetzen dynamisch aus dem Array.

Antwort

0

Okay.so ich fand eine Lösung für meine Frage. was ich getan habe:

1)save the field data in to one .txt file 
2)using command `$dataFields = `pdftk $pdf_path dump_data_fields output output.txt``; 
3)after that i have converted the file data in to array. using `$data = file('output.txt');` command and explode with new line. 
4)then i put condition that if the string contains`FileName:` keyword and make new array. 
5)and then compate it with my array and check.