§
    Æ‡tj`  ã            #       óö  — 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+dS ).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Útextúutf-8Ú ç      ð?ÚnormalFÚinfÚoutfpÚoutput_typeÚcodecÚlaparamsÚmaxpagesÚpage_numbersÚpasswordÚscaleÚrotationÚ
layoutmodeÚ
output_dirÚstrip_controlÚdebugÚdisable_cachingÚkwargsÚreturnc           	      ó:  — |r0t          j        ¦   «                              t           j        ¦  «         d}|rt	          |¦  «        }t          | ¬¦  «        }d}|dk    r!|t          j        k    rt          j        j        }|dk    rt          |||||¬¦  «        }n”|dk    rt          ||||||¬¦  «        }nx|dk    rt          |||||
||¬¦  «        }n[|d	k    rt          |||||¬
¦  «        }n@|dk    r&t          |t          t          |¦  «        |¬¦  «        }nd|› �}t!          |¦  «        ‚|€J ‚t#          ||¦  «        }t%          j        | |||| ¬¦  «        D ])}|j        |	z   dz  |_        |                     |¦  «         Œ*|                     ¦   «          dS )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©Úcachingr   )r"   r#   ÚimagewriterÚxml)r"   r#   r3   ÚstripcontrolÚhtml)r"   r'   r)   r#   r3   Úhocr)r"   r#   r5   Útag)r"   z1Output type can be text, html, xml or tag but is ©r$   r&   r2   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.   r3   ÚrsrcmgrÚdeviceÚmsgÚinterpreterÚpages                         úQ/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/pdfminer/high_level.pyÚextract_text_to_fprK      s$  € ð^ ð 4ÝÔÑÔ×$Ò$¥W¤]Ñ3Ô3Ð3à€KØð .Ý! *Ñ-Ô-ˆå ¨_Ð)<Ð=Ñ=Ô=€GØ#€Fà�fÒÐ ­#¬*Ò!4Ð!4Ý”
Ô!ˆà�fÒÐÝØØØØØ#ð
ñ 
ô 
ˆˆð 
˜Ò	Ð	ÝØØØØØ#Ø&ð
ñ 
ô 
ˆˆð 
˜Ò	Ð	ÝØØØØØ!ØØ#ð
ñ 
ô 
ˆˆð 
˜Ò	Ð	ÝØØØØØ&ð
ñ 
ô 
ˆˆð 
˜Ò	Ð	å˜g¥t­H°eÑ'<Ô'<ÀEÐJÑJÔJˆˆð PÀ+ÐOÐOˆÝ˜CÑ Ô Ð àÐÐÐÝ$ W¨fÑ5Ô5€KÝÔ!ØØØØØ#Ð#ðñ ô ð 'ð 'ˆð ”{ XÑ-°Ñ4ˆŒØ× Ò  Ñ&Ô&Ð&Ð&à
‡L‚L�N„N€N€N€Nó    TÚpdf_filer2   c           	      óö  — |€t          ¦   «         }t          | d¦  «        5 }t          ¦   «         5 }t          t          |¦  «        }t          |¬¦  «        }	t          |	|||¬¦  «        }
t          |	|
¦  «        }t          j	        |||||¬¦  «        D ]}| 
                    |¦  «         Œ|                     ¦   «         cddd¦  «         cddd¦  «         S # 1 swxY w Y   ddd¦  «         dS # 1 swxY w Y   dS )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Úrbr1   )r"   r#   r9   )r   r   r   r   r   r   r   r   r   rA   rC   Úgetvalue)rM   r&   r%   r$   r2   r"   r#   ÚfpÚoutput_stringrE   rF   rH   rI   s                rJ   Úextract_textrS   “   s£  € ð, ÐÝ‘:”:ˆå	�x Ñ	&Ô	&ð (¨"­h©j¬jð (¸MÝ•(˜BÑÔˆÝ$¨WÐ5Ñ5Ô5ˆÝ˜w¨¸UÈXÐVÑVÔVˆÝ(¨°&Ñ9Ô9ˆåÔ%ØØØØØð
ñ 
ô 
ð 	+ð 	+ˆDð ×$Ò$ TÑ*Ô*Ð*Ð*à×%Ò%Ñ'Ô'ð(ð (ð (ð (ñ (ô (ð (ð (ð (ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (ð (ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (ð (ð (s5   ¡C.°BCÂ=C.ÃC	ÃC.ÃC	ÃC.Ã.C2Ã5C2c              #   óœ  K  — |€t          ¦   «         }t          | d¦  «        5 }t          t          |¦  «        }t	          |¬¦  «        }t          ||¬¦  «        }t          ||¦  «        }	t          j        |||||¬¦  «        D ]/}
|	 	                    |
¦  «         | 
                    ¦   «         }|V — Œ0	 ddd¦  «         dS # 1 swxY w Y   dS )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
    NrO   r1   )r#   r9   )r   r   r   r   r   r   r   r   rA   rC   Ú
get_result)rM   r&   r%   r$   r2   r#   rQ   Úresource_managerrF   rH   rI   Úlayouts               rJ   Úextract_pagesrX   ¾   s2  è è € ð( ÐÝ‘:”:ˆå	�x Ñ	&Ô	&ð ¨"Ý•(˜BÑÔˆÝ-°gÐ>Ñ>Ô>ÐÝ"Ð#3¸hÐGÑGÔGˆÝ(Ð)9¸6ÑBÔBˆÝÔ%ØØØØØð
ñ 
ô 
ð 		ð 		ˆDð ×$Ò$ TÑ*Ô*Ð*Ø×&Ò&Ñ(Ô(ˆFØˆLˆLˆLˆLð		ðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   £BCÃCÃC)r   r   Nr   Nr   r   r   r   NFFF)r   Nr   Tr   N)r   Nr   TN),Ú__doc__r:   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ÚboolrK   rS   rX   © rL   rJ   ú<module>rj      sh  ðØ OÐ Oà €€€Ø 
€
€
€
Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø Ð Ð Ð Ð Ð Ø &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &ðð ð ð ð ð ð ð ð ð ð ð ð ð ð 'Ð &Ð &Ð &Ð &Ð &Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ $Ð $Ð $Ð $Ð $Ð $Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;ð ØØ $ØØ*.ØØØØØ!ØØØ!ðwð wØ	ðwàðwð ðwð ð	wð
 ˜‰oðwð ðwð ˜C”. 4Ñ'ðwð ðwð ðwð ðwð ðwð �d‘
ðwð ðwð ðwð ðwð  ð!wð" 
ð#wð wð wð wðx Ø*.ØØØØ $ð((ð ((Øð((àð((ð ˜C”. 4Ñ'ð((ð ð	((ð
 ð((ð ð((ð ˜‰oð((ð 	ð((ð ((ð ((ð ((ðZ Ø*.ØØØ $ð%ð %Øð%àð%ð ˜C”. 4Ñ'ð%ð ð	%ð
 ð%ð ˜‰oð%ð ˆfÔð%ð %ð %ð %ð %ð %rL   