2

I use the method mentioned here "Is there a package to secure rendered pdf with a password?".

\special{pdf:encrypt ownerpw (abc) userpw (xyz) length 128 perm 2052}
\documentclass{article}
\begin{document}
This is a test.
\end{document}

Tested:

  1. Win7 64bit + MiKTeX 2.9 32bit

    Did not use the owner password "abc" to encrypt the pdf, but the user password "xyz" by setting.

    miktex-dvipdfmx.exe Version:

    This is xdvipdfmx Version 20160619 by the DVIPDFMx project team,
    modified for TeX Live and MiKTeX,
    an extended version of DVIPDFMx, which in turn was
    an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks.
    
    Copyright (C) 2002-2016 the DVIPDFMx project team
    Copyright (C) 2006-2016 SIL International.
    
    This is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    
  2. macOS 10.12 + MacTeX-2016

    The problem is the same as above.

    dvipdfmx Version:

    This is dvipdfmx Version 20160307 by the DVIPDFMx project team,
    modified for TeX Live,
    an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks.
    
    Copyright (C) 2002-2016 the DVIPDFMx project team
    Copyright (C) 2006-2016 SIL International.
    
    This is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    
  3. There is no problem with the cloud.sagemath.com platform.

    Compile command:

    latexmk -xelatex -f -g -bibtex -synctex=1 --enable-write18 -interaction=nonstopmode 'text.tex'
    

    dvipdfmx Version:

    This is dvipdfmx Version 20150315 by the DVIPDFMx project team,
    modified for TeX Live,
    an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks.
    
    Copyright (C) 2002-2015 the DVIPDFMx project team
    Copyright (C) 2006 SIL International.
    
    This is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    
  4. There is no such problem with the www.sharelatex.com platform.

沙漠之子
  • 489
  • 4
  • 7

1 Answers1

1

A bug has been introduced in the option

-S

from some day. Workaround: when you use

\special{pdf:encrypt ...}

command-line options

-S, -P, -K

are not necessary. If you remove these options, you will succeed. The bug in the option

-S

was fixed in the TeX Live SVN. Anyway, it is simpler not to use command-line options for encryption when you use the special:

\special{pdf:encrypt ...}
Akira Kakuto
  • 2,652