Describe your idea
It could be great to add an easy layer API working with OCProperties.
Something like:
const pdfDoc = await PDFDocument.load(...); const layers = pdfDoc.ocProperties.layers.get(); const updatedLayers = layers.filter(e => e.name === "SOMETHING"); pdfDoc.ocProperties.layers.set(updatedLayers); const pdfBytes = await pdfDoc.saveAsBase64();
How could this be implemented?
- Adding an object ocProperties to PDFDocument class, copying the
firstPage.doc.catalog.get(PDFName.of("OCProperties")); data
- Allow editing with accessor set (IDK how to edit catalog data actually)
What problem are you trying to solve?
Would like to offer the feature of removing layers when displaying PDF
Why does this matter to you?
This is the key feature of my project
Would others find this helpful?
OC
Are you interested in implementing your proposal?
No
Why are you submitting a proposal?
First, would like to know if it feasible (should be, but i'm not experienced enought with this lib)
Additional Notes
No response
Describe your idea
It could be great to add an easy layer API working with OCProperties.
Something like:
const pdfDoc = await PDFDocument.load(...); const layers = pdfDoc.ocProperties.layers.get(); const updatedLayers = layers.filter(e => e.name === "SOMETHING"); pdfDoc.ocProperties.layers.set(updatedLayers); const pdfBytes = await pdfDoc.saveAsBase64();How could this be implemented?
firstPage.doc.catalog.get(PDFName.of("OCProperties"));dataWhat problem are you trying to solve?
Would like to offer the feature of removing layers when displaying PDF
Why does this matter to you?
This is the key feature of my project
Would others find this helpful?
OC
Are you interested in implementing your proposal?
No
Why are you submitting a proposal?
First, would like to know if it feasible (should be, but i'm not experienced enought with this lib)
Additional Notes
No response