galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.15k stars 169 forks source link

Fillable input sitting low #336

Open MrShakes opened 5 years ago

MrShakes commented 5 years ago

I'm filling this form fw4.pdf using the code below and it works however the text in the fields appear low in the fields and when the text is edited manually it then sits in the center of the field such as Yo232165321631J shown in this image screen shot 2018-10-13 at 16 06 09

Ideally the text should be vertically centered in the field

Code:

var writer = hummus.createWriterToModify('fw4.pdf', {
      modifiedFilePath: "fileName.pdf"
 });

 var data = {
      "topmostSubform[0].Page1[0].Line1[0].f1_1[0]": "first",
      "topmostSubform[0].Page1[0].Line1[0].f1_2[0]": "second",
      "topmostSubform[0].Page1[0].Line1[0].f1_3[0]": "third"
  };

  fillForm(writer,data);
  writer.end();

System: Node: 8.10 hummus: 1.0.90

MrShakes commented 5 years ago

Created a fillable form using an older Adobe Acrobat pro(v10.0.0), read the form and filled, the text was hidden in the field until I clicked and edited then it became visible, is there a recommended software to use to avoid this issue?

galkahana commented 5 years ago

Just change the appearance code in tue form fill example to put the text in a diffwrent position. As for text not appearing sound like tye appearance stream is bad in some way...experiment with placing simple artifacts in there to try and figure out the problem

tonybranfort commented 5 years ago

@galkahana There are at least a couple other open issues re "text not appearing", or at least mentioned - #207, #223, https://github.com/galkahana/HummusJS/issues/57#issuecomment-421989768 and the one I opened https://github.com/galkahana/HummusJSSamples/issues/21 . I'm really trying to crack this nut but I'm not a pdf guy at all. I'm happy to do the keyboard banging to figure it out if you or someone would be able to provide some dumbed down direction or pointers to things to read. Eg - I'm not even sure what you mean by "the appearance stream" and "placing some simple artifacts in there". I've been reading and parsing with my pdf but I'm not seeing yet what's happening.

Hatzl commented 5 years ago

207

maybe my answer can help you..