Possible to skip rendering of layers (optional content config)? #19413
Replies: 2 comments 2 replies
-
If you mean that disabled layers still become visible, that would be a bug (assuming that you disabled the layer correctly). If that's the problem, can you also reproduce it in the demo viewer?
If you mean that the disabled layer is indeed invisible, as expected, but that the paths are still parsed then that's intended and necessary behaviour given section 8.11.3.1 of the PDF specification:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your response. The layers do not become visible, so that's ok. But the browser freezes completely. I've also tested it on the demo viewer. In Chrome/Brave it freezes the browser. However, in Safari it works fine with the same file. |
Beta Was this translation helpful? Give feedback.
-
I have a PDF drawing with a huge amount of paths.
Is it possible to skip the rendering of a selection of these paths, based on the layer they are in?
I've tried to use the 'getOptionalContentConfig()' implementation, by using:
optionalContentConfig.setVisibility(groupIndex, false)
But it seems the paths are still rendered, which freezes the browser.
Is it possible to skip the rendering of these paths altogether, when the path is part of the disabled layer?
I've tested this by counting the amount of executions of the function "constructPath" in the class "CanvasGraphics".
Beta Was this translation helpful? Give feedback.
All reactions