o
    _qin                     @   s   d dl 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	 ddddd	d
ddddd
Z
dd e
D Zdd Ze jdd fddZdd ZedkrPe  dS dS )    N)PYPDFIUM_INFOPDFIUM_INFO)setup_logging)_libszRearrange/merge documentsz List/extract/edit embedded fileszExtract imageszExtract textzConvert images to PDFzPrint info on pageobjectsz Print info on document and pageszRasterize pageszTile pages (N-up)zPrint table of contents)
Zarrangeattachmentszextract-imageszextract-textZimgtopdfZpageobjectsZpdfinforenderZtileZtocc              
   C   s&   i | ]}|t d |dd qS )zpypdfium2._cli.-_)	importlibimport_modulereplace).0n r   Y/home/app/PaddleOCR-VL/.venv_paddleocr/lib/python3.10/site-packages/pypdfium2/__main__.py
<dictcomp>   s   & r   c                  C   s   t jdt jdd} | jddddt dt d	td
 j d | jdd}t	
 D ]'\}}t| }t|dd }|r>|d | n|}|j|||t jd}|| q(| S )NZ	pypdfium2zJCommand line interface to the pypdfium2 library (Python binding to PDFium))progformatter_classdescriptionz	--versionz-vversionz
pypdfium2 z
pdfium z at Zpdfium)actionr   
subcommand)destZPARSER_DESCz

)helpr   r   )argparseArgumentParserRawTextHelpFormatteradd_argumentr   r   r   _nameadd_subparsersSubCommandsitemsCmdToModulegetattr
add_parserattach)main_parserZ
subparsersnamer   modZdescZ	subparserr   r   r   
get_parser   s*   r)      c                 C   s6   t  }|| }|js|  d S t|j | d S N)r)   
parse_argsr   
print_helpr"   main)Zraw_argsparserargsr   r   r   api_main7   s   
r1   c                   C   s   t   t  d S r+   )r   r1   r   r   r   r   cli_mainC   s   
r2   __main__)sysr   r
   Zpypdfium2.versionr   r   Zpypdfium2._cli._parsersr   Zpypdfium2_raw.bindingsr   r    r"   r)   argvr1   r2   __name__r   r   r   r   <module>   s0   
