Xelatex引擎加密pdf问题:dvipdfmx是否存在bug?

Xelatex引擎加密pdf问题:dvipdfmx是否存在bug?

我使用这里提到的方法“是否有一个包可以用密码保护渲染的 PDF?”

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

已测试:

  1. Win7 64位 + MiKTeX 2.9 32位

    没有使用所有者密码“abc”来加密pdf,而是通过设置使用用户密码“xyz”。

    miktex-dvipdfmx.exe 版本:

    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

    问题和上面的一样。

    dvipdfmx 版本:

    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. 没有问题cloud.sagemath.com平台。

    编译命令:

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

    dvipdfmx 版本:

    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. 不存在这样的问题www.sharelatex.com 平台。

答案1

选项中出现了一个错误

-S

从某一天开始。解决方法:当您使用

\special{pdf:encrypt ...}

命令行选项

-S, -P, -K

不是必需的。如果删除这些选项,您将成功。选项中的错误

-S

已在 TeX Live SVN 中修复。无论如何,当您使用特殊命令时,不使用命令行选项进行加密更为简单:

\special{pdf:encrypt ...}

相关内容