[DVIPDFMx] Encrypting PDFs without user input.

Michael Joyner mjoyner at vbservices.net
Sun Feb 20 08:08:50 KST 2011


On Sat, Feb 19, 2011 at 5:48 PM, Jin-Hwan Cho <jinhwan.cho at gmail.com> wrote:

> Hi, Joyner.
>
> On Feb 17, 2011, at 12:53 PM, Michael Joyner wrote:
>
> I was trying to encrypt some PDF's with xdvipdfmx via xetex, but discovered
> that it it hangs waiting for user input for the passwords ... Is there a way
> to specify the passwords either by a file or on the command line?
>
> No way as I remember.
>

That bites.

>
> I am trying to do this in a batch process without user interaction
> required.
>
>
> It's quite easy to add the feature you want, but I wonder if the author of
> xetex agrees or not.
> If you are able to write a small piece of C code and to compile it by
> yourself, then try to modify
> the function pdf_enc_set_passwd() in pdfencrypt.c.
>

This latest texlive installed into a user directory on a Centos 4 box....
the compiler chain... is "problematic". :)


> Here, I used the getpass() function in
> the standard C library which avoids the way using standard input (as you
> did).
>

My standard input attempt was a failure.


>
> I will try to discuss this topic with the author of xetex.
>

Hope to hear good results back. :)


> Which way is your favorite? New command line option, external file, or
> \special?
>

I think via \special would be the least intrusive to any work chain. One can
always \include or \input the \specials when needed, or leave the include
file empty when encryption is not needed. (Or even get fancy with an ifthen
package)

Maybe consider having a \special{Enrypt:True, OwnerPassword=BLAH,
UserPassowrd=BLAH, OTHER encryption options) type setup that can be directly
put into the latex file ?

Or perhaps even possibly mimicking the now defunct pdfcrypt.sty ?


> Best regards, ChoF.
>

Thanks for you help!


>
> _______________________________________________
> dvipdfmx mailing list
> dvipdfmx at ktug.or.kr
> http://project.ktug.or.kr/mailman/listinfo/dvipdfmx
>
>


-- 
---

   - Learn to speak Cherokee: http://www.cherokeelessons.com/
   - Cherokee Language Help BBS/Chat:
   http://www.cherokeelessons.com/phpBB3/viewforum.php?f=6
   - Cherokee Lessons PDF made with: http://www.lyx.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://project.ktug.or.kr/pipermail/dvipdfmx/attachments/20110219/97aa45bc/attachment.html>


More information about the dvipdfmx mailing list