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

[Bug]: PDF layer visibility on printing #18954

Open
user-kh opened this issue Oct 24, 2024 · 3 comments
Open

[Bug]: PDF layer visibility on printing #18954

user-kh opened this issue Oct 24, 2024 · 3 comments
Labels

Comments

@user-kh
Copy link

user-kh commented Oct 24, 2024

Attach (recommended) or Link to PDF file

Test.pdf

Web browser and its version

Firefox

Operating system and its version

every

PDF.js version

every

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

User essigwurst discovered the error:

https://connect.mozilla.org/t5/ideas/built-in-pdf-editor-layer-visibility-on-printing/idi-p/57362

What is the expected behavior?

If a layer has been deactivated, I also expect that it will not be printed.

What went wrong?

`There is a PDF feature, which are called "layers". I see this as an advantage, that Firefox supports those, and also supports enabling / disabling (set visibility) them when a PDF file is opened in the browser itself.

However, when someone want to print this file (with some layers enabled and some disabled), it would always print everything (all layers enabled / set to visible), therefore it would be good, if the current layer settings would be also applied when someone prints the document.`

layers

Link to a viewer

No response

Additional context

No response

@Snuffleupagus
Copy link
Collaborator

Attach (recommended) or Link to PDF file

layers

Note: As mention in the issue template, please actually attach the PDF file under this heading (and not a screen-shot).

As mentioned in #17726 (comment), see the third point, this isn't entirely trivial to implement since we also need to take the Usage dictionary into account when printing.

@user-kh
Copy link
Author

user-kh commented Oct 25, 2024

Thanks for the tip. I have attached an example.
I use this feature a lot. It would be great, if the developers could include this feature.

Maybe an idea:
Could you perhaps add a 'print media query' as a workaround so that you can use the browser printer and it prints the PDF correctly?

@user-kh user-kh changed the title PDF layer visibility on printing [Bug]: PDF layer visibility on printing Oct 25, 2024
@GitHubRulesOK
Copy link

GitHubRulesOK commented Oct 29, 2024

Just a COMMENT that for PDF there are separate yet inter-related layer control FLAGS for print and view here is the OP file correctly set for layer "no print"
Test (hiden print layer).pdf

Viewer control On Off is as expected. Shown by the layer controls

image

BOTH LAYERS ON but print flag OFF in PDF works as per standards the no print layer is correctly not printed by PDF.js

image
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants