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à»ã@sNddlZddlZddlmZmZddlmZddlmZddl m Z m Z m Z m Z mZmZmZmZmZmZmZddlmZmZddlmZmZdd lmZmZmZmZm Z m!Z!m"Z"m#Z#dd l$m%Z&dd l'm(Z(m)Z)m*Z*m+Z+m,Z,dd l-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;dd lm?Z?Gdd„deƒZ@dS)éN)ÚBytesIOÚUnsupportedOperation)ÚPath)Ú TracebackType) Ú TYPE_CHECKINGÚAnyÚCallableÚDictÚIterableÚListÚOptionalÚTupleÚTypeÚUnionÚcasté)Ú PdfDocCommonÚconvert_to_int)Ú EncryptionÚ PasswordType)Ú StrByteTypeÚ StreamTypeÚlogger_warningÚread_non_whitespaceÚread_previous_lineÚread_until_whitespaceÚskip_over_commentÚskip_over_whitespace)Ú TrailerKeys)ÚEmptyFileErrorÚFileNotDecryptedErrorÚ PdfReadErrorÚPdfStreamErrorÚWrongPasswordError)Ú ArrayObjectÚ ContentStreamÚDecodedStreamObjectÚDictionaryObjectÚEncodedStreamObjectÚIndirectObjectÚ NameObjectÚ NullObjectÚ NumberObjectÚ PdfObjectÚ StreamObjectÚTextStringObjectÚis_null_or_noneÚ read_object)ÚXmpInformation)Ú PageObjectc @sVeZdZdZdXeeefeedee fddœdd„Z ddœdd „Z e e ee ee edd œd d „Zddœd d„Zeedœdd„ƒZee edœdd„ƒZee edœdd„ƒZdYedeefedeefeeefdœdd„Zeedœdd„ƒZee edœdd„ƒZedee e!fe edœdd„Z"e!eee#efdœdd „Z$eee!fe e#dœd!d"„Z%e&e'eefd#œd$d%„Z(eee e#d&œd'd(„Z)eee e#e e#d)œd*d+„Z*e!e#e#d,œd-d.„Z+e&dd#œd/d0„Z,e&dd#œd1d2„Z-e&dd#œd3d4„Z.e&ed#œd5d6„Z/e&dd#œd7d8„Z0e&e eedd9œd:d;„Z1e&e ed#œdœd?d@„Z3e&ee4e5e6fd#œdAdB„Z7e8e&eed>œdCdD„ƒZ9e&dd#œdEdF„Z:e;eeeee fe?dNœdOdP„Z@eedœdQdR„ƒZAee edSœdTdU„ZBee edSœdVdW„ZCdS)ZÚ PdfReadera´ Initialize a PdfReader object. This operation can take some time, as the PDF stream's cross-reference tables are read into memory. Args: stream: 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. strict: Determines whether user should be warned of all problems and also causes some correctable problems to be fatal. Defaults to ``False``. password: Decrypt PDF file at initialization. If the password is None, the file will not be decrypted. Defaults to ``None``. FN)ÚstreamÚstrictÚpasswordÚreturnc Cs`||_d|_i|_d|_i|_i|_i|_tƒ|_d|_ t |dƒrVd|j krVt dt ƒd|_t|ttfƒr’t|dƒ�}t|jƒƒ}WdQRXd|_d|_|j|ƒ||_d|_d|_|j�rJd|_|jjtjƒ}|râ|djƒjnd}tt|jtj jƒƒ}t!j||ƒ|_|dk �r|nd}|jj"|ƒt#j$k�rB|dk �rBt%d ƒ‚d|_n|dk �r\t&d ƒ‚dS) NrÚmodeÚbzQPdfReader stream/file object is not in binary mode. It may not be read correctly.FÚrbTózWrong passwordzNot encrypted file)'r6Úflattened_pagesÚresolved_objectsÚ xref_indexÚxrefÚxref_free_entryÚ xref_objStmr'ÚtrailerÚ _page_id2numÚhasattrr9rÚ__name__Ú_stream_openedÚ isinstanceÚstrrÚopenrÚreadÚ _startxrefr5Ú_override_encryptionÚ _encryptionÚ is_encryptedÚgetÚTKÚIDÚ get_objectÚoriginal_bytesrÚENCRYPTrÚverifyrZ NOT_DECRYPTEDr#r!) Úselfr5r6r7ÚfhZid_entryZ id1_entryZ encrypt_entryÚpwd©rZú./tmp/pip-build-_d5lkt3n/pypdf/pypdf/_reader.pyÚ__init__nsJ    zPdfReader.__init__)r8cCs|S)NrZ)rWrZrZr[Ú __enter__«szPdfReader.__enter__)Úexc_typeÚexc_valÚexc_tbr8cCs |jƒdS)N)Úclose)rWr^r_r`rZrZr[Ú__exit__®szPdfReader.__exit__cCs:|jr|jjƒg|_i|_tƒ|_i|_i|_i|_ dS)z8Close the stream if opened in __init__ and clear memory.N) rGr5rar=r>r'rCr@rArB)rWrZrZr[ra¶s zPdfReader.closecCs*|jtj}|dkrtdƒ‚tt|jƒƒS)z7Provide access to "/Root". Standardized with PdfWriter.Nz"Cannot find "/Root" key in trailer)rCrQÚROOTr!rr'rS)rWÚrootrZrZr[Ú root_objectÁs zPdfReader.root_objectcCsB|jjtjdƒ}t|ƒrdS|jƒ}|dkr4tdƒ‚tt|ƒSdS)zš Provide access to "/Info". Standardized with PdfWriter. Returns: /Info Dictionary; None if the entry does not exist NzETrailer not found or does not point to document information directory) rCrPrQÚINFOr0rSr!rr')rWÚinforZrZr[Ú_infoÉszPdfReader._infocCs*|jjtjdƒ}t|ƒrdStt|jƒƒS)z‘ Provide access to "/ID". Standardized with PdfWriter. Returns: /ID array; None if the entry does not exist N)rCrPrQrRr0rr$rS)rWÚidrZrZr[Ú_IDÜsz PdfReader._ID)ÚincludeÚexcluder8cs^|jjdƒ|jjƒ}d|i}ˆdk r<‡fdd„|jƒDƒ}ˆdk rZ‡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 rzapplication/pdfNcsi|]\}}|ˆkr||“qSrZrZ)Ú.0ÚkÚv)rkrZr[ú üsz/PdfReader._repr_mimebundle_..csi|]\}}|ˆkr||“qSrZrZ)rmrnro)rlrZr[rps)r5ÚseekrKÚitems)rWrkrlZpdf_dataÚdatarZ)rlrkr[Ú_repr_mimebundle_çs  zPdfReader._repr_mimebundle_cCs>|jjƒ}|jjddƒ|jjdƒjddƒ}|jj|dƒ|S)zÇ The first 8 bytes of the file. This is typically something like ``'%PDF-1.6'`` and can be used to detect if the file is actually a PDF file and which version it is. rézutf-8Úbackslashreplace)r5ÚtellrqrKÚdecode)rWÚlocZpdf_file_versionrZrZr[Ú pdf_headers zPdfReader.pdf_headerc Cs"zd|_tt|jjƒSd|_XdS)z(XMP (Extensible Metadata Platform) data.TNF)rMrr2reÚ xmp_metadata)rWrZrZr[r{szPdfReader.xmp_metadata)Úindirect_referencer8cCs||jdkr dd„t|jƒDƒ|_t|ƒr,dSt|ttfƒsBtdƒ‚t|tƒrR|}n|j}|jdk sjtdƒ‚|jj |dƒ}|S)z� Generate _page_id2num. Args: indirect_reference: Returns: The page number or None NcSsi|]\}}||jj“qSrZ)r|Úidnum)rmÚiÚxrZrZr[rp*sz:PdfReader._get_page_number_by_indirect..Zmypyz hint for mypy) rDÚ enumerateZpagesr0rHÚintr)ÚAssertionErrorr}rP)rWr|r}ÚretrZrZr[Ú_get_page_number_by_indirects  z&PdfReader._get_page_number_by_indirectc Csˆ|j|j\}}t|d|ƒjƒ}tt|dƒdks6t‚t|jƒƒ}�x,t |dƒD�]}t |ƒ|j ddƒt j |ƒ}t |ƒ|j ddƒt j |ƒ}t |ƒ|j ddƒ||jkr´qR|jrÊ||krÊtdƒ‚|j t|d|ƒdƒt |ƒ|j ddƒyt||ƒ} Wnftk �rj} zHtd|›d |j›d |j›d | ›�tƒ|j�rTtd | ›�ƒ‚tƒ} WYdd} ~ XnX| SW|j�r‚td ƒ‚tƒS)Nrz/Typez/ObjStmz/NrzObject is in wrong index.z/FirstzInvalid stream (index z) within object ú z: zCannot read object stream: z%This is a fatal error in strict mode.éÿÿÿÿr†r†r†)rBr}r)rSrrIr‚rÚget_dataÚrangerrqr,Zread_from_streamr6r!r�r1r"rÚ generationrFr+) rWr|ZstmnumÚidxZobj_stmÚ stream_datar~ZobjnumÚoffsetÚobjÚexcrZrZr[Ú_get_object_from_stream9sF         z!PdfReader._get_object_from_streamc Csft|tƒrt|d|ƒ}|j|j|jƒ}|dk r2|S|jdkrV|j|jkrV|j|ƒ}�nú|j|jkor|j|j|jk�rÒ|j j |jiƒj |jdƒr–t ƒS|j|j|j}|j j |dƒy2|j|j ƒ\}}||jksÜ||jkrätdƒ‚W�nútk �rât|j dƒ�rt|j jƒƒ}n2|j jƒ}|j j ddƒ|j jdƒ}|j j |dƒtjd|j›d|j›d�jƒ|ƒ}|dk �rÖtd |j›d |j›d �tƒ|jdƒd|j|j|j<|j j |jdƒdƒ|j|j ƒ\}}nd}d}YnX||jk�r(|j�r(|j�rbtd |j›d |j›d|›d |›d� ƒ‚n:||jk�rb|j�rbtd |j›d |j›d|›d |›d� ƒ‚|j�rz||jk�szt‚t|j |ƒ}|j �rP|j!dk �rP|j!j"ƒ�s°t#dƒ‚t$t%|ƒ}|j!j&||j|jƒ}�n~t|j dƒ�rðt|j jƒƒ}n2|j jƒ}|j j ddƒ|j jdƒ}|j j |dƒtjd|j›d|j›d�jƒ|ƒ}|dk �r$td|j›d |j›d�tƒ|j|jk�r„i|j|j<|jdƒd|j|j|j<|j j |j'dƒdƒt(|j ƒ|j j ddƒt|j |ƒ}|j �rP|j!dk �rP|j!j"ƒ�st#dƒ‚t$t%|ƒ}|j!j&||j|jƒ}n,td|j›d |j›d�tƒ|j�rPtdƒ‚|j)|j|j|ƒ|S)NrFz¬ matching, we parse the file for itÚ getbufferrz\sz\s+z\s+objz Object ID ú,z ref repairedzExpected object ID (r…z) does not match actual (z); xref table not zero-indexed.z).zFile has not been decryptedzObject z foundz not defined.zCould not find object.r†r†r†r†r†)*rHr�r)Úcache_get_indirect_objectr‰r}rBr�r@rArPr+r5rqÚread_object_headerr!Ú ExceptionrEÚbytesr�rwrKÚreÚsearchÚencoderrFÚstartr?r6r‚r1rMrNZ is_decryptedr rr-Zdecrypt_objectÚendrÚcache_indirect_object) rWr|Úretvalr™r}r‰ÚbufÚpÚmrZrZr[rSqs´             &$           zPdfReader.get_object)r5r8cCs²d}t|ƒ|t|ƒO}|jddƒt|ƒ}|t|ƒO}|jddƒt|ƒ}|t|ƒO}|jddƒ|jdƒ}t|ƒ|jd dƒ|r¢|jr¢td|›d|›�tƒt |ƒt |ƒfS) NFréz.Superfluous whitespace found in object header r…r†r†r†r†) rrrqrrKrr6rrFr�)rWr5Úextrar}r‰Ú_objrZrZr[r“ùs$         zPdfReader.read_object_header)r‰r}r8c Cs2y|jj||fƒStk r,tdƒ‚YnXdS)Nz Maximum recursion depth reached.)r>rPÚRecursionErrorr!)rWr‰r}rZrZr[r’sz#PdfReader.cache_get_indirect_object)r‰r}r�r8cCs^||f|jkr6d|›d|›�}|jr,t|ƒ‚t|tƒ||j||f<|dk rZt|||ƒ|_|S)NzOverwriting cache for r…)r>r6r!rrFr)r|)rWr‰r}r�ÚmsgrZrZr[r›s zPdfReader.cache_indirect_object)Úindirectr�r8cCsH|j|krtdƒ‚|j|jf|jkr,tdƒ‚||j|j|jf<||_|S)Nz,Cannot update PdfReader with external objectzCannot find referenced object)ZpdfÚ ValueErrorr‰r}r>r|)rWr¥r�rZrZr[Ú_replace_object*s zPdfReader._replace_objectc Cs|j|ƒ|j|ƒ|j|ƒ}||_|j||ƒ}|dkr\|jrJ|rJtdƒ‚td|›d�tƒ|j |||ƒ|j ov|j �r@|j ƒ}x°|j j ƒD]¢\}}|dkr qŽt|jƒƒ}x‚|D]z}|j||dƒy|j|ƒ\} } Wn tk rø|j|ƒPYnX| ||j kr²|j |||j || <|j ||=q²WqŽW|j|dƒ|j�sþ|j ƒ}x |j j ƒD]’\}}|dk�rr�q\t|jƒƒ} xl| D]d}|j||dƒy|j|ƒWn>tk �rätd|›d|›d||›d�tƒ||=YnX�q„W�q\W|j|dƒdS) NrzBroken xref tablezincorrect startxref pointer(ú)iÿÿzIgnoring wrong pointing object r…z (offset )Ú_basic_validationÚ_find_eof_markerÚ_find_startxref_posrLÚ_get_xref_issuesr6r!rrFÚ_read_xref_tables_and_trailersr?rwr@rrÚsortedÚkeysrqr“r¦Ú_rebuild_xref_tableÚlist) rWr5Ú startxrefÚ xref_issue_nrryÚgenZ xref_entryZxref_kriÚpidZ_pgenÚidsrZrZr[rK4sX            zPdfReader.readc Cs”|jdtjƒy|jdƒ}Wntk r8tdƒ‚YnX|dkrLtdƒ‚n6|dkr‚|jrrtd|j dƒ›d �ƒ‚nt d |›�t ƒ|jdtj ƒd S) z/Ensure file is not empty. Read at most 5 bytes.rézcannot read headerr<zCannot read an empty files%PDF-zPDF starts with 'Úutf8z', but '%PDF-' expectedzinvalid pdf header: N) rqÚosÚSEEK_SETrKÚUnicodeDecodeErrorrrr6r!rxrrFÚSEEK_END)rWr5Z header_byterZrZr[r©os zPdfReader._basic_validationcCsPd}d}xB|dd…dkrJ|jƒ|kr@|jr6tdƒ‚n tdtƒt|ƒ}q WdS)a Jump to the %%EOF marker. According to the specs, the %%EOF marker should be at the very end of the file. Hence for standard-compliant PDF documents this function will read only the last part (DEFAULT_BUFFER_SIZE). rur<Nr·s%%EOFzEOF marker not found)rwr6r!rrFr)rWr5Z HEADER_SIZEÚlinerZrZr[rª‚s   zPdfReader._find_eof_markerc Cs~t|ƒ}y t|ƒ}WnDtk rX|jdƒs6tdƒ‚t|dd…jƒƒ}tdtƒYn"Xt|ƒ}|dd…dkrztdƒ‚|S)zš Find startxref entry - the location of the xref table. Args: stream: Returns: The bytes offset s startxrefzstartxref not foundé Nz startxref on same line as offset)rr�r¦Ú startswithr!ÚstriprrF)rWr5r½r²rZrZr[r«”s   zPdfReader._find_startxref_poscCs|jdƒ}|dkrtdƒ‚t|ƒ|jddƒd}�xättt||ƒƒ}|rh|dkrh||_|jrht dt ƒd}t|ƒ|jddƒttt||ƒƒ}t |tƒsºt d t ƒ|j |ƒ|jƒdSt|ƒ|jddƒd}�x||k�rÜ|jd ƒ}x(|dd k�r|jddƒ|jd ƒ}qìW|d d k�r.|jd!dƒy8|dd …j dƒ\}} |dd…} t|ƒt| ƒ} } Wn¼tk �r"t|dƒ�r’t|jƒƒ} n(|jƒ}|jddƒ|jd"ƒ} |j|ƒtj|›d�jƒ| ƒ}|dk�röt d|›d�t ƒd} d#} n(t d|›d�t ƒt|jdƒƒ} |jƒ} YnX| |jk�rDi|j| <i|j| <||j| k�rVnt| dk�rn| |j| |<y| dk|j| |<Wntk �ršYnXy| dk|jd|<Wntk �rÈYnX|d7}|d7}qÖWt|ƒ|jd$dƒ|jdƒ}|dk�r|jd%dƒq6Pq6WdS)&Nr srefzxref table read errorrTrzFXref table not zero-indexed. ID numbers for objects will be corrected.Fz,Invalid/Truncated xref table. Rebuilding it.és s 0123456789téó éér�z\s+(\d+)\s+objzentry z( in Xref table invalid; object not foundiÿÿz' in Xref table invalid but object foundónóféstrailerr†r†r†iìÿÿÿiíÿÿÿr†r†r†r†r†iùÿÿÿ)rKr!rrqrr�r1r?r6rrFrHr°Úsplitr”rEr•r�rwr–r—r˜Úgroupr™r@rA)rWr5ÚrefZ first_timeÚnumÚsizeZcntr½Zoffset_bZ generation_bZ entry_type_brŒr‰r�ržÚfZ trailer_tagrZrZr[Ú_read_standard_xref_table­s¢                          z#PdfReader._read_standard_xref_table)r5r²r³r8c CsÊi|_i|_i|_tƒ|_�x¨|dk �rÄ|j|dƒ|jdƒ}|dkrP|jdƒ}|dkrd|j|ƒ}q|r”y|j|ƒPWnt k r�d}YnXq|j ƒ�r¶y|j |ƒ}WnVt k �r}z8t j |jkrâtd|j›�tƒPntd|j›�ƒ‚WYdd}~XnXt j t jt jt jt jf}x8|D]0}||k�r"||jk�r"|j|ƒ|jt|ƒ<�q"Wd|k�r˜|jƒ} |jtt|dƒddƒ|j |ƒ|j| dƒd|k�r²tt|dƒ}nPq|j||ƒ}qWdS) Nrrs óxz!Previous trailer can not be read ztrailer can not be read z/XRefStmz/Prev)r@rArBr'rCrqrKÚ _read_xrefr°r”ÚisdigitÚ_read_pdf15_xref_streamrQrcrÚargsrFr!rUrfrRZSIZEZraw_getr*rwrr�Ú_read_xref_other_error) rWr5r²r³rÚ xrefstreamÚeZ trailer_keysÚkeyržrZrZr[r­#sP         "     z(PdfReader._read_xref_tables_and_trailersc Cs |j|ƒ|jdƒdkrdS|jddƒt|ƒ|jd dƒttttft||ƒƒ}x(|j ƒD]\}}||j kr^||j |<q^Wd|krî|j ƒ}|jtt |dƒddƒy|j |ƒWn*tk ràtd|d›d�tƒYnX|j|dƒd|k�r|d}|SdSdS) Nrr<z/XRefStmrzXRef object at z, can not be read, some object may be missingz/Prevr†r†)rÏrKrqrrr rIrr1rrrCrwr�rÓr”rrF)rWr5Ú new_trailerrØÚvalueržr²rZrZr[rÑTs0       zPdfReader._read_xref)r5r²r8c Csè|dkr$|jrtdƒ‚tdtƒdS|jddƒ|jdƒ}|jdƒ}|dkr\|d|8}|S|j|dƒx*td ƒD]}|jdƒjƒrr||7}|SqrWd |j krÜ|j rÜtd tƒy|j |ƒdSt k rÚtd ƒ‚YnXtd ƒ‚dS)Nrz6/Prev=0 in the trailer (try opening with strict=False)zA/Prev=0 in the trailer - assuming there is no previous xref tableé rrÁsxrefé éz/Rootz"Invalid parent xref., rebuild xrefzcan not rebuild xrefz/Could not find xref table at specified locationiõÿÿÿr†) r6r!rrFrqrKÚfindrˆrÒrCr°r”)rWr5r²ÚtmpZxref_locÚlookrZrZr[rÕps6       z PdfReader._read_xref_other_errorcs|jddƒˆj|ƒ\}}ttt|ˆƒƒ}tt|dƒdks@t‚ˆj|||ƒt|j ƒƒ‰|j dd|j dƒgƒ}tt t t f|j dƒƒ‰t ˆƒdks˜t‚ˆjr¸t ˆƒdkr¸td ˆ›�ƒ‚tttttd ffd œ‡‡fd d „ }tttttd fftdœ‡fdd„ }ˆj|||ƒ|S)Nrz/Typez/XRefz/Indexrz/Sizez/Wr zToo many entry sizes: .)r~r8cs<ˆ|dkr(ˆjˆ|ƒ}t|ˆ|ƒS|dkr4dSdSdS)Nrr)rKr)r~Úd)Ú entry_sizesr‹rZr[Ú get_entry«s  z4PdfReader._read_pdf15_xref_stream..get_entry)rÌr‰r8cs|ˆjj|gƒkp|ˆjkS)N)r@rPrB)rÌr‰)rWrZr[Ú used_before¹sz6PdfReader._read_pdf15_xref_stream..used_beforer†)rqr“rr%r1rIr‚r›rr‡rPr rÚlenr6r!r�rr ÚboolÚ_read_xref_subsections)rWr5r}r‰rÖÚ idx_pairsrãrärZ)rârWr‹r[rÓ™s  &&z!PdfReader._read_pdf15_xref_streamcCs”|j|ddƒ|jdƒ}|dkr,|jdƒ}|dkr8dS|jdƒ}|dkr�d}x"|dkrp|jdƒ}|dkrPd SqPW||jd ƒ7}|jƒd kr�d SdS) zæ Return an int which indicates an issue. 0 means there is no issue. Args: stream: startxref: Returns: 0 means no issue, other values represent specific issues. rrójs ésxrefr<s 0123456789 ésobjr )rqrKÚlower)r5r²r½rZrZr[r¬Ás"       zPdfReader._get_xref_issuescCs4i|_|jddƒ|jdƒ}xXtjd|ƒD]H}t|jdƒƒ}t|jdƒƒ}||jkr^i|j|<|jdƒ|j||<q*Wtdt ƒ�x8|jD�],}�x$|j|D�]}|j|j||dƒyâ|j |ƒ}t t t ||ƒƒ} | jddƒdkrèwžt| jƒƒ} d} xft| ƒ} | jƒ�sPt| ƒ} t| ƒ| jddƒt| ƒ} | jƒ�s>Pt| ƒ}||f|j| <| d7} qúW| | jd ƒk�rštd | ›d |›d |›d | jd ƒ›d� t ƒWqžtk �r²YqžXqžWqŠW|jddƒxftjd|ƒD]V}|j|jdƒdƒt tttft ||ƒƒ}x$t|jƒƒD]\}}||j|<�qW�qÖWdS)Nrrs([\r\n \t][ \t]*(\d+)[ \t]+(\d+)[ \t]+objrëzparsing for Object Streamsz/TypeÚz/ObjStmz/Nzfound z objects within Object(r‘z ) whereas z expecteds$[\r\n \t][ \t]*trailer[\r\n \t]*(<<)r†r†)r@rqrKr–Úfinditerr�rÊr™rrFr“rr.r1rPrr‡rrÒrrBr”r rr±rrrC)rWr5Zf_rŸr}r‰Úgr~Ú_ÚoÚstrmZcptÚsZ_iZ_orÙrØrÚrZrZr[r°àsZ           "  zPdfReader._rebuild_xref_table.)rèrãrär8cCsæxà|j|ƒD]Ò\}}xÈt|||ƒD]¶}|dƒ}|dkrJ|dƒ}|dƒ} q$|dkr�|dƒ} |dƒ} | |jkrvi|j| <||| ƒsÚ| |j| |<q$|dkrÆ|dƒ} |dƒ} d} ||| ƒsÚ| | f|j|<q$|jr$td|›�ƒ‚q$Wq WdS)NrrrëzUnknown xref type: )Ú_pairsrˆr@rBr6r!)rWrèrãrär™rÍrÌZ xref_typeZnext_free_objectZnext_generationZ byte_offsetr‰Z objstr_numZ obstr_idxrZrZr[rçs*     z PdfReader._read_xref_subsections)Úarrayr8ccs>d}x4||||dfV|d7}|dt|ƒkrPqWdS)Nrrrë)rå)rWrõr~rZrZr[rô8s zPdfReader._pairs)r7r8cCs|jstdƒ‚|jj|ƒS)aÝ When using an encrypted / secured PDF file with the PDF Standard encryption handler, this function will allow the file to be decrypted. It checks the given password against the document's user password and owner password, and then stores the resulting decryption key if either password is correct. It does not matter which password was matched. Both passwords provide the correct decryption key that will allow the document to be used with this library. Args: password: The password to match. Returns: An indicator if the document was decrypted and whether it was the owner password or the user password. zNot encrypted file)rNr!rV)rWr7rZrZr[Údecrypt@szPdfReader.decryptcCs tj|jkS)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. )rQrUrC)rWrZrZr[rOXszPdfReader.is_encrypted)Únamer8cCsø|j}d|kst|dtƒ r"dStt|tdƒƒ}d|kr@dStƒ}t|ƒ|tdƒ<|tdƒ|tdƒ<|jdtdd„|jDƒƒd |ƒt ƒ}|j |j ƒ||tdƒ<xHtt |dƒD]6}|j ƒ}d |krât d |j ›d �tƒ|j |td ƒ<qºW|S) zý Add a top level form that groups all form fields below it. Args: name: text string of the "/T" Attribute of the created object Returns: The created object. ``None`` means no object was created. z /AcroFormNz/Fieldsz/Tz/KidsrcSsg|]\}}|dkr|‘qS)rrZ)rmrïr~rZrZr[ú |sz.PdfReader.add_form_topname..rz/ParentzTop Level Form Field z have a non-expected parent)rerHr'rr*r/r›Úmaxr>r$Úappendr|rSrrF)rWr÷ÚcatalogÚacroformÚinterimZarrrñr�rZrZr[Úadd_form_topnamebs2     zPdfReader.add_form_topnamecCst|j}d|kst|dtƒ r"dStt|tdƒƒ}d|kr@dStttt|tdƒƒdjƒƒ}t|ƒ|tdƒ<|S)zû Rename top level form field that all form fields below it. Args: name: text string of the "/T" field of the created object Returns: The modified object. ``None`` means no object was modified. z /AcroFormNz/Fieldsrz/T)rerHr'rr*r$rSr/)rWr÷rûrürýrZrZr[Úrename_form_topnameŒs  zPdfReader.rename_form_topname)FN)NN)DrFÚ __module__Ú __qualname__Ú__doc__rrrrærIr•r\r]r rÚ BaseExceptionrrbraÚpropertyr'rerhr$rjr r rrtrzr2r{r�r+r)r„r-r�rSrr r“r’r›r§rKr©rªr«rÏr­rÑrÕr%r(r&rÓÚ staticmethodr¬r°r rrçrôrrörOrþrÿrZrZrZr[r4[sz8    7    ;w /(&8  *r4)Ar¹r–ÚiorrZpathlibrÚtypesrÚtypingrrrr r r r r rrrZ _doc_commonrrrNrrÚ_utilsrrrrrrrrÚ constantsrrQÚerrorsrr r!r"r#Zgenericr$r%r&r'r(r)r*r+r,r-r.r/r0r1Úxmpr2Z_pager3r4rZrZrZr[Ús  4( @