§
    dÒ³gH&  ã            #       óö  — d Z ddlZddlZddlZddlmZmZmZmZm	Z	 ddl
ZddlmZ ddlmZ  ej        ¦   «          dZdede	e         fd	„Zg d
dddddddddddddfdee         dede	e         dedededede	ee                  dedededede	e         deded edef"d!„Zdej        fd"„Zd#e	ee                  dej        fd$„Zd'd#e	ee                  defd%„Zed&k    r ej         e¦   «         ¦  «         dS dS )(zkA command line tool for extracting text and images from PDF and
output it to plain text, html, xml or tags.é    N)ÚAnyÚ	ContainerÚIterableÚListÚOptional)ÚLAParams)ÚAnyIO))z.htmÚhtml)z.htmlr
   )z.xmlÚxml)z.tagÚtagÚxÚreturnc                 óä   — |                       ¦   «                              ¦   «         dk    rd S 	 t          | ¦  «        S # t          $ r( t	          j        d                     | ¦  «        ¦  «        ‚w xY w)NÚdisabledzinvalid float value: {})ÚlowerÚstripÚfloatÚ
ValueErrorÚargparseÚArgumentTypeErrorÚformat)r   s    úR/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/../../../bin/pdf2txt.pyÚfloat_or_disabledr      st   € Ø‡w‚w�y„y‡‚ÑÔ˜JÒ&Ð&ØˆtðNÝ�Q‰xŒxˆøÝð Nð Nð NÝÔ(Ð)B×)IÒ)IÈ!Ñ)LÔ)LÑMÔMÐMðNøøøs	   ®= ½2A/ú-Útextúutf-8FÚ ç      ð?ÚnormalÚfilesÚoutfileÚlaparamsÚoutput_typeÚcodecÚstrip_controlÚmaxpagesÚpage_numbersÚpasswordÚscaleÚrotationÚ
layoutmodeÚ
output_dirÚdebugÚdisable_cachingÚkwargsc                 ó”  — | st          d¦  «        ‚|dk    r*|dk    r$t          D ]\  }}|                     |¦  «        r|}Œ|dk    r t          j        }t          j        j        �d}nt          |d¦  «        }| D ]M}t          |d¦  «        5 }t          j        j	        |fi t          ¦   «         ¤Ž d d d ¦  «         n# 1 swxY w Y   ŒN|S )Nz Must provide files to work upon!r   r   r   ÚwbÚrb)r   ÚOUTPUT_TYPESÚendswithÚsysÚstdoutÚencodingÚopenÚpdfminerÚ
high_levelÚextract_text_to_fpÚlocals)r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   ÚoverrideÚalttypeÚoutfpÚfnameÚfps                        r   Úextract_textrB      s7  € ð$ ð =ÝÐ;Ñ<Ô<Ð<à�fÒÐ ¨C¢ Ý!-ð 	&ð 	&ÑˆH�gØ×Ò Ñ)Ô)ð &Ø%�øà�#‚~€~Ý”zˆÝŒ:ÔÐ*ØˆEøå�W˜dÑ#Ô#ˆàð Cð CˆÝ�%˜ÑÔð 	C "ÝÔÔ2°2ÐBÐB½¹¼ÐBÐBÐBð	Cð 	Cð 	Cñ 	Cô 	Cð 	Cð 	Cð 	Cð 	Cð 	Cð 	Cøøøð 	Cð 	Cð 	Cð 	Cøà€Ls   Â$B<Â<C 	ÃC 	c                  óÚ  — t          j        t          d¬¦  «        } |                      dt          d dd¬¦  «         |                      ddd	d
                     t          j        ¦  «        ¬¦  «         |                      ddddd¬¦  «         |                      ddddd¬¦  «         |                      dd¬¦  «        }|                     dt          d dd¬¦  «         |                     ddt          d¬¦  «         |                     ddt          d d!¬"¦  «         |                     d#d$t          d%d&¬"¦  «         |                     d'd(d t          d)¬*¦  «         t          ¦   «         }|                      d+d,¬¦  «        }|                     d-d.ddd/¬¦  «         |                     d0d1|j        dd2¬¦  «         |                     d3t          |j        d4¬"¦  «         |                     d5d6t          |j        d7¬"¦  «         |                     d8d9t          |j        d:¬"¦  «         |                     d;d<t          |j        d=¬"¦  «         |                     d>d?t"          |j        d@¬"¦  «         |                     dAdB|j        ddC¬¦  «         |                      dDdE¬¦  «        }|                     dFdGt          dHdI¬"¦  «         |                     dJdKt          dLdM¬"¦  «         |                     dNdOt          dPdQ¬"¦  «         |                     dRdSd dT¬U¦  «         |                     dVdWdXt          dY¬*¦  «         |                     dZd[t          d\d]¬"¦  «         |                     d^d_ddd`¬¦  «         | S )aNT)ÚdescriptionÚadd_helpr    ú+zOne or more paths to PDF files.)ÚtypeÚdefaultÚnargsÚhelpz	--versionz-vÚversionzpdfminer.six v{})ÚactionrK   z--debugz-dFÚ
store_truezUse debug logging level.)rH   rL   rJ   z--disable-cachingz-Cz;If caching or resources, such as fonts, should be disabled.ÚParserzUsed during PDF parsing)rD   z--page-numbersz0A space-seperated list of page numbers to parse.z	--pagenosz-pzˆA comma-separated list of page numbers to parse. Included for legacy applications, use --page-numbers for more idiomatic argument entry.)rG   rJ   z
--maxpagesz-mr   z%The maximum number of pages to parse.)rG   rH   rJ   z
--passwordz-Pr   z,The password to use for decrypting PDF file.z
--rotationz-RzIThe number of degrees to rotate the PDF before other types of processing.)rH   rG   rJ   zLayout analysiszUsed during layout analysis.z--no-laparamsz-nz0If layout analysis parameters should be ignored.z--detect-verticalz-Vz<If vertical text should be considered during layout analysisz--line-overlapz¥If two characters have more overlap than this they are considered to be on the same line. The overlap is specified relative to the minimum height of both characters.z--char-marginz-Mz§If two characters are closer together than this margin they are considered to be part of the same line. The margin is specified relative to the width of the character.z--word-marginz-WzñIf two characters on the same line are further apart than this margin then they are considered to be two separate words, and an intermediate space will be added for readability. The margin is specified relative to the width of the character.z--line-marginz-Lz�If two lines are close together they are considered to be part of the same paragraph. The margin is specified relative to the height of a line.z--boxes-flowz-Fa�  Specifies how much a horizontal and vertical position of a text matters when determining the order of lines. The value should be within the range of -1.0 (only horizontal position matters) to +1.0 (only vertical position matters). You can also pass `disabled` to disable advanced layout analysis, and instead return text based on the position of the bottom left corner of the text box.z--all-textsz-Az:If layout analysis should be performed on text in figures.ÚOutputzUsed during output generation.z	--outfilez-or   zJPath to file where output is written. Or "-" (default) to write to stdout.z--output_typez-tr   z/Type of output to generate {text,html,xml,tag}.z--codecz-cr   z$Text encoding to use in output file.z--output-dirz-OzXThe output directory to put extracted images in. If not given, images are not extracted.)rH   rJ   z--layoutmodez-Yr   a2  Type of layout to use when generating html {normal,exact,loose}. If normal,each line is positioned separately in the html. If exact, each character is positioned separately in the html. If loose, same result as normal but with an additional newline after each text line. Only used when output_type is html.z--scalez-sr   zXThe amount of zoom to use when generating html file. Only used when output_type is html.z--strip-controlz-SzFRemove control statement from text. Only used when output_type is xml.)r   ÚArgumentParserÚ__doc__Úadd_argumentÚstrr   r9   Ú__version__Úadd_argument_groupÚintr   Údetect_verticalr   Úline_overlapÚchar_marginÚword_marginÚline_marginr   Ú
boxes_flowÚ	all_texts)ÚparserÚparse_paramsÚ	la_paramsÚla_param_groupÚoutput_paramss        r   Úcreate_parserrc   B   s  € ÝÔ$µÀ4ÐHÑHÔH€FØ
×ÒØÝØØØ.ð ñ ô ð ð ×ÒØØØØ"×)Ò)­(Ô*>Ñ?Ô?ð	 ñ ô ð ð ×ÒØØØØØ'ð ñ ô ð ð ×ÒØØØØØJð ñ ô ð ð ×,Ò,ØÐ7ð -ñ ô €Lð ×ÒØÝØØØ?ð ñ ô ð ð ×ÒØØÝð-ð	 ñ ô ð ð ×ÒØØÝØØ4ð ñ ô ð ð ×ÒØØÝØØ;ð ñ ô ð ð ×ÒØØØÝð,ð ñ ô ð õ ‘
”
€IØ×.Ò.ØÐ'Eð /ñ ô €Nð ×ÒØØØØØ?ð  ñ ô ð ð ×ÒØØØÔ)ØØKð  ñ ô ð ð ×ÒØÝØÔ&ð=ð	  ñ ô ð ð ×ÒØØÝØÔ%ð<ð  ñ ô ð ð ×ÒØØÝØÔ%ð?ð  ñ 	ô 	ð 	ð ×ÒØØÝØÔ%ð,ð  ñ ô ð ð ×ÒØØÝØÔ$ð"ð  ñ ô ð ð ×ÒØØØÔ#ØØIð  ñ ô ð ð ×-Ò-ØÐ>ð .ñ ô €Mð ×ÒØØÝØð/ð ñ ô ð ð ×ÒØØÝØØ>ð ñ ô ð ð ×ÒØØÝØØ3ð ñ ô ð ð ×ÒØØØð$ð	 ñ ô ð ð ×ÒØØØÝð9ð ñ ô ð ð ×ÒØØÝØð.ð ñ ô ð ð ×ÒØØØØð-ð ñ ô ð ð €Mó    Úargsc           	      ó  — t          ¦   «                              | ¬¦  «        }|j        rd |_        n>t	          |j        |j        |j        |j        |j	        |j
        |j        ¬¦  «        |_        |j        rd„ |j        D ¦   «         |_        |j        r)d„ |j                             d¦  «        D ¦   «         |_        |j        dk    r9|j        dk    r.t"          D ]&\  }}|j                             |¦  «        r||_        Œ'|S )N)re   )rX   rY   r[   rZ   r\   rW   r]   c                 ó   — h | ]}|d z
  ’ŒS ©é   © ©Ú.0r   s     r   ú	<setcomp>zparse_args.<locals>.<setcomp>(  s   € Ð#LÐ#LÐ#L¨a A¨¡EÐ#LÐ#LÐ#Lrd   c                 ó2   — h | ]}t          |¦  «        d z
  ’ŒS rh   )rV   rk   s     r   rm   zparse_args.<locals>.<setcomp>+  s"   € Ð#WÐ#WÐ#W°1¥C¨¡F¤F¨Q¡JÐ#WÐ#WÐ#Wrd   ú,r   r   )rc   Ú
parse_argsÚno_laparamsr"   r   rX   rY   r[   rZ   r\   rW   r]   r'   ÚpagenosÚsplitr#   r!   r3   r4   )re   Úparsed_argsr=   r>   s       r   rp   rp     s'  € Ý‘/”/×,Ò,°$Ð,Ñ7Ô7€Kð Ôð 
Ø#ˆÔÐå'Ø$Ô1Ø#Ô/Ø#Ô/Ø#Ô/Ø"Ô-Ø'Ô7Ø!Ô+ð 
ñ  
ô  
ˆÔð Ôð MØ#LÐ#L°;Ô3KÐ#LÑ#LÔ#LˆÔ àÔð XØ#WÐ#W¸Ô8K×8QÒ8QÐRUÑ8VÔ8VÐ#WÑ#WÔ#WˆÔ àÔ &Ò(Ð(¨[Ô-@ÀCÒ-GÐ-GÝ!-ð 	2ð 	2ÑˆH�gØÔ"×+Ò+¨HÑ5Ô5ð 2Ø*1�Ô'øàÐrd   c                 ó~   — t          | ¦  «        }t          di t          |¦  «        ¤Ž}|                     ¦   «          dS )Nr   rj   )rp   rB   ÚvarsÚclose)re   rt   r?   s      r   Úmainrx   5  s<   € Ý˜TÑ"Ô"€KÝÐ-Ð-�4 Ñ,Ô,Ð-Ð-€EØ	‡K‚K�M„M€MØˆ1rd   Ú__main__)N)rQ   r   Úloggingr5   Útypingr   r   r   r   r   Úpdfminer.high_levelr9   Úpdfminer.layoutr   Úpdfminer.utilsr	   ÚbasicConfigr3   rS   r   r   ÚboolrV   rB   rP   rc   Ú	Namespacerp   rx   Ú__name__Úexitrj   rd   r   ú<module>r„      s€  ðð/ð /à €€€Ø €€€Ø 
€
€
€
Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;à Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ø  Ð  Ð  Ð  Ð  Ð  à €Ô Ñ Ô Ð àV€ðN˜ð N ¨%¤ð Nð Nð Nð Nð ØØ#'ØØØØØ-1ØØØØØ $ØØ!ð$ð $Ø�CŒ=ð$àð$ð �xÔ ð$ð ð	$ð
 ð$ð ð$ð ð$ð ˜9 Sœ>Ô*ð$ð ð$ð ð$ð ð$ð ð$ð ˜”ð$ð ð$ð ð$ð  ð!$ð" ð#$ð $ð $ð $ðNQ�xÔ.ð Qð Qð Qð Qðh�X˜d 3œiÔ(ð ¨XÔ-?ð ð ð ð ð>ð ˆx˜˜Sœ	Ô"ð ¨cð ð ð ð ð ˆzÒÐØ€C„HˆTˆT‰VŒVÑÔÐÐÐð Ðrd   