File: //lib/python3/dist-packages/pdfminer/__pycache__/high_level.cpython-38.pyc
U
�R�]�
� @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZm Z ddl
mZmZ ddl
mZ dd lmZmZmZ dd
lmZ ddlmZ ddd�ZdS )z�
Functions that encapsulate "usual" use-cases for pdfminer, for use making
bundled scripts and for using pdfminer as a module for routine tasks.
� N� )�PDFDocument)� PDFParser)�PDFResourceManager�PDFPageInterpreter)� PDFDevice�TagExtractor)�PDFPage)�XMLConverter�
HTMLConverter�
TextConverter)�CMapDB)�ImageWriter�text�utf-8� � �?�normalFc K s t jrtjjr|�tjj�}d}|r,t|�}t| d�}|dkrRt|||||d�}t j rj|tj
krjtj
j}|dkr�t||||||
d�}n6|dkr�t
|||| |||d�}n|d kr�t|||d
�}t||�}tj| |||| dd�D ]}|j|
d
|_|�|� q�|�� dS )a
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!
Returns nothing, acting as it does on two streams. Use StringIO to get strings.
output_type: May be 'text', 'xml', 'html', 'tag'. Only 'text' works properly.
codec: Text decoding codec
laparams: An LAParams object from pdfminer.layout.
Default is None but may not layout correctly.
maxpages: How many pages to stop parsing after
page_numbers: zero-indexed page numbers to operate on.
password: For encrypted PDFs, the password to decrypt.
scale: Scale factor
rotation: Rotation factor
layoutmode: Default is 'normal', see pdfminer.converter.HTMLConverter
output_dir: If given, creates an ImageWriter for extracted images.
strip_control: Does what it says on the tin
debug: Output more logging data
disable_caching: Does what it says on the tin
N)�cachingr )�codec�laparams�imagewriterZxml)r r r ZstripcontrolZhtml)r �scale�
layoutmoder r �tag)r T)�maxpages�passwordr Zcheck_extractableih )�sixZPY2�sys�stdin�encoding�decoder r r ZPY3�stdout�bufferr
r r r r Z get_pages�rotateZprocess_page�close)�infZoutfpZ_py2_no_more_posargsZoutput_typer r r Zpage_numbersr r Zrotationr Z
output_dirZ
strip_control�debugZdisable_caching�otherr ZrsrcmgrZdeviceZinterpreterZpage� r) �5/usr/lib/python3/dist-packages/pdfminer/high_level.py�extract_text_to_fp sH
�
�
�
�
r+ )Nr r Nr Nr r r r NFFF)�__doc__r r Zpdfdocumentr Z pdfparserr Z pdfinterpr r Z pdfdevicer r Zpdfpager Z converterr
r r Zcmapdbr
Zimager r+ r) r) r) r* �<module> s2 �