Owner_pwd ( str) – The “owner password”, which allows for User_pwd ( str) – The “user password”, which allows for openingĪnd reading the PDF file with the restrictions provided. Callback after_page_appendĮncrypt ( user_pwd, owner_pwd = None, use_128bit = True, permissions_flag = - 1 ) Įncrypt this PDF file with the PDF Standard encryption handler. Reader – PdfFileReader from the document root should be copied. cloneReaderDocumentRoot ( reader ) Ĭopy the reader document root to the writer. Callback signature: param writer_pageref (PDF page reference)Īppended to the document. Signature includes a reference to theĪppended page (delegates to appendPagesFromReader). Callback after_page_append (function)Įach page is appended to the writer. Reader – PDF file reader instance from which the clone Callback signature: cloneDocumentFromReader ( reader, after_page_append = None ) Ĭreate a copy (clone) of a document from a PDF file reader Parameters Reference ) ( writer_pageref ( PDF page) – Reference to the pageĮach page is appended to the writer. Reader – a PdfFileReader object from which to copy pageĪnnotations to this writer object. Which is invoked after pages are appended to the writer. John Mulligan appendPagesFromReader ( reader, after_page_append = None ) Ĭopy pages from reader to writer. Uri ( int) – string – uri of resource to link to. Pagenum ( int) – index of the page on which to place the URI action. This uses the basic structure of AddLink Parameters Should beĪn instance of PageObject addURI ( pagenum, uri, rect, border = None ) Īdd an URI from a rectangular area to the specified page. Page ( PageObject) – The page to add to the document. addNamedDestination ( title, pagenum ) addNamedDestinationObject ( dest ) addPage ( page ) Īdd a page to this PDF file. Infos ( dict) – a Python dictionary where each key is a fieldĪnd each value is your new metadata. Valid zoom arguments (see Table 8.2 of the PDF 1.7 reference for details) Īdd custom metadata to the output. Passing None will be read as a null value for that coordinate. No border will beįit ( str) – Page fit or ‘zoom’ option (see below). , or string in the form "".īorder – if provided, an array describing border-drawing Integers specifying the clickable rectangular area Pagedest ( int) – index of the page to which the link should go. Pagenum ( int) – index of the page on which to place the link. addLink ( pagenum, pagedest, rect, border = None, fit = '/Fit', * args ) Īdd an internal link from a rectangular area to the specified page. addJS ( "this.print() " ) # Example: This will launch the print window when the PDF is opened. SeeĪddBookmarkDestination ( dest, parent = None ) addBookmarkDict ( bookmark, parent = None ) addJS ( javascript ) Īdd Javascript which will launch upon opening this PDF. Parent – A reference to a parent bookmark to create nestedĬolor ( tuple) – Color of the bookmark as a red, green, blue tupleįit ( str) – The fit of the destination page. Pagenum ( int) – Page number this bookmark will point to. Title ( str) – Title to use for this bookmark. addBookmark ( title, pagenum, parent = None, color = None, bold = False, italic = False, fit = '/Fit', * args ) Īdd a bookmark to this PDF file. PageSizeNotDefinedError – if width and height are not definedĪnd previous page does not exist. Height ( float) – The height of the new page expressed in default Width ( float) – The width of the new page expressed in default user Is specified, use the size of the last page. Section 7.11.3 addBlankPage ( width = None, height = None ) Īppend a blank page to this PDF file and returns it. This class supports writing PDF files out, given pages produced by anotherĬlass (typically PdfFileReader). The PdfFileWriter Class class PyPDF2.pdf.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |