How to set security options for a PDF using pdflatex












42















My questions is very simple.
How can I set security setting for a PDF file created with PDFLatex?



I should set some password or print permissions, etc.










share|improve this question















migrated from stackoverflow.com Oct 18 '11 at 8:59


This question came from our site for professional and enthusiast programmers.























    42















    My questions is very simple.
    How can I set security setting for a PDF file created with PDFLatex?



    I should set some password or print permissions, etc.










    share|improve this question















    migrated from stackoverflow.com Oct 18 '11 at 8:59


    This question came from our site for professional and enthusiast programmers.





















      42












      42








      42


      15






      My questions is very simple.
      How can I set security setting for a PDF file created with PDFLatex?



      I should set some password or print permissions, etc.










      share|improve this question
















      My questions is very simple.
      How can I set security setting for a PDF file created with PDFLatex?



      I should set some password or print permissions, etc.







      pdf pdftex drm






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 20 '14 at 13:52









      Martin Schröder

      12.9k640125




      12.9k640125










      asked Oct 13 '11 at 5:34









      IsraelIsrael

      3831510




      3831510




      migrated from stackoverflow.com Oct 18 '11 at 8:59


      This question came from our site for professional and enthusiast programmers.









      migrated from stackoverflow.com Oct 18 '11 at 8:59


      This question came from our site for professional and enthusiast programmers.
























          2 Answers
          2






          active

          oldest

          votes


















          40














          This answer, taken partially verbatim from Digital signature on TeX.SX:



          Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing by default, would allow users of the document to view/read/print without authentication. You would need the following command line execution:



          pdftk input.pdf output output.pdf owner_pw foo allow printing


          The above commands takes as input input.pdf, sets the owner password to foo and would allow printing by any user. Modification of document settings require the owner password. See the documentation/man page and examples for more information.






          share|improve this answer





















          • 1





            Thank you very much for reply. I was useful for me, I am now using pdftk like my tool. But let me confirm one doubt... Is it no possible to add security with PdfLatex?

            – NeoRiddle
            Oct 14 '11 at 4:49






          • 4





            As far as I know, this is not possible directly. You need external software to encrypt the file.

            – Werner
            Oct 14 '11 at 4:54



















          0














          As pdftk is no longer easily available for certain Linux distributions (or no longer easy to keep track of what is going on), another option is qpdf. Password protection is possible. The basic syntax is:





          qpdf infile.pdf --encrypt <userpwd> <ownerpwd> <key length> [ restrictions ] outfile.pdf


          Where,




          • one or both of <userpassword> and <ownerpassword> may be empty strings


          • key length may be 40, 128, or 256 and the higher the value the more restrictions one can impose on the use of the pdf.


          For example,



            qpdf infile.pdf --encrypt usr own 128 --print=none -- outfile.pdf


          should prevent unauthorized printing.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "85"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f31901%2fhow-to-set-security-options-for-a-pdf-using-pdflatex%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            40














            This answer, taken partially verbatim from Digital signature on TeX.SX:



            Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing by default, would allow users of the document to view/read/print without authentication. You would need the following command line execution:



            pdftk input.pdf output output.pdf owner_pw foo allow printing


            The above commands takes as input input.pdf, sets the owner password to foo and would allow printing by any user. Modification of document settings require the owner password. See the documentation/man page and examples for more information.






            share|improve this answer





















            • 1





              Thank you very much for reply. I was useful for me, I am now using pdftk like my tool. But let me confirm one doubt... Is it no possible to add security with PdfLatex?

              – NeoRiddle
              Oct 14 '11 at 4:49






            • 4





              As far as I know, this is not possible directly. You need external software to encrypt the file.

              – Werner
              Oct 14 '11 at 4:54
















            40














            This answer, taken partially verbatim from Digital signature on TeX.SX:



            Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing by default, would allow users of the document to view/read/print without authentication. You would need the following command line execution:



            pdftk input.pdf output output.pdf owner_pw foo allow printing


            The above commands takes as input input.pdf, sets the owner password to foo and would allow printing by any user. Modification of document settings require the owner password. See the documentation/man page and examples for more information.






            share|improve this answer





















            • 1





              Thank you very much for reply. I was useful for me, I am now using pdftk like my tool. But let me confirm one doubt... Is it no possible to add security with PdfLatex?

              – NeoRiddle
              Oct 14 '11 at 4:49






            • 4





              As far as I know, this is not possible directly. You need external software to encrypt the file.

              – Werner
              Oct 14 '11 at 4:54














            40












            40








            40







            This answer, taken partially verbatim from Digital signature on TeX.SX:



            Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing by default, would allow users of the document to view/read/print without authentication. You would need the following command line execution:



            pdftk input.pdf output output.pdf owner_pw foo allow printing


            The above commands takes as input input.pdf, sets the owner password to foo and would allow printing by any user. Modification of document settings require the owner password. See the documentation/man page and examples for more information.






            share|improve this answer















            This answer, taken partially verbatim from Digital signature on TeX.SX:



            Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing by default, would allow users of the document to view/read/print without authentication. You would need the following command line execution:



            pdftk input.pdf output output.pdf owner_pw foo allow printing


            The above commands takes as input input.pdf, sets the owner password to foo and would allow printing by any user. Modification of document settings require the owner password. See the documentation/man page and examples for more information.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 '17 at 12:34









            Community

            1




            1










            answered Oct 13 '11 at 6:46









            WernerWerner

            447k699891695




            447k699891695








            • 1





              Thank you very much for reply. I was useful for me, I am now using pdftk like my tool. But let me confirm one doubt... Is it no possible to add security with PdfLatex?

              – NeoRiddle
              Oct 14 '11 at 4:49






            • 4





              As far as I know, this is not possible directly. You need external software to encrypt the file.

              – Werner
              Oct 14 '11 at 4:54














            • 1





              Thank you very much for reply. I was useful for me, I am now using pdftk like my tool. But let me confirm one doubt... Is it no possible to add security with PdfLatex?

              – NeoRiddle
              Oct 14 '11 at 4:49






            • 4





              As far as I know, this is not possible directly. You need external software to encrypt the file.

              – Werner
              Oct 14 '11 at 4:54








            1




            1





            Thank you very much for reply. I was useful for me, I am now using pdftk like my tool. But let me confirm one doubt... Is it no possible to add security with PdfLatex?

            – NeoRiddle
            Oct 14 '11 at 4:49





            Thank you very much for reply. I was useful for me, I am now using pdftk like my tool. But let me confirm one doubt... Is it no possible to add security with PdfLatex?

            – NeoRiddle
            Oct 14 '11 at 4:49




            4




            4





            As far as I know, this is not possible directly. You need external software to encrypt the file.

            – Werner
            Oct 14 '11 at 4:54





            As far as I know, this is not possible directly. You need external software to encrypt the file.

            – Werner
            Oct 14 '11 at 4:54











            0














            As pdftk is no longer easily available for certain Linux distributions (or no longer easy to keep track of what is going on), another option is qpdf. Password protection is possible. The basic syntax is:





            qpdf infile.pdf --encrypt <userpwd> <ownerpwd> <key length> [ restrictions ] outfile.pdf


            Where,




            • one or both of <userpassword> and <ownerpassword> may be empty strings


            • key length may be 40, 128, or 256 and the higher the value the more restrictions one can impose on the use of the pdf.


            For example,



              qpdf infile.pdf --encrypt usr own 128 --print=none -- outfile.pdf


            should prevent unauthorized printing.






            share|improve this answer




























              0














              As pdftk is no longer easily available for certain Linux distributions (or no longer easy to keep track of what is going on), another option is qpdf. Password protection is possible. The basic syntax is:





              qpdf infile.pdf --encrypt <userpwd> <ownerpwd> <key length> [ restrictions ] outfile.pdf


              Where,




              • one or both of <userpassword> and <ownerpassword> may be empty strings


              • key length may be 40, 128, or 256 and the higher the value the more restrictions one can impose on the use of the pdf.


              For example,



                qpdf infile.pdf --encrypt usr own 128 --print=none -- outfile.pdf


              should prevent unauthorized printing.






              share|improve this answer


























                0












                0








                0







                As pdftk is no longer easily available for certain Linux distributions (or no longer easy to keep track of what is going on), another option is qpdf. Password protection is possible. The basic syntax is:





                qpdf infile.pdf --encrypt <userpwd> <ownerpwd> <key length> [ restrictions ] outfile.pdf


                Where,




                • one or both of <userpassword> and <ownerpassword> may be empty strings


                • key length may be 40, 128, or 256 and the higher the value the more restrictions one can impose on the use of the pdf.


                For example,



                  qpdf infile.pdf --encrypt usr own 128 --print=none -- outfile.pdf


                should prevent unauthorized printing.






                share|improve this answer













                As pdftk is no longer easily available for certain Linux distributions (or no longer easy to keep track of what is going on), another option is qpdf. Password protection is possible. The basic syntax is:





                qpdf infile.pdf --encrypt <userpwd> <ownerpwd> <key length> [ restrictions ] outfile.pdf


                Where,




                • one or both of <userpassword> and <ownerpassword> may be empty strings


                • key length may be 40, 128, or 256 and the higher the value the more restrictions one can impose on the use of the pdf.


                For example,



                  qpdf infile.pdf --encrypt usr own 128 --print=none -- outfile.pdf


                should prevent unauthorized printing.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 24 mins ago









                jonjon

                19.8k23992




                19.8k23992






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f31901%2fhow-to-set-security-options-for-a-pdf-using-pdflatex%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Contact image not getting when fetch all contact list from iPhone by CNContact

                    count number of partitions of a set with n elements into k subsets

                    A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks