
    i                         S SK r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	K	J
r
  SS
KJr  SSKJr  \" S5      r\" S5      r " S S5      rg)    N   )LIT)PDFObjectNotFound)resolve1)	int_value)
list_value)
dict_value)	PDFParser)PDFDocument)PDFTextExtractionNotAllowedPagePagesc                   d    \ rS rSrSrSrS rS r\" / SQ5      r	\
S 5       r\
  SS	 j5       rS
rg)PDFPage   a  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                    Xl         X l        [        U5      U l        [	        U R                  R                  S5      5      U l        [	        U R                  R                  S[        5       5      5      U l        [	        U R                  S   5      U l	        SU R                  ;   a  [	        U R                  S   5      U l
        OU R                  U l
        [        U R                  R                  SS5      5      S-   S-  U l        U R                  R                  S5      U l        U R                  R                  S	5      U l        S
U R                  ;   a  [	        U R                  S
   5      nO/ n[        U[         5      (       d  U/nX@l        g)zInitialize 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        C/home/kodi/my-venv/lib/python3.13/site-packages/pdfminer/pdfpage.py__init__PDFPage.__init__,   s    &


~ >?!$**..df"EF J!78

"#DJJy$9:DL==DL !!<=cASHjjnnX.ZZ^^C(
#

: 67HH(D)) zH     c                 @    SU R                   < SU R                  < S3$ )Nz<PDFPage: Resources=z, MediaBox=>)r!   r"   )r*   s    r+   __repr__PDFPage.__repr__I   s    9=WWr.   )r   r   r   r   c              #     ^ ^^#    UU U4S jmSnSTR                   ;   a6  T" TR                   S   TR                   5       H  u  p4T " TX45      v   SnM     U(       dx  TR                   Hh  nUR                  5        HQ  n TR                  U5      n[	        U[
        5      (       a'  UR                  S5      [        L a  T " TX65      v   MO  MQ  MS     Mj     g ! [         a     Mg  f = f7f)Nc              3     >#    [        U [        5      (       a+  U n[        TR                  U5      5      R	                  5       nO%U R
                  n[        U 5      R	                  5       nUR                  5        H"  u  pEUT	R                  ;   d  M  XC;  d  M  XSU'   M$     UR                  S5      [        L a\  SU;   aV  T	R                  (       a  [        R                  " SUS   -  5        [        US   5       H  nT
" Xc5       H  nUv   M	     M     g UR                  S5      [        L a0  T	R                  (       a  [        R                  " SU-  5        X#4v   g g 7f)NTypeKidszPages: Kids=%rzPage: %r)r'   intr	   getobjcopyobjiditemsINHERITABLE_ATTRSr   LITERAL_PAGESdebuglogginginfor   LITERAL_PAGE)objparentr:   treekvcxdocumentklasssearchs           r+   rK   $PDFPage.create_pages.<locals>.searchP   s    #s##!(//%"89>>@		!#++- ,,.///AMG ) xx=0Vt^;;-=V-L M#DL1A#A_ - 2 &!\1;;Z$-> ?m# 2s   B	EECEFr   Tr5   )	catalogxrefs
get_objidsr8   r'   r    r   rA   r   )rJ   rI   pagesr:   rD   xrefrB   rK   s   ``     @r+   create_pagesPDFPage.create_pagesN   s     	$$ h&&&!'(8(8(A8CSCS!THe22 "U  !__.E&ooe4%c400SWWV_5T"'%"== 6U0 / ' 	 - s+   A:C' A	C	C'
C$ C'#C$$C'Nc              #     #    [        U5      n[        XtUS9nU(       a  UR                  (       d  [        SU-  5      e[	        U R                  U5      5       H*  u  pU(       a  X;  a  M  U
v   U(       d  M   X9S-   ::  d  M*    g    g 7f)N)passwordcachingz"Text extraction is not allowed: %rr   )r
   r   is_extractabler   	enumeraterR   )rJ   fppagenosmaxpagesrU   rV   check_extractableparserr   pagenopages              r+   	get_pagesPDFPage.get_pagess   s     
 2&WES%7%7-.RUW.WXX'(:(:3(?@NVF1JxHq0 A 	s   A2B8BB)r%   r   r&   r)   r#   r   r   r"   r   r!   r$   )Nr   r.   TT)__name__
__module____qualname____firstlineno____doc__r>   r,   r1   setr<   classmethodrR   r`   __static_attributes__ r.   r+   r   r      sT    ( E:X JK" "H 5826 r.   r   )r?   psparserr   pdftypesr   r   r   r   r	   	pdfparserr
   pdfdocumentr   r   rA   r=   r   rj   r.   r+   <module>ro      sC      '         $ 4 6{G
q qr.   