[XeTeX] How can I encrypt (limit permissions) in my PDF?

George N. White III gnwiii at gmail.com
Sun Apr 24 14:22:43 CEST 2011

On Sun, Apr 24, 2011 at 4:24 AM, Ron Aaron <ron at ronware.org> wrote:
> Hi, all --
> If I create a simple PDF using xetex, I can post-process it using
> "pdftk" to create a "restricted" PDF which doesn't allow copy and paste,
> for example.
> After looking around, I noticed that 'xdvipdfmx' is *supposed* to also
> be able to do this; so I did something like:
>    xetex --output-driver='xdvipdfmx -S' simple.tex
> However, this has two problems.  First, it prompts for both owner and
> user passwords for the PDF, and there does not seem to be any way to
> specify them in a file or an option.  Second, xdivpdfmx actually crashes
> with a "segmentation fault".  Not very useful -- and the PDF is not
> generated, nor is a useful error given as to what may be the problem.
> What I would like ideally is to have a way to add a "\special{}" and get
> an encrypted PDF.  Barring that, some what to have xdvipdfmx work
> correctly.
> Does anyone have ideas on how to make this work?

Is this really needed or appropriate for xdvipdfmx?

If the capability is provided by 3rd party tools then it might be better
to remove or hide such features in xdvipdfmx.  One of the
advantages of pdf is the huge number of pdf creators who have
never heard of TeX but drive development of tools such as pdftk
and qpdf that work on "all" on pdf's, including those created by

George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia

More information about the XeTeX mailing list