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

Why am I not able to write new text to the file? #108

Open
techsin opened this issue Aug 4, 2020 · 0 comments
Open

Why am I not able to write new text to the file? #108

techsin opened this issue Aug 4, 2020 · 0 comments

Comments

@techsin
Copy link

techsin commented Aug 4, 2020

I load the file, change the text, and save the file. I check text was updated and it has but when it's saved, it's same as before??
Assume it's in a function and imports have been done

const file = './file.pdf';
const doc = new nopodofo.Document();
await new Promise((resolve, reject) => doc.load(file, e => e ? reject(e) : resolve()));
let page = doc.getPage(0);
let field = page.getField(0);
let text = page.getFields().filter(x => x.text[0] === '$')[0];
text.text = 'myemail@gmail.com';
console.log(doc.getPage(0).getFields().map(x => x.text)); //Yes it did change
doc.write('./test.pdf', function(a, b){})

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

1 participant