Open satyajitnayk opened 11 months ago
Trying to flatten the pdf!
form_to_flatten.pdf
import fs from 'fs'; import { PDFDocument } from 'pdf-lib'; const flattenPDF = async () => { const pdfDocument = await PDFDocument.load( fs.readFileSync('form_to_flatten.pdf') ); const pdfForm = pdfDocument.getForm(); pdfForm.flatten(); const pdfBytes = await pdfDocument.save(); fs.writeFileSync('flattened.pdf', pdfBytes); }; flattenPDF();
the flattened pdf is missing check mark in check boxes.
the flattened pdf should not have missing check mark in check boxes. They should be intact.
we can reproduce this using pdf & script provided in How did you attempt to do it? section.
How did you attempt to do it?
1.17.1
Node
No response
referenced in https://github.com/cantoo-scribe/pdf-lib/issues/41
What were you trying to do?
Trying to flatten the pdf!
How did you attempt to do it?
form_to_flatten.pdf
What actually happened?
the flattened pdf is missing check mark in check boxes.
Visuals
What did you expect to happen?
the flattened pdf should not have missing check mark in check boxes. They should be intact.
How can we reproduce the issue?
we can reproduce this using pdf & script provided in
How did you attempt to do it?
section.Version
1.17.1
What environment are you running pdf-lib in?
Node
Checklist
Additional Notes
No response