Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: Invalid XRef entry" #59

Open
MrShakes opened this issue Oct 7, 2018 · 3 comments
Open

"Error: Invalid XRef entry" #59

MrShakes opened this issue Oct 7, 2018 · 3 comments

Comments

@MrShakes
Copy link

MrShakes commented Oct 7, 2018

I am trying to fill some forms on a pdf, as a note I have used both Hummus (another pdf library) and now trying to use this module to fill the form, I was able to successfully read the fields however when trying to write to it I get "Error: Invalid XRef entry", researching this error gave me some hints that the file may be damaged however it opens up and fills properly using Adobe Acrobat Pro.
I've attached the pdf file here fw4.pdf and my code is:

var formValues = { 'topmostSubform[0].Page3[0].f3_18[0]': 'Hello'};

pdfFillForm.write('./sample-forms/fw4.pdf', formValues, { "save": "pdf", 'cores': 4, 'scale': 0.2, 'antialias': true } )
.then(function(result) {
      fs.writeFile("Test.pdf", result, function(err) {
           if(err) {
	      return console.log('Yo: ', err);
           }
	  console.log("The file was saved!");
      });
}, function(err) {
     console.log('Um: ', err);
});
@patrykniedbalski
Copy link

I'm having exactly the same message even though, fields are filled. So the only thing im wondering is how to suppress displaying that error.

@lobabob
Copy link

lobabob commented Mar 20, 2019

I've also gotten the same issue. But I don't see any negative consequences yet (PDF appears to be fine and not corrupt).

@lobabob
Copy link

lobabob commented Mar 27, 2019

Take that back, there are def negative consequences. In some PDF forms that get this error, PDF properties show up as actual values for some reason. so you end up seeing things like dd or ds in random fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants