Ë
    vl�j`  ã            #       óÜ  — d Z ddlZddlZddlmZmZ ddlmZ ddlm	Z	m
Z
mZ ddlmZmZmZmZmZ ddlmZ ddlmZmZ dd	lmZmZ dd
lmZ ddlmZmZ ddlm Z  ddl!m"Z"m#Z#m$Z$ 	 	 	 	 	 	 	 	 	 	 	 	 	 d$de
de"de%de%dedz  de&dee&   dz  de%de'de&de%de%dz  de(de(de(de	ddf"d„Z)	 	 	 	 	 	 d%d e#de%dee&   dz  de&d!e(de%dedz  de%fd"„Z*	 	 	 	 	 d&d e#de%dee&   dz  de&d!e(dedz  dee   fd#„Z+y)'zIFunctions that can be used for the most common use-cases for pdfminer.sixé    N)Ú	ContainerÚIterator)ÚStringIO)ÚAnyÚBinaryIOÚcast)ÚHOCRConverterÚHTMLConverterÚPDFPageAggregatorÚTextConverterÚXMLConverter)ÚImageWriter)ÚLAParamsÚLTPage)Ú	PDFDeviceÚTagExtractor)ÚPDFValueError)ÚPDFPageInterpreterÚPDFResourceManager)ÚPDFPage)ÚAnyIOÚ
FileOrNameÚopen_filenameÚinfÚoutfpÚoutput_typeÚcodecÚlaparamsÚmaxpagesÚpage_numbersÚpasswordÚscaleÚrotationÚ
layoutmodeÚ
output_dirÚstrip_controlÚdebugÚdisable_cachingÚkwargsÚreturnc           	      óô  — |r1t        j                  «       j                  t         j                  «       d}|rt	        |«      }t        | ¬«      }d}|dk7  r-|t        j                  k(  rt        j                  j                  }|dk(  rt        |||||¬«      }nw|dk(  rt        ||||||¬«      }n`|dk(  rt        |||||
||¬«      }nH|d	k(  rt        |||||¬
«      }n2|dk(  rt        |t        t        |«      |¬«      }nd|› �}t!        |«      ‚|€J ‚t#        ||«      }t%        j&                  | |||| ¬«      D ]*  }|j(                  |	z   dz  |_        |j+                  |«       Œ, |j-                  «        y)ak  Parses text from inf-file and writes to outfp file-like object.

    Takes loads of optional arguments but the defaults are somewhat sane.
    Beware laparams: Including an empty LAParams is not the same as passing
    None!

    :param inf: a file-like object to read PDF structure from, such as a
        file handler (using the builtin `open()` function) or a `BytesIO`.
    :param outfp: a file-like object to write the text to.
    :param output_type: May be 'text', 'xml', 'html', 'hocr', 'tag'.
        Only 'text' works properly.
    :param codec: Text decoding codec
    :param laparams: An LAParams object from pdfminer.layout. Default is None
        but may not layout correctly.
    :param maxpages: How many pages to stop parsing after
    :param page_numbers: zero-indexed page numbers to operate on.
    :param password: For encrypted PDFs, the password to decrypt.
    :param scale: Scale factor
    :param rotation: Rotation factor
    :param layoutmode: Default is 'normal', see
        pdfminer.converter.HTMLConverter
    :param output_dir: If given, creates an ImageWriter for extracted images.
    :param strip_control: Does what it says on the tin
    :param debug: Output more logging data
    :param disable_caching: Does what it says on the tin
    :param other:
    :return: nothing, acting as it does on two streams. Use StringIO to get
        strings.
    N©ÚcachingÚtext)r   r   ÚimagewriterÚxml)r   r   r/   ÚstripcontrolÚhtml)r   r"   r$   r   r/   Úhocr)r   r   r1   Útag)r   z1Output type can be text, html, xml or tag but is ©r   r!   r-   ih  )ÚloggingÚ	getLoggerÚsetLevelÚDEBUGr   r   ÚsysÚstdoutÚbufferr   r   r
   r	   r   r   r   r   r   r   Ú	get_pagesÚrotateÚprocess_pageÚclose)r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r/   ÚrsrcmgrÚdeviceÚmsgÚinterpreterÚpages                         úI/var/www/html/pp/venv/lib/python3.12/site-packages/pdfminer/high_level.pyÚextract_text_to_fprG      s©  € ñ^ Ü×ÑÓ×$Ñ$¤W§]¡]Ô3à€KÙÜ! *Ó-ˆä ¨_Ð)<Ô=€GØ#€Fà�fÒ ¬#¯*©*Ò!4Ü—
‘
×!Ñ!ˆà�fÒÜØØØØØ#ô
‰ð 
˜Ò	ÜØØØØØ#Ø&ô
‰ð 
˜Ò	ÜØØØØØ!ØØ#ô
‰ð 
˜Ò	ÜØØØØØ&ô
‰ð 
˜Ò	ä˜g¤t¬H°eÓ'<ÀEÔJ‰ð BÀ+ÀÐOˆÜ˜CÓ Ð àÐÐÐÜ$ W¨fÓ5€KÜ×!Ñ!ØØØØØ#Ð#ôò 'ˆð —{‘{ XÑ-°Ñ4ˆŒØ× Ñ  Õ&ð'ð ‡L�L…Nó    Úpdf_filer-   c           	      óž  — |€
t        «       }t        | d«      5 }t        «       5 }t        t        |«      }t        |¬«      }	t        |	|||¬«      }
t        |	|
«      }t        j                  |||||¬«      D ]  }|j                  |«       Œ |j                  «       cddd«       cddd«       S # 1 sw Y   nxY wddd«       y# 1 sw Y   yxY w)aw  Parse and return the text contained in a PDF file.

    :param pdf_file: Either a file path or a file-like object for the PDF file
        to be worked on.
    :param password: For encrypted PDFs, the password to decrypt.
    :param page_numbers: List of zero-indexed page numbers to extract.
    :param maxpages: The maximum number of pages to parse
    :param caching: If resources should be cached
    :param codec: Text decoding codec
    :param laparams: An LAParams object from pdfminer.layout. If None, uses
        some default settings that often work well.
    :return: a string containing all of the text extracted.
    NÚrbr,   )r   r   r5   )r   r   r   r   r   r   r   r   r   r=   r?   Úgetvalue)rI   r!   r    r   r-   r   r   ÚfpÚoutput_stringrA   rB   rD   rE   s                rF   Úextract_textrO   “   sË   € ð, ÐÜ“:ˆä	�x Ó	&ð (¨"¬h«jð (¸MÜ”(˜BÓˆÜ$¨WÔ5ˆÜ˜w¨¸UÈXÔVˆÜ(¨°&Ó9ˆä×%Ñ%ØØØØØô
ò 	+ˆDð ×$Ñ$ TÕ*ð	+ð ×%Ñ%Ó'÷(÷ (÷ (ó (ú÷ (÷ (ñ (ús#   ™C¤A7B.Â	CÂ.B7	Â3CÃCc              #   óZ  K  — |€
t        «       }t        | d«      5 }t        t        |«      }t	        |¬«      }t        ||¬«      }t        ||«      }	t        j                  |||||¬«      D ]'  }
|	j                  |
«       |j                  «       }|–— Œ) 	 ddd«       y# 1 sw Y   yxY w­w)a  Extract and yield LTPage objects

    :param pdf_file: Either a file path or a file-like object for the PDF file
        to be worked on.
    :param password: For encrypted PDFs, the password to decrypt.
    :param page_numbers: List of zero-indexed page numbers to extract.
    :param maxpages: The maximum number of pages to parse
    :param caching: If resources should be cached
    :param laparams: An LAParams object from pdfminer.layout. If None, uses
        some default settings that often work well.
    :return: LTPage objects
    NrK   r,   )r   r5   )r   r   r   r   r   r   r   r   r=   r?   Ú
get_result)rI   r!   r    r   r-   r   rM   Úresource_managerrB   rD   rE   Úlayouts               rF   Úextract_pagesrT   ¾   s²   è ø€ ð( ÐÜ“:ˆä	�x Ó	&ð ¨"Ü”(˜BÓˆÜ-°gÔ>ÐÜ"Ð#3¸hÔGˆÜ(Ð)9¸6ÓBˆÜ×%Ñ%ØØØØØô
ò 		ˆDð ×$Ñ$ TÔ*Ø×&Ñ&Ó(ˆFØ‹Lñ		÷÷ ñ üs   ‚B+›A:BÂ	B+ÂB(Â$B+)r.   úutf-8Nr   NÚ g      ð?r   ÚnormalNFFF)rV   Nr   TrU   N)rV   Nr   TN),Ú__doc__r6   r:   Úcollections.abcr   r   Úior   Útypingr   r   r   Úpdfminer.converterr	   r
   r   r   r   Úpdfminer.imager   Úpdfminer.layoutr   r   Úpdfminer.pdfdevicer   r   Úpdfminer.pdfexceptionsr   Úpdfminer.pdfinterpr   r   Úpdfminer.pdfpager   Úpdfminer.utilsr   r   r   ÚstrÚintÚfloatÚboolrG   rO   rT   © rH   rF   ú<module>ri      s  ðÙ Oã Û 
ß /Ý ß &Ñ &÷õ õ 'ß ,ß 6Ý 0ß EÝ $ß ;Ñ ;ð ØØ $ØØ*.ØØØØØ!ØØØ!ñwØ	ðwàðwð ðwð ð	wð
 ˜‰oðwð ðwð ˜C‘. 4Ñ'ðwð ðwð ðwð ðwð ðwð �d‘
ðwð ðwð ðwð ðwð  ð!wð" 
ó#wðx Ø*.ØØØØ $ñ((Øð((àð((ð ˜C‘. 4Ñ'ð((ð ð	((ð
 ð((ð ð((ð ˜‰oð((ð 	ó((ðZ Ø*.ØØØ $ñ%Øð%àð%ð ˜C‘. 4Ñ'ð%ð ð	%ð
 ð%ð ˜‰oð%ð ˆfÑô%rH   