
    ,hZ#                         d Z ddlZddlZddlZddlZddlZddlZddlm	Z	  ej                          g ddddddddddddddd	dd
dddfdZd ZddZedk(  r ej                   e              yy)zkA command line tool for extracting text and images from PDF and output it to plain text, html, xml or tags.    N)ImageWriter-Ftextutf-8       ?normalc                 \   d|cxv rt        d       | st        d      |sPt        j                  j	                         }dD ],  }t               j                  |d       }| t        |||       . nd }d }|rt        |      }|	dk(  r#|dk7  rdD ]  \  }}|j                  |      s|}	 |dk(  rt        j                  }|j                  d}
nt        |d	      }| D ]?  }t        |d
      5 }t        j                  j                  |fi t                d d d        A |S # 1 sw Y   MxY w)N_py2_no_more_posargszThe `_py2_no_more_posargs will be removed on January, 2020. At that moment pdfminer.six will stop supporting Python 2. Please upgrade to Python 3. For more information see https://github.com/pdfminer/pdfminer .six/issues/194z Must provide files to work upon!)	all_textsdetect_verticalword_marginchar_marginline_margin
boxes_flowr   r   )z.htmhtml)z.htmlr   )z.xmlxml)z.tagtagr   wbrb)DeprecationWarning
ValueErrorpdfminerlayoutLAParamslocalsgetsetattrr   endswithsysstdoutencodingopen
high_levelextract_text_to_fp)filesoutfileno_laparamsr   r   r   r   r   r   output_typecodecstrip_controlmaxpagespage_numberspasswordscalerotation
layoutmode
output_dirdebugdisable_cachingkwargslaparamsparamparamvimagewriteroverridealttypeoutfpfnamefps                                  V/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/../../../bin/pdf2txt.pyextract_textrA      s`    3 CD 	D 4 ;<< ??++-p 	1EX\\%.F!%0	1
 K!*-fC"6 	&Hg )%	& #~

>>%EWd#  C% 	C"222BB	C 	CC L	C 	Cs   -)D""D+	c                     t        j                  t        d      } | j                  dt        d dd       | j                  ddd	d
d       | j                  ddd	d
d       | j                  dd      }|j                  dt        d dd       |j                  ddt        d       |j                  ddt        dd       |j                  ddt        d d!       |j                  d"d#dt        d$%       | j                  d&d'      }|j                  d(d)d	d
d*       |j                  d+d,d	d
d-       |j                  d.d/t        d0d1       |j                  d2d3t        d4d5       |j                  d6d7t        d8d9       |j                  d:d;t        d8d<       |j                  d=d>dd
d?       | j                  d@dA      }|j                  dBdCt        dDdE       |j                  dFdGt        dHdI       |j                  dJdKt        dLdM       |j                  dNdOd dPQ       |j                  dRdSdTt        dU%       |j                  dVdWt        dXdY       |j                  dZd[d	d
d\       | S )]NT)descriptionadd_helpr'   +zOne or more paths to PDF files.)typedefaultnargshelpz--debugz-dF
store_truezUse debug logging level.)rG   actionrI   z--disable-cachingz-Cz;If caching or resources, such as fonts, should be disabled.ParserzUsed during PDF parsing)rC   z--page-numbersz0A space-seperated list of page numbers to parse.z	--pagenosz-pzA comma-separated list of page numbers to parse. Included for legacy applications, use --page-numbers for more idiomatic argument entry.)rF   rI   z
--maxpagesz-mr   z%The maximum number of pages to parse.)rF   rG   rI   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.)rG   rF   rI   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--char-marginz-Mg       @zIf two characters are closer together than this margin they are considered to be part of the same word. The margin is specified relative to the width of the character.z--word-marginz-Wg?zIf two words are are closer together than this margin they are considered to be part of the same line. A space is added in between for readability. The margin is specified relative to the width of the word.z--line-marginz-Lg      ?zIf two lines are 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-FzSpecifies 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).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.)rG   rI   z--layoutmodez-Yr	   a3  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.)argparseArgumentParser__doc__add_argumentstradd_argument_groupintfloat)parserparse_params	la_paramsoutput_paramss       r@   maketheparserrZ   D   s*   $$4HF
c4sIjk
	4|7  9
+T5Z  \ ,,XC\,]L.S$c#U  Wk4c$[  \ lDsA#J  LlDsB#Q  SlD!##n  p ))*;Ig)hI?D% R  T.eL ^  `?Duc!t  u ?Duc!O  P ?Duc!g  h >4eS!i  j =$\ \  ^ --hDd-eM{DsC$r  t3$U  Wy$S'$J  L~tT%1  2 ~tXC%s  t
 y$UC%/  0 0$l$l  nM    c                    t               }|j                  |       }|j                  r+t        |j                  D cg c]  }|dz
  	 c}      |_        |j                  rCt        |j                  j                  d      D cg c]  }t        |      dz
   c}      |_        d }|j                  rt        |j                        }t        j                  rRt        j                  j                  r8|j                  j                  t        j                  j                        |_        |j                   dk(  r<|j"                  dk7  r-dD ](  \  }}|j"                  j%                  |      s"||_        * |j"                  dk(  r$t        j&                  }|j                  d|_        nt+        |j"                  d      }t-        d
i t/        |      }|j1                          y	c c}w c c}w )N)args   ,r   r   r   r   r   r    )rZ   
parse_argsr.   setpagenossplitrT   r3   r   sixPY2r!   stdinr#   r/   decoder*   r(   r    r"   r+   r$   rA   varsclose)r]   PAxr:   r;   r<   r=   s           r@   mainrn      sf   A	$A~~1>>:aac:;yy		0DE1c!fQhEFK||!!,,/
ww399%%ZZ&&syy'9'9:
}}199#3"8 	(Hg yy!!(+ '	( 	yyC

>>%AGQYY% #47#E	KKM= ;Es   G!G&__main__)N)rP   rN   loggingr!   re   pdfminer.high_levelr   pdfminer.layoutpdfminer.imager   basicConfigrA   rZ   rn   __name__exitr`   r[   r@   <module>rw      s    q   
 
   &     3t$DTgUTBcAD!3l@L$N z8388DF+r[   