Ë
    ìì�i  ã                   ó¬   — d dl Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	l	m
Z
 dd
lmZ ddlmZ  ed«      Z ed«      Z G d„ d«      Zy)é    Né   )ÚLIT)ÚPDFObjectNotFound)Úresolve1)Ú	int_value)Ú
list_value)Ú
dict_value)Ú	PDFParser)ÚPDFDocument)ÚPDFTextExtractionNotAllowedÚPageÚPagesc                   óZ   — e Zd ZdZdZd„ Zd„ Z eg d¢«      Ze	d„ «       Z
e		 	 d	d„«       Zy)
ÚPDFPagea!  An object that holds the information about a page.

    A PDFPage object is merely a convenience class that has a set
    of keys and values, which describe the properties of a page
    and point to its contents.

    Attributes:
      doc: a PDFDocument object.
      pageid: any Python object that can uniquely identify the page.
      attrs: a dictionary of page attributes.
      contents: a list of PDFStream objects that represents the page content.
      lastmod: the last modified time of the page.
      resources: a list of resources used by the page.
      mediabox: the physical size of the page.
      cropbox: the crop rectangle of the page.
      rotate: the page rotation (in degree).
      annots: the page annotations.
      beads: a chain that represents natural reading order.
    Fc                 ó  — || _         || _        t        |«      | _        t	        | j                  j                  d«      «      | _        t	        | j                  j                  dt        «       «      «      | _        t	        | j                  d   «      | _	        d| j                  v rt	        | j                  d   «      | _
        n| j                  | _
        t        | j                  j                  dd«      «      dz   dz  | _        | j                  j                  d«      | _        | j                  j                  d	«      | _        d
| j                  v rt	        | j                  d
   «      }ng }t        |t         «      s|g}|| _        y)z½Initialize a page object.

        doc: a PDFDocument object.
        pageid: any Python object that can uniquely identify the page.
        attrs: a dictionary of page attributes.
        ÚLastModifiedÚ	ResourcesÚMediaBoxÚCropBoxÚRotater   ih  ÚAnnotsÚBÚContentsN)ÚdocÚpageidr	   Úattrsr   ÚgetÚlastmodÚdictÚ	resourcesÚmediaboxÚcropboxr   ÚrotateÚannotsÚbeadsÚ
isinstanceÚlistÚcontents)Úselfr   r   r   r(   s        úu/var/www/ITT-ServiceAPI-Services/ITT-Document-Scan/mrzscanner/mrzenv/lib/python3.12/site-packages/pdfminer/pdfpage.pyÚ__init__zPDFPage.__init__,   s!  € ð ˆŒØˆŒÜ Ó&ˆŒ
Ü §
¡
§¡¨~Ó >Ó?ˆŒÜ! $§*¡*§.¡.°¼d»fÓ"EÓFˆŒÜ  §¡¨JÑ!7Ó8ˆŒØ˜Ÿ
™
Ñ"Ü# D§J¡J¨yÑ$9Ó:ˆD�LàŸ=™=ˆDŒLÜ  §¡§¡°¸!Ó!<Ó=¸cÑAÀSÑHˆŒØ—j‘j—n‘n XÓ.ˆŒØ—Z‘Z—^‘^ CÓ(ˆŒ
Ø˜Ÿ™Ñ#Ü §
¡
¨:Ñ 6Ó7‰HàˆHÜ˜(¤DÔ)Ø �zˆHØ ˆŒØó    c                 ó<   — d| j                   ›d| j                  ›d�S )Nz<PDFPage: Resources=z, MediaBox=ú>)r    r!   )r)   s    r*   Ú__repr__zPDFPage.__repr__I   s   � Ø9=¿»ÈÏËÐWÐWr,   )r   r   r   r   c              #   ó¤  ‡ ‡‡K  — ˆˆ ˆfd„Šd}d‰j                   v r6 ‰‰j                   d   ‰j                   «      D ]  \  }} ‰ ‰||«      –— d}Œ |sk‰j                  D ]\  }|j                  «       D ]G  }	 ‰j                  |«      }t	        |t
        «      r#|j                  d«      t        u r ‰ ‰||«      –— ŒI Œ^ y # t        $ r Y ŒXw xY w­w)Nc              3   ó„  •K  — t        | t        «      r+| }t        ‰j                  |«      «      j	                  «       }n%| j
                  }t        | «      j	                  «       }|j                  «       D ]  \  }}|‰	j                  v sŒ||vsŒ|||<   Œ  |j                  d«      t        u rQd|v rM‰	j                  rt        j                  d|d   z  «       t        |d   «      D ]  } ‰
||«      D ]  }|–— Œ Œ y |j                  d«      t        u r+‰	j                  rt        j                  d|z  «       ||f–— y y ­w)NÚTypeÚKidszPages: Kids=%rzPage: %r)r&   Úintr	   ÚgetobjÚcopyÚobjidÚitemsÚINHERITABLE_ATTRSr   ÚLITERAL_PAGESÚdebugÚloggingÚinfor   ÚLITERAL_PAGE)ÚobjÚparentr7   ÚtreeÚkÚvÚcÚxÚdocumentÚklassÚsearchs           €€€r*   rH   z$PDFPage.create_pages.<locals>.searchP   s#  øè ø€ Ü˜#œsÔ#Ø�Ü! (§/¡/°%Ó"8Ó9×>Ñ>Ó@‘àŸ	™	�Ü! #“×+Ñ+Ó-�Ø Ÿ,™,›.ò  ‘��AØ˜×/Ñ/Ò/°A¸T²MØ�D˜’Gð ð �x‰x˜Ó¤=Ñ0°V¸t±^Ø—;’;¤§¡Ð-=ÀÀVÁÑ-LÔ MÜ# D¨¡LÓ1ò  �AÙ# A t›_ò  ˜Ø›ñ ñ ð —‘˜&Ó!¤\Ñ1Ø—;’;¤§¡¨Z¸$Ñ->Ô ?Ø˜d�mÓ#ð 2ùs   ƒBE Â	E ÂB2E Fr   Tr2   )	ÚcatalogÚxrefsÚ
get_objidsr5   r&   r   r   r>   r   )rG   rF   Úpagesr7   rA   Úxrefr?   rH   s   ``     @r*   Úcreate_pageszPDFPage.create_pagesN   sâ   úè ø€ ö	$ð$ ˆØ�h×&Ñ&Ñ&Ù!'¨×(8Ñ(8¸Ñ(AÀ8×CSÑCSÓ!Tò ‘�˜Ù˜H e¨TÓ2Ò2Ø‘ðñ à Ÿ™ò �Ø!Ÿ_™_Ó.ò �EðØ&Ÿo™o¨eÓ4˜Ü% c¬4Ô0°S·W±W¸V³_ÌÑ5TÙ"'¨°%¸Ó"=Ò=øñ	ðð 	øô -ò Ùðüs+   …A2CÁ8ACÂ<CÃ	CÃ
CÃCÃCNc              #   óê   K  — t        |«      }t        |||¬«      }|r|j                  st        d|z  «      ‚t	        | j                  |«      «      D ]  \  }	}
|r|	|vrŒ|
–— |sŒ||	dz   k  sŒ y  y ­w)N)ÚpasswordÚcachingz"Text extraction is not allowed: %rr   )r
   r   Úis_extractabler   Ú	enumeraterN   )rG   ÚfpÚpagenosÚmaxpagesrP   rQ   Úcheck_extractableÚparserr   ÚpagenoÚpages              r*   Ú	get_pageszPDFPage.get_pagess   sŠ   è ø€ ô
 ˜2“ˆä˜&¨8¸WÔEˆá S×%7Ò%7Ü-Ð.RÐUWÑ.WÓXÐXä'¨×(:Ñ(:¸3Ó(?Ó@ò 	‰NˆV�TÙ˜F¨'Ñ1ØØŠJÚ˜H¨¨q©Ó0ØØð	ð 	ùs   ‚A#A3Á&A3Á/A3)Nr   r,   TT)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r;   r+   r/   Úsetr9   ÚclassmethodrN   r[   © r,   r*   r   r      sT   „ ñð( €Eòò:Xñ ÒJÓKÐàñ"ó ð"ðH à58Ø26òó ñr,   r   )r<   Úpsparserr   Úpdftypesr   r   r   r   r	   Ú	pdfparserr
   Úpdfdocumentr   r   r>   r:   r   rb   r,   r*   ú<module>rg      sC   ðã Ý Ý 'Ý Ý Ý  Ý  Ý  Ý $Ý 4ñ �6‹{€Ù�G“€÷
qò qr,   