typst / typst

A new markup-based typesetting system that is powerful and easy to learn.
https://typst.app
Apache License 2.0
29.87k stars 818 forks source link

Password-protect PDFs #4387

Open MarkusFF opened 3 weeks ago

MarkusFF commented 3 weeks ago

Description

PDFs have encryption support that allow you to password-protect aspects of the PDF to prevent e.g. reading, modification, printing etc. On some tex flavours this could be achieved with, for example:

\special{pdf:encrypt ownerpw (abc) userpw (xyz) length 128 perm 2052}

This is a feature widely used in PDFs that are sold, such as research papers, standards documents and so on. Although frequently overused this is likely an essential feature for some users.

It should be noted that a PDF can already be modified in this way after generation, for example with pdftk

Use Case

JamesxX commented 3 weeks ago

I imagine this would make for a good cli argument (it deals only with pdf exports so I don't think it should belong in document source itself)

Enivex commented 3 weeks ago

This is a feature widely used in PDFs that are sold, such as research papers,

I can't recall ever having seen a password protected paper. They're hidden behind a paywall, but the actual pdf is not protected in any way.

JamesxX commented 3 weeks ago

This is a feature widely used in PDFs that are sold, such as research papers,

I can't recall ever having seen a password protected paper. They're hidden behind a paywall, but the actual pdf is not protected in any way.

I've mostly seen it when dealing with conference stuff