Skip to content

Add optional content groups example#81

Open
ratmice wants to merge 2 commits into
typst:mainfrom
ratmice:layers_example
Open

Add optional content groups example#81
ratmice wants to merge 2 commits into
typst:mainfrom
ratmice:layers_example

Conversation

@ratmice

@ratmice ratmice commented Jun 27, 2026

Copy link
Copy Markdown

I used AI for help with the pdf optional content groups.
It took quite a bit of manual fiddling to both get something that worked with poppler + pdf.js and also didn't drop into manual Content::op() encoding.

I've tried to both clean this up, and trim out any unnecessary bits, but perhaps with my unfamiliarity with ocg some useless garbage may have snuck in. It appears to work without the View/Usage Intents, as those are optional. But I'm not entirely certain how those get used by consumers, so I left them.

I just figured since I went through the trouble myself, perhaps it could help someone else
if there was an example.

@ratmice

ratmice commented Jun 27, 2026

Copy link
Copy Markdown
Author

Hmm, suppose I should include a second shape layer to act as a radio button like layer, that would select between the two shape layers. As that is a feature not currently shown...

Should be fixed in c9a2563

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

Successfully merging this pull request may close these issues.

1 participant