Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional content groups in muPDF backend #1155

Merged
merged 1 commit into from
Aug 31, 2024
Merged

Conversation

mbway
Copy link
Contributor

@mbway mbway commented Aug 30, 2024

This PR introduces the option for the muPDF backend to tag entities as belonging to 'optional content groups' which are similar to layers in that visibility of entities in the groups can be toggled in supported viewers. muPDF OCG documentation. This feature was requested in #1154 .

The current implementation only outputs visible layers as entities on invisible/hidden layers are filtered out by the frontend. A future improvement could be to use --all-layers-visible together with an option for the backend to set the layer visibility in the output independently from their visibility in the dxf.

Some fixes have also been applied to the ezdxf draw command as the --all-layers-visible had stopped working.

try:
import fitz
import pymupdf # type: ignore[import-untyped]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fitz is a legacy name and mupdf is the new name: source

@mbway
Copy link
Contributor Author

mbway commented Aug 30, 2024

the output of ezdxf draw examples_dxf/visibility.dxf --backend mupdf --out out.pdf

image

@mozman mozman merged commit 28b99dc into mozman:master Aug 31, 2024
9 checks passed
@mozman
Copy link
Owner

mozman commented Aug 31, 2024

I would not add support for exporting turned off or frozen layers, as this is often not the intention of the DXF file creator, although BricsCAD supports this as an option.

It is very laborious to implement and test and may break other functionality.

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.

2 participants