In PDF land, an owner password will basically give you administrator privileges over the PDF and allow you to set permissions on the document. PyPDF2 currently only supports adding a user password and an owner password to a preexisting PDF. The last topic you will learn about is how PyPDF2 handles encryption. Then you add that newly merged page to your pdf_writer object.įinally, you write the newly watermarked PDF out to disk, and you’re done! When you do that, it will overlay the watermark_page on top of the current page. mergePage() and pass it the watermark_page. The next step is to iterate over the pages in the input_pdf. Then you create a PDF reader object using the input_pdf and a generic pdf_writer object for writing out the watermarked PDF. In the code, you open up the watermark PDF and grab just the first page from the document as that is where your watermark should reside.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |