Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 1øªj>ñã@sæddlZddlZddlZddlZddlZddlZddlmZmZm Z ddl m Z ddl m Z ddlmZddlmZmZmZmZmZmZmZmZmZmZmZmZddlmZmZdd l m!Z!m"Z"dd l#m$Z$m%Z%dd l&m'Z'dd l(m)Z)m*Z*m+Z+dd l,m-Z-ddl.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4ddl5m6Z7ddl5m8Z9ddl5m:Z:m;Z;mZ>m?Z?m@Z@mAZAddl5mBZCddl5mDZEddl5mFZGddl5mHZIddl5mJZKddlLmMZMddlNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZeddlfmgZgmhZhddlmiZimjZjmkZkmlZlmmZmmnZnddlompZpeAjqƒZrdZsGdd„dejtƒZud+eevewd œd!d"„ZxGd#d$„d$e"ƒZyeeewefeweveefe]d%œd&d'„ZzedeYfeweee{e{e{fewdfe|e|ead(œd)d*„Z}dS),éN)ÚBytesIOÚFileIOÚIOBase)Úcompress)ÚPath)Ú TracebackType) ÚIOÚAnyÚCallableÚDictÚIterableÚListÚOptionalÚPatternÚTupleÚTypeÚUnionÚcasté)Ú_default_fonts_space_widthÚbuild_char_map_from_dict)ÚDocumentInformationÚ PdfDocCommon)ÚEncryptAlgorithmÚ Encryption)Ú PageObject)Únums_clear_rangeÚ nums_insertÚ nums_next)Ú PdfReader)Ú StrByteTypeÚ StreamTypeÚ_get_max_pdf_version_headerÚ deprecateÚdeprecation_with_replacementÚlogger_warning)ÚAnnotationDictionaryAttributes)ÚCatalogAttributes)ÚCatalogDictionaryÚ"FileSpecificationDictionaryEntriesÚGoToActionArgumentsÚ ImageTypeÚInteractiveFormDictEntriesÚPageLabelStyleÚTypFitArgumentsÚUserAccessPermissions)ÚCore)ÚFieldDictionaryAttributes)ÚPageAttributes)ÚPagesAttributes)Ú TrailerKeys)Ú PyPdfError)ÚPAGE_FITÚ ArrayObjectÚ BooleanObjectÚByteStringObjectÚ ContentStreamÚDecodedStreamObjectÚ DestinationÚDictionaryObjectÚFitÚ FloatObjectÚIndirectObjectÚ NameObjectÚ NullObjectÚ NumberObjectÚ PdfObjectÚRectangleObjectÚ StreamObjectÚTextStringObjectÚ TreeObjectÚViewerPreferencesÚcreate_string_objectÚ hex_to_rgbÚis_null_or_none)Ú PageRangeÚ PageRangeSpec)ÚAnnotationSubtypeÚBorderArrayTypeÚ LayoutTypeÚOutlineItemTypeÚ OutlineTypeÚ PagemodeType)ÚXmpInformationé c@s\eZdZdZejƒZejƒZejƒZejƒZ ejƒZ ejƒZ ejƒZ ejƒZ e e Be BZdS)ÚObjectDeletionFlagrN)Ú__name__Ú __module__Ú __qualname__ÚNONEÚenumÚautoÚTEXTÚLINKSÚ ATTACHMENTSÚ OBJECTS_3DÚALL_ANNOTATIONSÚXOBJECT_IMAGESÚ INLINE_IMAGESÚDRAWING_IMAGESZIMAGES©rfrfú./tmp/pip-build-_d5lkt3n/pypdf/pypdf/_writer.pyrWsrWé)ÚstreamÚ blocksizeÚreturncs8tjƒ}x&t‡‡fdd„dƒD]}|j|ƒqW|jƒS)Ncs ˆjˆƒS)N)Úreadrf)rjrirfrgÚŽsz#_rolling_checksum..ó)ÚhashlibÚmd5ÚiterÚupdateÚ hexdigest)rirjÚhashÚblockrf)rjrirgÚ_rolling_checksumŒsrvc s: eZdZdZ�dedeeefedeeefeddœdd„Z e edœd d „ƒZ e e dœd d „ƒZ e ee dœd d„ƒZejeeee fddœdd„ƒZe eedœdd„ƒZejeeddœdd„ƒZddœdd„Zeeeeeeeddœdd„Z�dedeefedeefeeefdœdd„Ze edœdd„ƒZejeeefddœdd„ƒZe ed œd!d"„Z!ee"efe d#œd$d%„Z#ee"efe e d&œd'd(„Z$ffe%e"eee%d)œd*d+„Z&�dedd-œd.d/„Z'e(dœd0d1„Z)ffe%eee%d2œd3d4„Z*d5ffe%e"eee%d)œd6d7„Z+ede"e,efee"d#œd8d9„Z-�dee.ee.e%d:œd;d<„Z/�deee.e0j1feee.e0j1fe"e%d=œd>d?„Z2e ede3e4e5fdœ‡fd@dA„ ƒZ6e6jedee3e%fddBœdCdA„ƒZ6eddDœdEdF„Z7eeeefddGœdHdI„Z8�deee9e%gdfddJœdKdL„Z:�de e ee.ddNœdOdP„Z;ee>d,fee%e?e%dfeeefe`. Args: clone_from: identical to fileobj (for compatibility) incremental: If true, loads the document and set the PdfWriter in incremental mode. When writing incrementally, the original document is written first and new/modified content is appended. To be used for signed document/forms to keep signature valid. ÚNF)ÚfileobjÚ clone_fromÚ incrementalrkcCsD||_g|_g|_i|_i|_d|_||jr–t|ttfƒr`t |dƒ�}t |j dƒƒ}WdQRXt|t ƒrtt |ƒ}nt dƒ‚||_|jjƒ|_d|_n"d|_|jttdƒtdƒiƒƒ|_tdt ttttt ftdt ttttt ftdt ttttt fdœd d „}|||ƒ}||_d |_d |_tƒ}|jttj ƒtd ƒttj!ƒt"dƒttj#ƒt$ƒiƒg|_%d|_&d|_'|dk �r–t|t ƒ�sŠt |ƒ}|j(|ƒnH|j|ƒ|_)tƒ|_*|j*jttj ƒtt+j,ƒtt+j-ƒ|j)iƒ|j|j*ƒt|jt.ƒ�r@t|jdt/ƒ�rt0|jdj1ƒƒ|jd<t|jdt/ƒ�r@t0|jdj1ƒƒ|jd<dS)NÚrbrz!Invalid type for incremental modeTs%PDF-1.3z /ProducerZpypdf)ryrzrkcSs¬t|ttttfƒ s$|dkr¨|dkr¨d}t|ttfƒ p\tt|ƒƒjƒo\tt|ƒƒjƒjdksbd}t|ttfƒr |jƒ}|j ddƒ|jƒdkr”d}|j |dƒ|r¨|}|S)NrxTrFrééÿÿÿÿ) Ú isinstanceÚstrrrrÚexistsÚstatÚst_sizeÚtellÚseek)ryrzZcloningÚtrfrfrgÚ_get_clone_fromÛs    z+PdfWriter.__init__.._get_clone_fromrxFz/Pagesrr~)2r{Ú_objectsÚ_original_hashÚ _idnum_hashÚ_id_translatedÚ_IDrr€rÚopenrrlrr5Ú_readerÚ pdf_headerÚencodeÚ_headerZ _readonlyÚ _add_objectr=rArJÚ _info_objrrr Ú temp_fileobjryÚ with_as_usagerrÚPAÚTYPEÚCOUNTrCÚKIDSr7Úflattened_pagesÚ _encryptionÚ_encrypt_entryÚclone_document_from_readerÚ_pagesÚ _root_objectÚCOZCATALOGZPAGESÚlistrGr9Zget_original_bytes)Úselfryrzr{Úfr‡ÚpagesrfrfrgÚ__init__£sf    "      zPdfWriter.__init__)rkcCsdS)zè Read-only boolean property showing whether this PDF file is encrypted. Note that this property, if true, will remain true even after the :meth:`decrypt()` method is called. Frf)r¢rfrfrgÚ is_encryptedszPdfWriter.is_encryptedcCs|jS)zv Provide direct access to PDF Structure. Note: Recommended only for read access. )rŸ)r¢rfrfrgÚ root_object'szPdfWriter.root_objectcCs|jdkrdStt|jjƒƒS)zš Provide access to "/Info". Standardized with PdfReader. Returns: /Info Dictionary; None if the entry does not exist N)r“rr=Ú get_object)r¢rfrfrgÚ_info1s zPdfWriter._info)Úvaluerkc CsŠ|dkrByd|j|jjjd<Wnttfk r8YnXd|_nD|jdkrZ|jtƒƒ|_tt|jj ƒƒ}|j ƒ|j tt|j ƒƒƒdS)Nr) rˆr“Úindirect_referenceÚidnumÚKeyErrorÚAttributeErrorr’r=rr¨Úclearrr)r¢rªÚobjrfrfrgr©?s cCstt|jjƒS)z(XMP (Extensible Metadata Platform) data.)rrUr§Ú xmp_metadata)r¢rfrfrgr±NszPdfWriter.xmp_metadatacCs2|dkrd|jkr*|jd=n||jtdƒ<|jjS)z(XMP (Extensible Metadata Platform) data.Nz /Metadata)r§rAr±)r¢rªrfrfrgr±Ss   cCs|j}|jƒd|_||_|S)z+Store that writer is initialized by 'with'.T)r”r¥r•ry)r¢r†rfrfrgÚ __enter__^s zPdfWriter.__enter__)Úexc_typeÚexcÚ tracebackrkcCs|jr|j|jƒdS)zWrite data to the fileobj.N)ryÚwrite)r¢r³r´rµrfrfrgÚ__exit__fszPdfWriter.__exit__)ÚincludeÚexcluderkcsXtƒ}|j|ƒd|i}ˆdk r6‡fdd„|jƒDƒ}ˆdk rT‡fdd„|jƒDƒ}|S)zâ Integration into Jupyter Notebooks. This method returns a dictionary that maps a mime-type to its representation. See https://ipython.readthedocs.io/en/stable/config/integrating.html zapplication/pdfNcsi|]\}}|ˆkr||“qSrfrf)Ú.0ÚkÚv)r¸rfrgú …sz/PdfWriter._repr_mimebundle_..csi|]\}}|ˆkr||“qSrfrf)rºr»r¼)r¹rfrgr½‰s)rr¶Úitems)r¢r¸r¹Zpdf_dataÚdatarf)r¹r¸rgÚ_repr_mimebundle_ps  zPdfWriter._repr_mimebundle_cCs |jjƒS)aL Read/Write property of the PDF header that is written. This should be something like ``'%PDF-1.5'``. It is recommended to set the lowest version that supports all features which are used within the PDF file. Note: `pdf_header` returns a string but accepts bytes or str for writing )r‘Údecode)r¢rfrfrgr��s zPdfWriter.pdf_header)Ú new_headerrkcCst|tƒr|jƒ}||_dS)N)rr€r�r‘)r¢rÂrfrfrgr�šs )r°rkcCs„t|ddƒdk r"|jj|kr"|jSt|tƒr^t|jtjdƒttfƒr^|j |tjƒ|t tjƒ<|j j |ƒt t|j ƒd|ƒ|_|jS)Nr«r)Úgetattrr«Úpdfrr=ÚgetÚPGZCONTENTSr7r’rArˆÚappendr@Úlen)r¢r°rfrfrgr’ s   zPdfWriter._add_object)r«rkcCsNt|tƒr|j|d}n$|j|kr.tdƒ‚n|j|jd}|dk sJt‚|S)Nrzpdf must be self)rÚintrˆrÄÚ ValueErrorr¬ÚAssertionError)r¢r«r°rfrfrgr¨¯s    zPdfWriter.get_object)r«r°rkcCsˆt|tƒr"|j|krtdƒ‚|j}|j|djj}t|ddƒdk rZ|jj|krZ|j |ƒ}||j|d<t|||ƒ|_t|t ƒs„t ‚|S)Nzpdf must be selfrr«) rr@rÄrÊr¬rˆr«Z generationrÃÚclonerDrË)r¢r«r°ÚgenrfrfrgÚ_replace_object¼s    zPdfWriter._replace_object)ÚpageÚindexÚ excluded_keysrkc Cs¦t|tƒ s |jtjdƒtjkr(tdƒ‚|jdk s:t dƒ‚|}t |ƒ}|tj dg7}y|j t |jjƒ|jj=Wntk r„YnXtd|j|d|ƒjƒƒ}|jdk r¾|jj}t|j|ƒ|_|j|ƒ\}}|j|ttj ƒ<|dk�rtt|tjƒj||jƒ|jj||ƒn$tt|tjƒj|jƒ|jj|ƒd}xht|ƒ�s tt|jƒƒ}ttt |tj!ƒdƒ|ttj!ƒ<|jtj dƒ}|d8}|dk�r:t"d ƒ‚�q:W|S) NzInvalid page objectzfor mypyz/StructParentsrFrièrzToo many recursive calls!)#rrrÅr–r—r ZPAGErÊršrËr¡ÚPARENTr‹Úidr«rÄr¬Ú ExceptionrrÌr¨r�r"Z_get_page_in_noderAr7r™ÚinsertrÇrLr=rCrÉr˜r5) r¢rÏrÐrÑZpage_orgÚotherÚnodeÚidxZcptrfrfrgÚ _add_pageÑs@      " zPdfWriter._add_pageT)ÚstaterkcCsŠyLtj|jkr&|jtƒƒ|jttjƒ<ttjƒ}t|ƒt t|jtjƒ|<Wn8t k r„}zt d|›d|›�t ƒWYdd}~XnXdS)a‰ Sets the "NeedAppearances" flag in the PDF writer. The "NeedAppearances" flag indicates whether the appearance dictionary for form fields should be automatically generated by the PDF viewer or if the embedded appearance should be used. Args: state: The actual value of the NeedAppearances flag. Returns: None zset_need_appearances_writer(z ) catch : N) r(Ú ACRO_FORMrŸr’r=rAr,ZNeedAppearancesr8rrÔr%rX)r¢rÚZneed_appearancesr´rfrfrgÚset_need_appearances_writers  z%PdfWriter.set_need_appearances_writercCs tƒ}|j|ƒ|jttjƒ<|S)N)rIr’rŸrAr(ZVIEWER_PREFERENCES)r¢ÚorfrfrgÚcreate_viewer_preferences sz#PdfWriter.create_viewer_preferences)rÏrÑrkcCs&|jdk stdƒ‚|j|t|jƒ|ƒS)aÅ Add a page to this PDF file. Recommended for advanced usage including the adequate excluded_keys. The page is usually acquired from a :class:`PdfReader` instance. Args: page: The page to add to the document. Should be an instance of :class:`PageObject` excluded_keys: Returns: The added PageObject. NÚmypy)ršrËrÙrÈ)r¢rÏrÑrfrfrgÚadd_page'szPdfWriter.add_pagercCsd|jdk stdƒ‚|dkr(t|jƒ|}|dkr8tdƒ‚|t|jƒkrR|j||ƒS|j|||ƒSdS)a\ Insert a page in this PDF file. The page is usually acquired from a :class:`PdfReader` instance. Args: page: The page to add to the document. index: Position at which the page will be inserted. excluded_keys: Returns: The added PageObject. NrßrzInvalid index value)ršrËrÈrÊràrÙ)r¢rÏrÐrÑrfrfrgÚ insert_page?s zPdfWriter.insert_pagecCsNt|ƒr dS|dk stdƒ‚t|tƒr2t|d|ƒ}|jƒ}t|tƒrJ|jSdS)z� Generate _page_id2num. Args: indirect_reference: Returns: The page number or None Nrßr)rLrËrrÉr@r¨rÚ page_number)r¢r«r°rfrfrgÚ_get_page_number_by_indirect[s    z&PdfWriter._get_page_number_by_indirect)ÚwidthÚheightrkcCstj|||ƒ}|j|ƒS)a' Append a blank page to this PDF file and return it. If no page size is specified, use the size of the last page. Args: width: The width of the new page expressed in default user space units. height: The height of the new page expressed in default user space units. Returns: The newly appended page. Raises: PageSizeNotDefinedError: if width and height are not defined and previous page does not exist. )rÚcreate_blank_pagerà)r¢rärårÏrfrfrgÚadd_blank_pagerszPdfWriter.add_blank_page)rärårÐrkcCsX|dks |dkr:|jƒd|kr:|j|}|jj}|jj}tj|||ƒ}|j||ƒ|S)aT Insert a blank page to this PDF file and return it. If no page size is specified, use the size of the last page. Args: width: The width of the new page expressed in default user space units. height: The height of the new page expressed in default user space units. index: Position to add the page. Returns: The newly inserted page. Raises: PageSizeNotDefinedError: if width and height are not defined and previous page does not exist. Nr)Z get_num_pagesr¤Zmediaboxrärårrærá)r¢rärårÐZoldpagerÏrfrfrgÚinsert_blank_pageŠs   zPdfWriter.insert_blank_pagecstƒjS)N)ÚsuperÚopen_destination)r¢)Ú __class__rfrgrê«szPdfWriter.open_destination)Údestrkc Csž|dkr,y |jd=Wqštk r(YqšXnnt|tƒrJt|ƒ|jtdƒ<nPt|tƒrf|j|jtdƒ<n4t|tƒrštd|j dk r„|j nt ƒt ƒj|jtdƒ<dS)Nz /OpenActionZOpening) rŸr­rr€rGrAr<Ú dest_arrayrr«rBr6)r¢rìrfrfrgrê±s    )Ú javascriptrkcCsÊd|jkrtƒ|jttjƒ<tt|jtjƒ}d|krPttdƒtƒiƒ|tdƒ<tttt|dƒdƒ}tƒ}|jttj ƒtdƒtdƒtdƒtdƒt |›ƒiƒ|j t t tjƒƒƒƒ|j |j|ƒƒdS)a$ Add JavaScript which will launch upon opening this PDF. Args: javascript: Your Javascript. >>> output.add_js("this.print({bUI:true,bSilent:false,bShrinkToFit:true});") # Example: This will launch the print window when the PDF is opened. z/Namesz /JavaScriptz/Actionz/Sz/JSN)rŸr=rAÚCAÚNAMESrr7rrr–r—rGrÇrJr€ÚuuidÚuuid4r’)r¢rîÚnamesZjs_listZjsrfrfrgÚadd_jsÅs  zPdfWriter.add_js)Úfilenamer¿rkcCs@t|tƒr|jdƒ}tƒ}|j|ƒ|jttjƒtdƒiƒt ƒ}|jtdƒ|j |ƒiƒt ƒ}|jttjƒtdƒtt j ƒt |ƒtt jƒ|iƒtj|jkr´|j t ƒƒ|jttjƒ<dtt |jtjƒk�rt ttjƒtƒiƒ}|j |ƒtt |jtjƒtdƒ<ntt tt |jtjƒdƒ}tt|tjƒjt |ƒ|gƒdS)a Embed a file inside the PDF. Reference: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf Section 7.11.3 Args: filename: The filename to display. data: The data in the file. zlatin-1z /EmbeddedFilez/Fz /Filespecz/EmbeddedFilesN)rr€r�r;Úset_datarrrAr–r—r=r’r)ÚFrJZEFrïrðrŸrr7Úextend)r¢rõr¿Z file_entryZef_entryZfilespecZembedded_files_names_dictionaryrfrfrgÚadd_attachmentès2      "zPdfWriter.add_attachment)ÚreaderÚafter_page_appendrkcCsDt|jƒ}x4t|ƒD](}|j|}|j|ƒ}t|ƒr||ƒqWdS)aø Copy pages from reader to writer. Includes an optional callback parameter which is invoked after pages are appended to the writer. ``append`` should be preferred. Args: reader: a PdfReader object from which to copy page annotations to this writer object. The writer's annots will then be updated. after_page_append: Callback function that is invoked after each page is appended to the writer. Signature includes a reference to the appended page (delegates to append_pages_from_reader). The single parameter of the callback is a reference to the page just appended to the document. N)rÈr¤ÚrangeràÚcallable)r¢rúrûZreader_num_pagesZreader_page_numberZ reader_pageZ writer_pagerfrfrgÚappend_pages_from_readerBs    z"PdfWriter.append_pages_from_readerr)ÚfieldÚannoÚ font_nameÚ font_sizerkcsètt|tjƒ}tddt|d|dƒt|d|dƒfƒ}|jtjtt|jt j ƒj tjdƒƒ}|dkrxt dƒ}n|j ƒ}|jddƒjddƒjdƒ}d d „|Dƒ}|rÀ|||jd ƒd<n||jd ƒd}|dkrÞ|nt||jd ƒdƒ} | dk�r&|j tjdƒtjj@�rt} n |jd} t| ƒ||jd ƒd<dj|ƒ}|jd| } tttt|jd tt|jt j ƒj d tƒƒƒƒj ƒƒ} | j d tƒƒj ƒ} || k�rì|tk�rìttttftt|jt j ƒj d iƒƒ} | j ƒj d tƒƒj ƒ} | j |dƒ} t| ƒ�s¶tt| j ƒƒ} td| ƒ\} }‰}y |d;=Wntk �rBYnXt ˆtƒ�rh‡fdd„|j!ƒDƒ‰nLdd„ˆj!ƒDƒ‰dd„ˆj!ƒDƒ}x>|j!ƒD]\}}|j ||ƒˆ|<�q–Wnt"d|›d�t#ƒi‰|j tjdƒ}|j tj$dƒdk�r4|tjj%@dk�r4dj|jtj&gƒƒ}|j dgƒ}t |t'ƒ�sD|g}n|j ddƒ}g}|jddƒjddƒjddƒ}d|j(d›d|jd›d |›d�j)ƒ}�xt*|jddƒjdƒƒD]ê\}}||k�rô|d!| || d"d›d|j(d›d| d›d#|›d� j)ƒ7}|dk�r|d$| ›d%�j)ƒ7}n|d&| d"›d%�j)ƒ7}‡fd'd „|Dƒ}t+d(d)„|Dƒƒ�rt|d*d+j|ƒj,ƒj)ƒd,7}n|d-d+j|ƒd.7}�q¢W|d/7}t-j.t/d0ƒt/d1ƒt/d2ƒt/d3ƒt/d4ƒ|d5t0|ƒd6diƒ}tj1|k�rxysz6PdfWriter._update_field_annotation..ZTfz/DRz/FontéÈcsi|]\}}|jˆƒ|“qSrf)r�)rºr»r¼)Ú font_encodingrfrgr½°sz6PdfWriter._update_field_annotation..cSsi|]\}}t|fƒ|“qSrf)Úbytes)rºr»r¼rfrfrgr½´scSsi|]\}}t|fƒ|“qSrf)r )rºr»r¼rfrfrgr½µszFont dictionary for z not found.z/Txz/Chz/Vrxú\z\\ú(z\(ú)z\)zq /Tx BMC q 1 1 z re W BT z1 gffffffö?z re 0.5 0.5 0.5 rg s z2 z Td z0 csg|]}ˆj||jdƒƒ‘qS)z utf-16-be)rÅr�)rºÚc)Ú font_full_revrfrgr×scss|]}t|ƒdkVqdS)r}N)rÈ)rºrrfrfrgú Ùsz5PdfWriter._update_field_annotation..ó Tj ó(s) Tj s ET Q EMC Q ú/Typez/XObjectú/Subtypez/Formú/BBoxÚ__streamdata__ú/Lengthz/Nú/Filterr«z /Resourcesr~>rrrrr)8rrEÚAAÚRectÚabsZ get_inheritedZDAr=r§r(rÛrÅrGr¨ÚreplaceÚsplitrÐÚfloatÚFAÚFfÚFfBitsZ MultilineÚ DEFAULT_FONT_HEIGHT_IN_MULTILINErår€Újoinrr r rLrr­rr¾r%rXÚFTZComboZOptr¡rär�Ú enumerateÚanyÚhexr;Úinitialize_from_dictionaryrAr9ÚAPrÃr’r«r¬rˆr@)r¢rÿrrrZ_rctZrctÚdaZfont_propertiesZ font_heightZy_offsetZdrZfont_resZ font_subtypeÚ_Zfont_mapZfont_encoding_revÚkkr¼Z field_flagsÚtxtÚselZ ap_streamÚ line_numberÚlineZenc_lineÚdctr»Únrf)r rrgÚ_update_field_annotationbsÎ0             &   (" >      &    $z"PdfWriter._update_field_annotation)rÏÚfieldsÚflagsÚauto_regeneraterkc Cs´tj|jkrtdƒ‚tt|jtjƒ}tj|kr8tdƒ‚t|t ƒrL|j |ƒ|dkr^t |j ƒ}t|t ƒr”x&|D]}t j|krn|j|||dƒqnWdSt j|kr¬tdtƒdS�x|t jD�]ð}tt|jƒƒ}|jddƒdkràqºd|kröd |krö|}n|jt jtƒƒjƒ}�xž|jƒD�]�\} } |j|ƒ| k�p>|jd dƒ| k�sF�q|jddƒd k�rhd |k�rh|d =|�r€t|ƒ|ttjƒ<t| t ƒ�r®td d „| Dƒƒ} | |ttjƒ<n6t| tƒ�rÒt| dƒ|ttjƒ<nt| ƒ|ttjƒ<|jtjƒdk�r2t| ƒ} | |tt j!ƒtdƒk�r"tdƒ} | |tt j"ƒ<nt|jtjƒdk�sV|jtjƒd k�rŠt| tƒ�r||j#||| d| dƒn |j#||ƒn|jtjƒdk�rtdtƒ�qWqºWdS)a Update the form field values for a given page from a fields dictionary. Copy field texts and values from fields to page. If the field links to a parent object, add the information to the parent. Args: page: `PageObject` - references **PDF writer's page** where the annotations and field data will be updated. `List[Pageobject]` - provides list of pages to be processed. `None` - all pages. fields: a Python dictionary of: * field names (/T) as keys and text values (/V) as value * field names (/T) as keys and list of text values (/V) for multiple choice list * field names (/T) as keys and tuple of: * text values (/V) * font id (e.g. /F1, the font id must exist) * font size (0 for autosize) flags: A set of flags from :class:`~pypdf.constants.FieldDictionaryAttributes.FfBits`. auto_regenerate: Set/unset the need_appearances flag; the flag is unchanged if auto_regenerate is None. z+No /AcroForm dictionary in PdfWriter Objectz0No /Fields dictionary in Pdf in PdfWriter ObjectNz No fields to update on this pagez/Subtyperxz/Widgetz/FTz/Tz/Chz/Icss|]}t|ƒVqdS)N)rG)rºr¼rfrfrgrUsz:PdfWriter.update_page_form_field_values..rz/Btnz/Nz/Offz/Txrr}z/Sigz#Signature forms not implemented yet)$r(rÛrŸr5rr=r,ÚFieldsrÚboolrÜr¡r¤rÆÚANNOTSÚupdate_page_form_field_valuesr%rXr¨rÅrÒr¾Z_get_qualified_field_namerCrAr r!r7ÚVÚtuplerGr%rr*ZASr4) r¢rÏr5r6r7ÚafÚpZ writer_annotZwriter_parent_annotrÿrªÚlstr¼rfrfrgr; sl              z'PdfWriter.update_page_form_field_values)rÏrkc Cs^g}|dkr.x|jD]}||j|ƒ7}qW|Sytt|jtjƒ}Wn*tk rntƒ}||jttjƒ<YnXytt |t j ƒ}Wn(tk r¬t ƒ}||tt j ƒ<YnXd|krº|Stt |dƒ}x�t t |ƒƒD]€}||}t|tƒ} tt|jƒƒ}|jddƒdkrÖd|krÖd|jk�r,|j|k�r,qÖ| �s@|j|ƒ||<|j|jƒ|j|ƒqÖW|S)a0 Parse annotations within the page looking for orphan fields and reattach then into the Fields Structure. Args: page: page to analyze. If none is provided, all pages will be analyzed. Returns: list of reattached fields. Nz/Annotsz/Subtyperxz/Widgetz/FTr«)r¤Úreattach_fieldsrr=rŸr(rÛr­rAr7r,r8rürÈrr@r¨rÅÚ__dict__r«r’rÇ) r¢rÏr@r?r>r5ÚannotsrØÚanoZindirectrfrfrgrAus>     zPdfWriter.reattach_fields)rúrkcCs|jr dgtt|jdƒ|_n |jjƒd|_|jj|ƒ|_ |j j dƒ|_ t |jƒtt|jdƒksjt ‚|jr‚dd„|jDƒ|_|jƒ|jdk s˜t ‚x8|jD].}|jtt|jƒj|ƒ|js |j |tdƒ<q W|j�stdd„|jDƒƒtt|j jƒƒtdƒ<dS) a Copy the reader document root to the writer and all sub-elements, including pages, threads, outlines,... For partial insertion, ``append`` should be considered. Args: reader: PdfReader from which the document root should be copied. Nz/Sizez/PagescSs g|]}|dk r|jƒnd‘qS)Nr)Úhash_bin)rºr°rfrfrgr¼sz8PdfWriter.clone_reader_document_root..z/ParentcSsg|] }|j‘qSrf)r«)rºr?rfrfrgrÇsz/Kids)r{rrÉÚtrailerrˆr¯r“r§rÌrŸZraw_getržrÈrËr‰Ú_flattenršrÎr@r«r¬rAr7r=r¨)r¢rúr?rfrfrgÚclone_reader_document_root§s"   z$PdfWriter.clone_reader_document_rootc Csî|j|ƒ|j}|jrb|dk r„tt|j|ƒjƒ|_t|jt ƒsFt dƒ‚|jj ƒ|j |jjj d<n"|dk r„|jt tt |jƒƒƒƒ|_ytt|jƒj|ƒ|_Wntk r°YnXt|ƒrêx.tttt |jjƒƒdƒD]}||jƒƒqÖWdS)az Create a copy (clone) of a document from a PDF file reader cloning section '/Root' and '/Info' and '/ID' of the pdf. Args: reader: PDF file reader instance from which the clone should be created. after_page_append: Callback function that is invoked after each page is appended to the writer. Signature includes a reference to the appended page (delegates to append_pages_from_reader). The single parameter of the callback is a reference to the page just appended to the document. Nzfor mypyrz/Kids)rHr©r{rr@rÌr«r“rr=rËrEr‰r¬r’r¨r7rŒr®rýrž)r¢rúrûÚinfrÏrfrfrgr�És& z$PdfWriter.clone_document_from_readercCs,tƒ}|j|ƒ|jdƒtt|ƒjdƒƒS)NrÚutf8)rÚ_write_pdf_structurer…r9rvr�)r¢rirfrfrgÚ_compute_document_identifierøs  z&PdfWriter._compute_document_identifiercCs8|jr|jd}|jƒ}n |jƒ}|}t||fƒ|_dS)a  Generate an identifier for the PDF that will be written. The only point of this is ensuring uniqueness. Reproducibility is not required. When a file is first written, both identifiers shall be set to the same value. If both identifiers match when a file reference is resolved, it is very likely that the correct and unchanged file has been found. If only the first identifier matches, a different version of the correct file has been found. see 14.4 "File Identifiers". rN)rŒrLr7)r¢Zid1Zid2rfrfrgÚgenerate_file_identifiersþs   z#PdfWriter.generate_file_identifiers)Ú algorithm)Ú user_passwordÚowner_passwordÚ use_128bitÚpermissions_flagrNrkc Csà|dkr |}|dk rRytt|jddƒƒ}Wqbtk rNtd|›d�ƒ‚YqbXntj}|sbtj}|jƒ|jstt ‚t j |||jdƒ|_ |j j ||ƒ}|jrÌ|jjdk s®t ‚|jj|_||j|jjd<n |j|ƒ||_dS)aâ Encrypt this PDF file with the PDF Standard encryption handler. Args: user_password: The password which allows for opening and reading the PDF file with the restrictions provided. owner_password: The password which allows for opening the PDF files without any restrictions. By default, the owner password is the same as the user password. use_128bit: flag as to whether to use 128bit encryption. When false, 40bit encryption will be used. By default, this flag is on. permissions_flag: permissions as described in Table 3.20 of the PDF 1.7 specification. A bit value of 1 means the permission is granted. Hence an integer value of -1 will set all flags. Bit position 3 is for printing, 4 is for modifying content, 5 and 6 control annotations, 9 for form fields, 10 for extraction of text and graphics. algorithm: encrypt algorithm. Values may be one of "RC4-40", "RC4-128", "AES-128", "AES-256-R5", "AES-256". If it is valid, `use_128bit` will be ignored. Nú-r,z algorithm 'z' NOT supportedrr)rÃrrr®rÊZRC4_128ZRC4_40rMrŒrËrÚmaker›Z write_entryrœr«rˆr¬r’)r¢rOrPrQrRrNZalgÚentryrfrfrgÚencrypts(    zPdfWriter.encrypt)rirkcCs˜t|dƒr(d|jkr(td|j›d�tƒ|jrl|jjjdƒ|j |jjj dƒƒt |j ƒƒdkr”|j |ƒn(|j|ƒ\}}|j|||ƒ}|j||ƒdS)NÚmodeÚbzFile to write to is not in binary mode. It may not be written to correctly.rrr~)ÚhasattrrWr%ÚnamerXr{rŽrir…r¶rlrÈÚlist_objects_in_incrementÚ_write_incrementrKÚ_write_xref_tableÚ_write_trailer)r¢riÚobject_positionsÚ free_objectsÚ xref_locationrfrfrgÚ write_streamLs   zPdfWriter.write_streamcCs^d}|dkrtd|›d�ƒ‚t|ttfƒr>t|dƒ}d|_d}|j|ƒ|jrV|jƒ||fS)a­ Write the collection of pages added to this object out as a PDF file. Args: stream: An object to write the file to. The object can support the write method and the tell method, similar to a file object, or be a file path, just like the fileobj, just named it stream to keep existing workflow. Returns: A tuple (bool, IO). FrxzOutput(stream=z ) is empty.ÚwbT)rÊrr€rrr•rbÚclose)r¢riZmy_filerfrfrgr¶ds   zPdfWriter.writecs‡fdd„ttˆjƒƒDƒS)a For debugging/analysis. Provides the list of new/modified objects that will be written in the increment. Deleted objects will not be freed but will become orphans. Returns: List of (new / modified) IndirectObjects csXg|]P}ˆj|dk r|tˆjƒksBttˆj|ƒjƒˆj|krttˆj|ƒj‘qS)N)rˆrÈr‰rrDrEr@r«)rºÚi)r¢rfrgr�s z7PdfWriter.list_objects_in_increment..)rürÈrˆ)r¢rf)r¢rgr[‚s z#PdfWriter.list_objects_in_incrementc Csni}g}d}d}xÈt|jƒD]º\}}|j|dk r|t|jƒks^tt|j|ƒjƒ|j|kr|d}t|tƒstt‚|j ƒ||<|j |›d�j ƒƒ|j |ƒ|j dƒ||krÎ|dkrÊ|j |||gƒ|}|d}qW|dksêtdƒ‚|j |||gƒ|j ƒ} t|jƒd} |j | ›d�j ƒƒtdƒtd ƒtd ƒt| dƒtd ƒ|jjtd ƒtd ƒtdƒtdd„|Dƒƒtdƒttdƒtdƒtdƒgƒddi} |jdk �rô|jjjdt|jƒk�sâtt|jƒjƒ|j|jjjdk�rô|jj| ttjƒ<t|jjƒ| ttjƒ<|j�r"|j| ttjƒ<tj| ƒ} | jdj dd„|j!ƒDƒƒƒ| j |ƒ|j d| ›d�j ƒƒdS)Nrr}z 0 obj s endobj rzfor pytest onlyz 0 objz/Typez/XRefz/Sizez/Rootz/Filterz /FlateDecodez/IndexcSsg|]}|D] }t|ƒ‘q qSrf)rC)rºZ_suZ_itrfrfrgrÄsz.PdfWriter._write_increment..z/WérrncSsg|]}tjdd|dƒ‘qS)s>BIBrr)ÚstructÚpack)rºÚ_posrfrfrgrÚsz startxref z %%EOF r~éþÿÿÿ)"r&rˆrÈr‰rrDrErrËr„r¶r�Úwrite_to_streamrÇrArCr§r«r7r©r¬r@ÚTKÚINFOrŽZ _startxrefZPREVrŒÚIDrFr)rör$Úvalues) r¢rir_Z object_blocksZ current_startZ current_stoprer°r¬raZxr_idZ init_dataZxrrfrfrgr\™sf            zPdfWriter._write_incrementcCsÐg}g}|j|jjƒdƒ|jdƒx–t|jƒD]ˆ\}}|dk r¢|d}|j|jƒƒ|j|›d�jƒƒ|jrŒ||jkrŒ|jj ||dƒ}|j |ƒ|jdƒq2|jdƒ|j|dƒq2W|jdƒ||fS)Nó s%âãÏÓ rz 0 obj rs endobj r~) r¶r�r�r&rˆrÇr„r›rœZencrypt_objectrk)r¢rir_r`rer°r¬rfrfrgrKàs"     zPdfWriter._write_pdf_structure)rir_r`rkcCs¼|jƒ}|jdƒ|jdt|jƒd›d�jƒƒ|j|dd›ddd ›d �jƒƒd}x^|D]V}|dkrŠ|j|d›ddd ›d �jƒƒq^|j||d›ddd ›d �jƒƒ|d7}q^W|S) Nsxref z0 rrrz0>10riÿÿz0>5z f z n )r„r¶rÈrˆr�)r¢rir_r`raZfree_idxÚoffsetrfrfrgr]õs  "  " zPdfWriter._write_xref_table)rirarkcCsª|jdƒtttjƒtt|jƒdƒttjƒ|j j iƒ}|j dk rT|j j |ttj ƒ<|j dk rn|j |ttjƒ<|jr†|jj |ttjƒ<|j|ƒ|jd|›d�jƒƒdS)zó Write the PDF trailer to the stream. To quote the PDF specification: [The] trailer [gives] the location of the cross-reference table and of certain special objects within the body of the file. strailer rNz startxref z %%EOF )r¶r=rArlZSIZErCrÈrˆÚROOTr§r«r©rmrŒrnrœZENCRYPTrkr�)r¢rirarFrfrfrgr^s    zPdfWriter._write_trailercstƒjS)aŠ Retrieve/set the PDF file's document information dictionary, if it exists. Args: value: dict with the entries to be set. if None : remove the /Info entry from the pdf. Note that some PDF files use (xmp)metadata streams instead of document information dictionaries, and these metadata streams will not be accessed by this function. )réÚmetadata)r¢)rërfrgrss zPdfWriter.metadatacCs<|dkrd|_n(|jdk r&|jjƒntƒ|_|j|ƒdS)N)r©r¯r=Ú add_metadata)r¢rªrfrfrgrs+s   )ÚinfosrkcCs|i}t|tƒrtt|jƒƒ}x>t|jƒƒD].\}}t|tƒrD|jƒ}tt|ƒƒ|t |ƒ<q*Wt|j tƒslt ‚|j j |ƒdS)z¹ Add custom metadata to the output. Args: infos: a Python dictionary where each key is a field and each value is your new metadata. N) rrDrr=r¨r¡r¾rJr€rAr©rËrr)r¢ruÚargsÚkeyrªrfrfrgrt9s  zPdfWriter.add_metadata)Úremove_identicalsÚremove_orphansrkc s¤ttttfddœ‡‡fdd„ ‰i|_dgt|jƒ‰xxt|jƒD]j\}}|dkrTqBt|jtƒsdt ‚|j ƒ}|rœ||jkrœ|j|dj |jƒd|j|<qB|jgf|j|<qBWdd„|jj ƒDƒ}i}x.|j ƒD]"\}} |jt| |ft| ƒƒƒqÒWx*|jD] }t|ttfƒ�rˆ||ƒ�qWd ˆ|jjjd<d ˆ|jjjd<yd ˆ|jjjd<Wntk �rtYnXx(ttt|jƒƒˆƒD]} d|j| <�qŒWdS) a@ Parse the PDF file and merge objects that have same hash. This will make objects common to multiple pages. Recommended to be used just before writing output. Args: remove_identicals: Remove identical objects. remove_orphans: Remove unreferenced objects. N)r°ÚcrossrefrkcsŒt|tƒr|jƒ}nt|tƒr(t|ƒ}ndSt|ttfƒs>t‚xH|D]@\}}t|tƒrzdˆ|jd<||kr„||||<qDˆ||ƒqDWdS)NFr)rr=r¾r7r&rËr@r¬)r°rzZkey_valr»r¼)ÚorphansÚreplace_in_objrfrgr|Zs     z.replace_in_objTrcSs*i|]"}t|dƒdkr|d|d“qS)rr)rÈ)rºr¼rfrfrgr½~sz8PdfWriter.compress_identical_objects..F)rDr r@rŠrÈrˆr&rr«rËZ hash_valuerÇror¾rrÚzipr=r7r§r¬r©rŒr®rrü) r¢rxryrØr°ÚhZcnvZcnv_revr»r¼rerf)r{r|rgÚcompress_identical_objectsKs8   z$PdfWriter.compress_identical_objects)ÚrootrkcCs tdƒdS)aü Resolving any circular references to Page objects. Circular references to Page objects can arise when objects such as annotations refer to their associated page. If these references are not properly handled, the PDF file will contain multiple copies of the same Page object. To address this problem, Page objects store their original object reference number. This method adds the reference number of any circularly referenced Page objects to an external reference map. This ensures that self-referencing trees reference the correct new object location, rather than copying in a new copy of the Page object. Args: root: The root of the PDF object tree to sweep. zb_sweep_indirect_references has been removed, please report to dev team if this warning is observedN)r#)r¢r€rfrfrgÚ_sweep_indirect_references”sz$PdfWriter._sweep_indirect_references)r¿rkcCstdƒtdd|ƒS)aÀ Resolves an indirect object to an indirect object in this PDF file. If the input indirect object already belongs to this PDF file, it is returned directly. Otherwise, the object is retrieved from the input object's PDF file using the object's ID number and generation number. If the object cannot be found, a warning is logged and a `NullObject` is returned. If the object is not already in this PDF file, it is added to the file's list of objects and assigned a new ID number and generation number of 0. The hash value of the object is then added to the `_idnum_hash` dictionary, with the corresponding `IndirectObject` reference as the value. Args: data: The `IndirectObject` to resolve. Returns: The resolved `IndirectObject` in this PDF file. Raises: ValueError: If the input stream is closed. z`_resolve_indirect_object has been removed, please report to dev team if this warning is observedr)r#r@)r¢r¿rfrfrgÚ_resolve_indirect_object¶sz"PdfWriter._resolve_indirect_objectcCs0|jj|ƒd}t|d|ƒ}|jƒ|ks,t‚|S)Nrr)rˆrÐr@r¨rË)r¢r°r¬ÚrefrfrfrgÚ get_referenceÖs zPdfWriter.get_referencecCs tj|jkrrtt|jtjƒ}t|tƒsDt|ƒ}|j|jj|ƒ|}|j j |ƒd}t |d|ƒ}|j ƒ|ksœt ‚n*tƒ}|jiƒ|j|ƒ}||jttjƒ<|S)Nrr)r ÚOUTLINESrŸrrHrrÎr«r¬rˆrÐr@r¨rËrrr’rA)r¢Úoutliner†r¬Z outline_refrfrfrgÚget_outline_rootÜs     zPdfWriter.get_outline_rootcCs:tj|jkr tt|jtjƒ}ntƒ}||jttjƒ<|S)uÜ The list of threads. See §12.4.3 of the PDF 1.7 or PDF 2.0 specification. Returns: An array (possibly empty) of Dictionaries with ``/F`` and ``/I`` properties. )r ZTHREADSrŸrr7rA)r¢ÚthreadsrfrfrgÚget_threads_rootïs zPdfWriter.get_threads_rootcCs|jƒS)uª Read-only property for the list of threads. See §8.3.2 from PDF 1.7 spec. Each element is a dictionaries with ``/F`` and ``/I`` keys. )r‰)r¢rfrfrgrˆs zPdfWriter.threads)Úpage_destinationÚparentÚbeforeÚis_openrkcCs¾tt|jƒƒ}t|tƒr>|jtd|j›�tt|jƒt j ƒƒƒS|dkrN|j ƒ}t |ƒ|t dƒ<tt|jƒƒ}|j|ƒ}|dk r„|j}|j||||r˜|jndd„ƒd|krºtdƒ|t dƒ<|S)Nzpage #z /%is_open%cSsdS)Nrrf)rÚyrfrfrgrm+sz8PdfWriter.add_outline_item_destination..z/Countr)rrr¨rÚadd_outline_item_destinationr<râr@r«r>Úfitr‡r8rArHr’Ú insert_childZinc_parent_counter_outlinerC)r¢rŠr‹rŒr�Úpage_destination_refrfrfrgr� s.       z&PdfWriter.add_outline_item_destination)Ú outline_itemr‹rŒr�rkcCs tƒ}|j|ƒ|j||||ƒS)N)rHrrr�)r¢r“r‹rŒr�Zoutline_item_objectrfrfrgÚadd_outline_item_dict2s zPdfWriter.add_outline_item_dict) Útitlerâr‹rŒÚcolorÚboldÚitalicr�r�rkc Cs8t|tƒr:|dk r|dkr|}|j|||d||||| d� S|dkrHd} n¸t|tƒrX|} nJt|tƒrj|j} n8t|tƒr¢y|j|j} Wntk r t |ƒ} YnX| dkrÀt d|›�t ƒt ƒ} t td|dƒ| |ƒ} |jtttjƒ| jttjƒtdƒiƒƒ} |jt| ||||ƒƒ} |dk�r(|jƒ}|j| ||| ƒS)aÍ Add an outline item (commonly referred to as a "Bookmark") to the PDF file. Args: title: Title to use for this outline item. page_number: Page number this outline item will point to. parent: A reference to a parent outline item to create nested outline items. before: color: Color of the outline item's font as a red, green, blue tuple from 0.0 to 1.0 or as a Hex String (#RRGGBB) bold: Outline item font is bold italic: Outline item font is italic fit: The fit of the destination page. Returns: The added outline item as an indirect object. N)r�zcan not find reference of page ú/z outline itemz/GoTo)rr>Úadd_outline_itemr@rr«rÉr¤Ú IndexErrorrCr%rXrBr<rAr’r=r*ÚDríÚSÚ_create_outline_itemr‡r�)r¢r•râr‹rŒr–r—r˜r�r�Ú action_refÚpage_refrìr“rfrfrgršIsD      zPdfWriter.add_outline_itemcCs tdƒ‚dS)NzIThis method is not yet implemented. Use :meth:`add_outline_item` instead.)ÚNotImplementedError)r¢rfrfrgÚ add_outline–szPdfWriter.add_outline)r•Ú destinationrkcCsh|jƒ}d}xD|t|ƒkrP|||krF|j||ƒ|j|t|ƒƒdS|d7}qW|jt|ƒ|gƒdS)Nrr})Úget_named_dest_rootrÈrÕrGrø)r¢r•r£Z named_destrerfrfrgÚadd_named_destination_array›s   z%PdfWriter.add_named_destination_array)rŠrkcCs&|j|jƒ}|jtd|dƒ|ƒ|S)NrGz/Title)r’rír¥r)r¢rŠr’rfrfrgÚadd_named_destination_objectªs z&PdfWriter.add_named_destination_object)r•rârkcCs‚|j|jƒtj|}tƒ}|jttjƒt |tt j ƒt dƒgƒttj ƒtdƒiƒ|j|ƒ}t|tƒsrtt|ƒƒ}|j||ƒ|S)Ni:z/GoTo)r¨ržr–r™r=rrrAr*rœr7r.ZFIT_HrCr�r’rrGr€r¥)r¢r•râr rìZdest_refrfrfrgÚadd_named_destinationµs     zPdfWriter.add_named_destinationcCs"x|jD]}|j|tjƒqWdS)z.Remove links and annotations from this output.N)r¤Úremove_objects_from_pagerWrb)r¢rÏrfrfrgÚ remove_linksÌs zPdfWriter.remove_links)ÚsubtypesrkcCs x|jD]}|j||ƒqWdS)aB Remove annotations by annotation subtype. Args: subtypes: subtype or list of subtypes to be removed. Examples are: "/Link", "/FileAttachment", "/Sound", "/Movie", "/Screen", ... If you want to remove all annotations, use subtypes=None. N)r¤Ú_remove_annots_from_page)r¢rªrÏrfrfrgÚremove_annotationsÑs zPdfWriter.remove_annotations)rÏrªrkcCs¬tt|jƒƒ}tj|kr¨d}xŠ|ttt|tjƒƒkr¦tt|tjƒ|}tt|jƒƒ}|dksrtt|dƒ|krœt|t ƒrŽt ƒ|j |j d<|tj|=q|d7}qWdS)Nrz/Subtyper) rr=r¨rÆr:rÈr7r€rr@rBrˆr¬)r¢rÏrªreÚanr°rfrfrgr«às  z"PdfWriter._remove_annots_from_page)rÏÚ to_deleterkc sªtˆttfƒr,xˆD]}ˆj||ƒqWdStˆtƒs:t‚ˆtj@rPˆj|d-ƒSˆtj@rfˆj|d.ƒSˆtj @r|ˆj|d/ƒSˆtj @r’ˆj|dƒSg‰ˆtj @rèdd d d d d gddgddddddddddg ddddddd gd!g‰ˆtj @�rd"d#d$d%g‰t ttttdd&œ‡‡fd'd(„ ‰ttttttttfd)œ‡‡‡‡fd*d+„ ‰t|tƒ�sjtˆ|jƒ}d,|k�r¦tt |jƒƒ}ˆ|gƒ\}}ˆ|||ƒ|j|ƒdS)0a Remove objects specified by ``to_delete`` from the given page. Args: page: Page object to clean up. to_delete: Objects to be deleted; can be a ``ObjectDeletionFlag`` or a list of ObjectDeletionFlag Nú/Linkú/FileAttachmentú/Soundú/Movieú/Screenú/3DówóJójóMódóióWsW*óbsb*óBsB*óSósófsf*óFónómólócóvóyóhsresshsTjsTJó'ó")ÚcontentÚimagesÚformsrkcs|d}xj|t|jƒkrn|j|\}}|dkr4ˆtj@sZ|ˆksZ|dkrdˆtj@rd|d|krd|j|=q|d7}qW|jƒdS)Nrs INLINE IMAGEsDor)rÈÚ operationsrWrdrcÚget_data)rËrÌrÍreZoperandsÚoperator)Újump_operatorsr®rfrgÚcleans     z1PdfWriter.remove_objects_from_page..clean)ÚeltÚstackrkc søˆ|ks(tˆdƒr0t‡fdd„|Dƒƒr0ggfSy$ttttfttˆdƒdƒ}Wntk rli}YnXg}g}�x |jƒD�]\}}|jƒ}yæd}ˆt j @rÀ|ddkrÀt ƒ}|j |ƒ|ddk�rB|j |ƒt |tƒrè|}nFt|ˆƒ}|jd d „|jƒDƒƒy |j|_Wntk �r,YnX|j ˆƒˆ||ƒ|dk �rxt |tƒ�rj|ˆj|jd <nˆj|ƒ||<Wq‚ttfk �r”Yq‚Xq‚Wx|D] } || =�q Wt ˆtƒ�rðt ˆtƒ�sätˆˆƒ} | jˆjƒƒ| ‰ˆˆ||ƒ||fS) Nr«c3s |]}ˆjt|ddƒkVqdS)r«rNr~)r«rÃ)rºr)rÓrfrgr:szJPdfWriter.remove_objects_from_page..clean_forms..z /Resourcesz/XObjectz/Subtypez/Imagez/FormcSsi|]\}}|dkr||“qS)ú/Lengthú/Filterú /DecodeParms)rÕrÖr×rf)rºZk1Zv1rfrfrgr½ZszKPdfWriter.remove_objects_from_page..clean_forms..r)rYr'rr r r=r­r¾r¨rWrcrBrÇrr:rrr«r®r@rˆr¬r’Ú TypeErrorrF) rÓrÔÚdrÌrÍr»r¼rÝrËZimÚe)rÒÚ clean_formsr¢r®)rÓrgrÛ2sf                       z7PdfWriter.remove_objects_from_page..clean_formsz /Contents)r¯)r°r±r²r³)r´)rr¡r=r¨rWrËr_r«r`rarbrer^r:r r€r=rrr«rZ get_contentsZreplace_contents)r¢rÏr®Zto_drËrÌrÍrf)rÒrÛrÑr¢r®rgr¨òs:          H  "(E    z"PdfWriter.remove_objects_from_page)r®rkcCsrt|tƒrtj}|tj@r tjntj|tj@r4tjntjB|tj@rJtjntjB}x|j D]}|j ||ƒqZWdS)z¦ Remove images from this output. Args: to_delete : The type of images to be deleted (default = all images types) N) rr9r+ÚALLrcrWr[rdrer¤r¨)r¢r®rerÏrfrfrgÚ remove_imagesƒs  * zPdfWriter.remove_imagescCs"x|jD]}|j|tjƒqWdS)zRemove text from this output.N)r¤r¨rWr^)r¢rÏrfrfrgÚ remove_text¤s zPdfWriter.remove_text)râÚuriÚrectÚborderrkc Cs‚|j|jƒtj|}ttttf|j|ƒƒ}|dk rzdd„|dd…Dƒ}t|ƒdkr�t dd„|dDƒƒ}|j |ƒnt dƒt dƒt dƒg}t |tƒr¤t |ƒ}nt |t ƒr°nt |ƒ}tƒ} | jtdƒtd ƒtd ƒt|ƒiƒtƒ} | jttjƒtd ƒttjƒtd ƒttjƒ|ttjƒ|td ƒtd ƒttjƒt |ƒtdƒ| iƒ|j| ƒ} tj|k�rj|tjj | ƒnt | gƒ|ttjƒ<dS)a  Add an URI from a rectangular area to the specified page. Args: page_number: index of the page on which to place the URI action. uri: URI of resource to link to. rect: :class:`RectangleObject` or array of four integers specifying the clickable rectangular area ``[xLL, yLL, xUR, yUR]``, or string in the form ``"[ xLL yLL xUR yUR ]"``. border: if provided, an array describing border-drawing properties. See the PDF spec for details. No border will be drawn if this argument is omitted. NcSsg|] }t|ƒ‘qSrf)rC)rºr3rfrfrgrÃsz%PdfWriter.add_uri..rrfcSsg|] }t|ƒ‘qSrf)rC)rºr3rfrfrgrÅsr}z/Sz/URIz/Annotz/Linkz/Hz/Iz/A)r¨ržr–r™rr r€r rÈr7rÇrCrrEr=rrrArGrrZSubtypeÚPrZBorderr’rÆr:) r¢rârßràráZ page_linkr Z border_arrZ dash_patternZlnk2ZlnkZlnk_refrfrfrgÚadd_uri©s<           zPdfWriter.add_uriú /NoLayoutú /SinglePageú /OneColumnú/TwoColumnLeftú/TwoColumnRightú /TwoPageLeftú /TwoPageRightc Cs*ytt|jdƒStk r$dSXdS)Nz /PageLayout)rrQrŸr­)r¢rfrfrgÚ_get_page_layoutõszPdfWriter._get_page_layout)ÚlayoutrkcCsPt|tƒs8||jkr0tdddj|jƒf›�tƒt|ƒ}|jjtdƒ|iƒdS)a Set the page layout. Args: layout: The page layout to be used. .. list-table:: Valid ``layout`` arguments :widths: 50 200 * - /NoLayout - Layout explicitly not specified * - /SinglePage - Show one page at a time * - /OneColumn - Show one column at a time * - /TwoColumnLeft - Show pages in two columns, odd-numbered pages on the left * - /TwoColumnRight - Show pages in two columns, odd-numbered pages on the right * - /TwoPageLeft - Show two pages at a time, odd-numbered pages on the left * - /TwoPageRight - Show two pages at a time, odd-numbered pages on the right zLayout should be one of: rxz /PageLayoutN)rrAÚ_valid_layoutsr%r$rXrŸrr)r¢rìrfrfrgÚ_set_page_layoutûs  zPdfWriter._set_page_layoutcCs|j|ƒdS)a Set the page layout. Args: layout: The page layout to be used .. list-table:: Valid ``layout`` arguments :widths: 50 200 * - /NoLayout - Layout explicitly not specified * - /SinglePage - Show one page at a time * - /OneColumn - Show one column at a time * - /TwoColumnLeft - Show pages in two columns, odd-numbered pages on the left * - /TwoColumnRight - Show pages in two columns, odd-numbered pages on the right * - /TwoPageLeft - Show two pages at a time, odd-numbered pages on the left * - /TwoPageRight - Show two pages at a time, odd-numbered pages on the right N)rî)r¢rìrfrfrgÚset_page_layout szPdfWriter.set_page_layoutcCs|jƒS)aÛ Page layout property. .. list-table:: Valid ``layout`` values :widths: 50 200 * - /NoLayout - Layout explicitly not specified * - /SinglePage - Show one page at a time * - /OneColumn - Show one column at a time * - /TwoColumnLeft - Show pages in two columns, odd-numbered pages on the left * - /TwoColumnRight - Show pages in two columns, odd-numbered pages on the right * - /TwoPageLeft - Show two pages at a time, odd-numbered pages on the left * - /TwoPageRight - Show two pages at a time, odd-numbered pages on the right )rë)r¢rfrfrgÚ page_layout8 szPdfWriter.page_layoutcCs|j|ƒdS)N)rî)r¢rìrfrfrgrðQ sú/UseNoneú /UseOutlinesú /UseThumbsú /FullScreenú/UseOCú/UseAttachmentsc Cs*ytt|jdƒStk r$dSXdS)Nz /PageMode)rrTrŸr­)r¢rfrfrgÚ_get_page_mode^ szPdfWriter._get_page_modecCs|jƒS)a Page mode property. .. list-table:: Valid ``mode`` values :widths: 50 200 * - /UseNone - Do not show outline or thumbnails panels * - /UseOutlines - Show outline (aka bookmarks) panel * - /UseThumbs - Show page thumbnails panel * - /FullScreen - Fullscreen view * - /UseOC - Show Optional Content Group (OCG) panel * - /UseAttachments - Show attachments panel )r÷)r¢rfrfrgÚ page_moded szPdfWriter.page_mode)rWrkcCsRt|tƒr|}n*||jkr2tddj|jƒ›�tƒt|ƒ}|jjtdƒ|iƒdS)NzMode should be one of: z, z /PageMode)rrAÚ _valid_modesr%r$rXrŸrr)r¢rWZ mode_namerfrfrgrø{ s  )râÚ annotationrkcCs$|}t|tƒr|j|}nt|tƒs,tdƒ‚ttt|ƒƒ}|j|t dƒ<|j dkr`t ƒ|t dƒ<|j dk snt ‚|j dƒdkrÔd|krÔttttf|t dƒƒ}tt dƒ|d t|d t|ƒd d �ƒ}|j|t dƒ<|j j|j|ƒƒ|j dƒd k�r t dƒ|k�r |jtt|djƒƒt d ƒ<|S)a‰ Add a single annotation to the page. The added annotation must be a new annotation. It cannot be recycled. Args: page_number: PageObject or page index. annotation: Annotation to be added (created with annotation). Returns: The inserted object. This can be used for popup creation, for example. zpage: invalid typez/PNz/Annotsz/Subtypez/Linkz/Destz /LinkNameZtarget_page_indexr�Úfit_args)Zfit_typerûz/Popupz/Parent)rrÉr¤rrØrr=Ú_pdf_objectifyr«rAÚ annotationsr7rËrÅr r r<r>ÚdictrírÇr’r¨)r¢rârúrÏÚto_addÚtmprìrfrfrgÚadd_annotation‡ s,    zPdfWriter.add_annotationcCsštd|jƒƒ}x†|jdgƒD]v}|jƒ}|jddƒ}|jddƒ}t|tƒr\t|ƒ|tdƒ<q|dk r|jƒ}|jddƒ}t|tƒrt|ƒ|tdƒ<qW|S)zþ Perform some clean up in the page. Currently: convert NameObject named destination to TextStringObject (required for names/dests list) Args: page: Returns: The cleaned PageObject rz/Annotsz/DestNz/Az/D)rr¨rÅrrArG)r¢rÏÚaZa_objrÙZactrfrfrgÚ clean_page¼ s      zPdfWriter.clean_page)ryrkc Cs¾d}t|ttfƒr6t|dƒ�}t|jƒƒ}WdQRXn€t|tƒr~|jrL|j}|jj ƒ}|jj dƒt|jjƒƒ}|jj |ƒn8t |dƒr®t |dƒr®|j dƒ|jƒ}t|ƒ}nt dƒ‚||fS)Nr|rr…rlzÕMerging requires an object that PdfReader can parse. Typically, that is a Path or a string representing a Path, a file object, or an object implementing .seek and .read. Passing a PdfReader directly works as well.) rr€rrrrlrr›rir„r…rYr¡)r¢ryÚencryption_objr£riZ orig_tellZ filecontentrfrfrgÚ_create_streamÖ s$       zPdfWriter._create_stream.)ryr“r¤Úimport_outlineÚexcluded_fieldsrkcCsj|dkr f}t|tttfƒrRt|tƒr8t|tƒs4|}|}|}|jd|d|||ƒn|jd|||||ƒdS)aP Identical to the :meth:`merge()` method, but assumes you want to concatenate all pages onto the end of the file instead of specifying a position. Args: fileobj: A File Object or an object that supports the standard read and seek methods similar to a File Object. Could also be a string representing a path to a PDF file. outline_item: Optionally, you may specify a string to build an outline (aka 'bookmark') to identify the beginning of the included file. pages: Can be a :class:`PageRange` or a ``(start, stop[, step])`` tuple or a list of pages to be processed to merge only the specified range of pages from the source document into the output document. import_outline: You may prevent the source document's outline (collection of outline items, previously referred to as 'bookmarks') from being imported by specifying this as ``False``. excluded_fields: Provide the list of fields/keys to be ignored if ``/Annots`` is part of the list, the annotation will be ignored if ``/B`` is part of the list, the articles will be ignored N)rr=r¡rMr9Úmerge)r¢ryr“r¤rrrfrfrgrÇú s,)  zPdfWriter.append)Úpositionryr“r¤rrrkcCsšt|tƒr|}n|j|ƒ\}} t|dd�}|dkr6f}|dkrRttt|jƒƒƒ}nft|tƒrvtt|j t|jƒƒŽƒ}nBt|tƒr‚n6t|t ƒr¦t|ƒdkr¦tt|Žƒ}nt|t ƒs¸t dƒ‚i} x |D]˜} t| t ƒrÖ| } n |j| } | j dk sît‚|dk�r|j| t|ƒddddgƒ| | j j<n.|j| |t|ƒddddgƒ| | j j<|d7}| | | j j_qÂW|j|_�x |jjƒD�]} | j}d |jk�rÀ| d ttttttt|jd ƒd ƒd ƒk�rÀnÄt| d tƒ�rÒn²t| d tƒ�rH|j| d }|j dk �st‚y.t| |j jjƒ|td ƒ<|j | d |ƒWnt!k �rDYnXn<| d j j| k�rt| | d j jj |td ƒ<|j | d |ƒ�qtW|dk �rÂtd|j"t#|ƒt$t%| jƒƒƒj t&d�j'ƒƒ}n|j(ƒ}|j)}|�rt*j+|k�r|j,|j-t*j+dƒ| |ƒ}|j.||dƒd|k�rdxP| jƒD]D}|j/|jj-dfƒ|| |ƒ}t|ƒd k�rT||t0dƒ<|j1|ƒ�qWd|k�r~|ddk �r~d|jk�rº|j2tt|j)dƒj3|ddƒƒ|jt0dƒ<t4ƒ}ntt4tt|jdƒdƒ}|j5t6|ƒ}y`xZ|j)ddD]H}y*t7||jd |ƒ}||k�r |j8|ƒWnt!k �r8YnX�qôWWn"t!k �rd|j2t4ƒƒ}YnX|tt|jdƒt0dƒ<d|k�r–|j9d| |ƒdS)aØ Merge the pages from the given file into the output file at the specified page number. Args: position: The *page number* to insert this file. File will be inserted after the given number. fileobj: A File Object or an object that supports the standard read and seek methods similar to a File Object. Could also be a string representing a path to a PDF file. outline_item: Optionally, you may specify a string to build an outline (aka 'bookmark') to identify the beginning of the included file. pages: can be a :class:`PageRange` or a ``(start, stop[, step])`` tuple or a list of pages to be processed to merge only the specified range of pages from the source document into the output document. import_outline: You may prevent the source document's outline (collection of outline items, previously referred to as 'bookmarks') from being imported by specifying this as ``False``. excluded_fields: provide the list of fields/keys to be ignored if ``/Annots`` is part of the list, the annotation will be ignored if ``/B`` is part of the list, the articles will be ignored Raises: TypeError: The pages attribute is not configured properly F)ÚstrictNrz:"pages" must be a tuple of (start, stop[, step]) or a listrz/Bz/Annotsz/Namesz/Titlez/Destsz/PagerrH)r�z /AcroFormú/Fieldsrx)r ):rrrrr¡rürÈr¤rMÚindicesr=rØrr«rËràr¬ráÚ original_pageZnamed_destinationsZ _namedDestsrorírŸrr r r=rBrÉrCrâr¥r­ršrGÚnextrqr6r¨r‡r§r r…Ú_get_filtered_outlinerÅÚ_insert_filtered_outlineÚ_insert_filtered_annotationsrArr’rÌr7r‹rÓr@rÇÚadd_filtered_articles)r¢r ryr“r¤rrrúrirZsrcpagesrÏZpgrìZarrr?Zoutline_item_typZ_ror†Úpagr@Ztrslatr£Úindrfrfrgr= sÊ%         ""         zPdfWriter.merge)Úthreadr¤rúrkc Cs€|j|ddd�}|jj|jƒtd|dƒ}|}d}�x2|dk �rh|jtd|dƒ||ƒ}|dk �r0|dkr–td|jtƒƒjƒƒ}|} |j|t dƒ<n4td|jtt dƒ|jiƒƒjƒƒ} | j|t d ƒ<| }||t dƒ<|j|t d ƒ<|d |t d ƒ<td|jƒƒ} d | k�rt ƒ| t d ƒ<td | d ƒj|jƒtd|d ƒ}||kr8| j|t d ƒ<|j| t dƒ<d}q8W|jdk �szt ‚|jS)z× Clone the thread with only the applicable articles. Args: thread: pages: reader: Returns: The added thread as an indirect reference Tú/F)Zforce_duplicateÚ ignore_fieldsr=Nrz/Pz/Vz/Nz/Tz/Rz/Br7)r) rÌrˆrÇr«rÚ_get_cloned_pager’r=r¨rAr7rË) r¢rr¤rúZnthreadZ first_articleZcurrent_articleZ new_articlerZ new_firstZ new_article2Zpag_objrfrfrgÚ_add_articles_threadñ sL    zPdfWriter._add_articles_thread)Úfltrr¤rúrkcCsÄt|tƒrtj|ƒ}nt|tƒs*tjdƒ}x”|jƒD]ˆ}|j}x||jdfƒD]l}|jƒjdƒ}|dkrjqLn|jƒ}|j j |j t |ƒkrL|j d|krœ|dnijddƒƒrL|j|||ƒqLWq4WdS)z… Add articles matching the defined criteria. Args: fltr: pages: reader: rxz/Bz/TNz/Iz/Title)rr€ÚreÚcompilerror rÅr¨r«r¬r‹rÓÚsearchr)r¢rr¤rúr?ÚpprZthrrfrfrgr1 s      "zPdfWriter.add_filtered_articles)rÏr¤rúrkc Csdt|tƒrdSt|tƒr0|jddƒdkr0|j}nt|tƒr>|}y ||jjStk r^dSXdS)Nz/Typerxz/Page)rrBr=rÅr«r@r¬rÔ)r¢rÏr¤rúZ_irfrfrgrR s   zPdfWriter._get_cloned_page)rCrÏr¤rúrkc CsÞtƒ}t|tƒrtd|jƒƒ}�x¸|D�]®}td|jƒƒ}|ddksnd|ksntd|dƒddksnd|k�r(d|krŽ|j|j|j|ƒƒƒn˜|d}t|tƒrÄt|ƒ|j ƒkrÂ|j|j|ƒj ƒnbtd |ƒ}|j |d ||ƒ} | dk �rÖ|j|dd �} t| g|d d…ƒ| t dƒ<|j|j| ƒƒq&td|dƒd }t|tƒ�rlt|ƒ|j ƒk�rÖ|j|j|ƒj ƒq&td |ƒ}|j |d ||ƒ} | dk r&|j|dd �} t| g|d d…ƒtd| dƒt d ƒ<|j|j| ƒƒq&W|S)Nz List[Any]r=z/Subtypez/Linkz/Az/Sz/GoToú/Destr7r)rrú/D)r)r ) r7rr@rr¨rÇr’rÌr€r¤r«rrA) r¢rCrÏr¤rúZoutlistr­rDrÙr?Zancrfrfrgrc s@        (z&PdfWriter._insert_filtered_annotations)r×r¤rúrkcCs*g}|dkrtƒ}|jƒ}t|ƒr(tƒ}|jddƒdks@d|krp|jddƒ}|dk rn|jƒ}||j|||ƒ7}n¶x´|dk �r$|jƒ}td|j|ƒƒ}|jtd|d ƒ||ƒ}|dkrºtƒ}||t d ƒ<d|krä|j|d||ƒ|_ ng|_ t |d tƒ �s t |j ƒd k�r|j |ƒ|jd dƒ}qrW|S) zÜ Extract outline item entries that are part of the specified page set. Args: node: pages: reader: Returns: A list of destination objects. Nz/Typerxz /Outlinesz/Titlez/Firstr<rz/Pagerz/Next)rBr¨rLr=rÅrrZ_build_outline_itemrrAÚ_filtered_childrenrrÈrÇ)r¢r×r¤rúZ new_outlinerÝr¼rfrfrgr• s6    zPdfWriter._get_filtered_outlinecCsÂtƒ}|j|ƒt|dƒ|tdƒ<t|dtƒsn|jdk r`d|jkr`|jdj|ƒ|tdƒ<n|j|tdƒ<|jdk r¾t |jj ddƒƒ|tdƒ<t |jj dt dƒt dƒt dƒgƒƒ|tdƒ<|S) Nz/Titlez/Pagez/Az/Destz/Frz/Cg) rHr’rGrArrBr×rÌrírCrÅr7r?)r¢rìZn_olrfrfrgÚ_clone_outlineÈ s  $zPdfWriter._clone_outline)Úoutlinesr‹rŒrkcCsbx\|D]T}|jddƒdks"d|kr(|}n"|j|ƒ}tt|jƒƒj|||ƒ|j|j|dƒqWdS)Nz/Typerxz /Outlinesz/Title)rÅr"rrHr¨r‘rr!)r¢r#r‹rŒrìÚnprfrfrgrÛ s   z"PdfWriter._insert_filtered_outlinecCsdS)z"Implemented for API harmonization.Nrf)r¢rfrfrgrdë szPdfWriter.close)r“r€rkcCs®|dkr|jƒ}n td|ƒ}d}xˆ|dk r¨|j|ksD|jddƒ|krJ|gSd|kr‚|j|tt|dƒƒ}|r‚d|krz|gng|Sd|kr¢|d7}tt|dƒ}q"dSq"WdS)NrHrz/Titlez/Firstz/Nextr)r‡rr«rÅÚfind_outline_itemrSrH)r¢r“r€rÝreÚresrfrfrgr%ï s"    zPdfWriter.find_outline_itemcCstdddƒdS)zZ .. deprecated:: 2.9.0 Use :meth:`find_outline_item` instead. Ú find_bookmarkr%z5.0.0N)r$)r¢r“r€rfrfrgr' s zPdfWriter.find_bookmarkc Cs‚|dkri|_nnt|tƒrBy|jt|ƒ=Wq~tk r>Yq~Xnršr¢r¥r¦r§r©rOr¬r«rWr¨r+rÜrÝrÞrErãrírQrërîrïrðrùrTr÷rørrrrrrMrÇrNrrrrrrrr"rrdrSr%r'r(r-r/r.Ú __classcell__rfrf)rërgrw“sÚ"u         *  & #]  ! (f 0%+2$G   G *# LB      ="  1 '€7J/ =    . .  /rw)r°rkcCsÀt|tƒr|St|tƒrPtƒ}x,|jƒD] \}}t|ƒ}t|ƒ}|||<q(W|St|tƒrltdd„|DƒƒSt|t ƒr’|j dƒrˆt|ƒSt |ƒSn*t|t t fƒr¨t|ƒStdt|ƒ›d�ƒ‚dS)Ncss|]}t|ƒVqdS)N)rü)rºÚelrfrfrgr± sz!_pdf_objectify..r™z type(obj)=z! could not be casted to PdfObject)rrDrþr=r¾rArür¡r7r€Ú startswithrGrÉrr?r¡Útype)r°rÿrwrªZname_keyZ casted_valuerfrfrgrü¦ s&       rü)rŸr•r–r˜r—rkcCs¤tƒ}|dk r||tdƒ<|jtdƒt|ƒiƒ|rft|tƒrFt|ƒ}|jtdƒtdd„|Dƒƒiƒ|sn|r d}|r~|d7}|rŠ|d7}|jtd ƒt|ƒiƒ|S) Nz/Az/Titlez/CcSsg|] }t|ƒ‘qSrf)r?)rºrrfrfrgrÒ sz(_create_outline_item..rrr}z/F) rHrArrrJrr€rKr7rC)rŸr•r–r˜r—r“Z format_flagrfrfrgrž¿ s$  rž)rh)~r5r\rorrgrñÚiorrrÚ itertoolsrZpathlibrÚtypesrÚtypingrr r r r r rrrrrrZ_cmaprrZ _doc_commonrrr›rrZ_pagerZ _page_labelsrrrrŽrÚ_utilsr r!r"r#r$r%Ú constantsr&rr'rïr(r)r*r+r,r-r.r/r0r r1r r2rÆr3r–r4rlÚerrorsr5Zgenericr6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLZ pagerangerMrNrOrPrQrRrSrTÚxmprUÚallr7r#ÚIntFlagrWrÉr€rvrwrürr9ržrfrfrfrgÚs„   8     (      d   +(