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

Print Dialog restrictions under wrong permission #4739

Open
MordyT opened this issue Dec 29, 2024 · 3 comments
Open

Print Dialog restrictions under wrong permission #4739

MordyT opened this issue Dec 29, 2024 · 3 comments

Comments

@MordyT
Copy link

MordyT commented Dec 29, 2024

Hello,
Long time Sumatra user. I took a quick look through open issues and discussions and don’t see this mentioned.

We use the sumatrapdfrestrict.ini function to control the user experience (see https://github.com/sumatrapdfreader/sumatrapdf/blob/master/docs/sumatrapdfrestrict.ini) and ran into an interesting situation.

Per documentation above, if DiskAccess is turned off, the print dialog is not shown. This is true in every version of Sumatra 2.5 and above. In 2.4 (and below), it is shown, while leaving the other functions controlled by DiskAccess disabled.

We’d like to allow the print dialog without the rest of the features controlled by DiskAccess, but we’d also like to be able to upgrade from 2.4. Is it possible to move the print dialog into the PrinterAccess function instead of DiskAccess or as a separate permission? Makes more sense that PrinterAccess would control printing features anyways.

@GitHubRulesOK
Copy link
Collaborator

GitHubRulesOK commented Dec 29, 2024

Hmmm
not the developer and time changes some security facets / methods but the reason for that dialog being under no disk access is there are loopholes in that area so for example Print to PDF gives you full ability to access the root of the drives and upwards.

Equally there are newer ways to circumvent some restrictions but that is a different story

@MordyT
Copy link
Author

MordyT commented Dec 29, 2024

Hmm, that's a fair point (the print to PDF opening the door for file system access). However, it's not mitigated because I can just set my PDF printer as default and get the same file system access.

It could be that I'm stuck in an XY Problem. Is there another way to allow the user to select which pages to print besides that dialog in Sumatra that I just don't know?

@GitHubRulesOK
Copy link
Collaborator

SumatraPDF is based upon MuPDF VIEW which does not have any of Artifex's printer code (GhostScript)

Thus "Printing" has been a weak feature of SumatraPDF for a long time. GhostScript print a page or pages would be better.
You could write a "shim" to pass pages numbers to a set of GhostScript calls from SumatraPDF but would be simpler not to.

Ghostscript as a console application does not use a print dialog so only expects one range per call "first page to last page"
Thus the easiest way to get prints is write a dialog for page numbers to pass to GS direct.

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

No branches or pull requests

2 participants