Skip to content

Add layers management feature #105

@enzo-billis

Description

@enzo-billis

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?

  1. Adding an object ocProperties to PDFDocument class, copying the firstPage.doc.catalog.get(PDFName.of("OCProperties")); data
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions