
    TAi                         S r SSKrSSKrSSKrSSKrSSKJr  \R                  R                  \R                  5      \R                  -   \R                  S   -   r " S S\5      rg)zCreates a poppler backend class to convert a pdf to a png file.

Raises
------
OSError
    [description]
ValueError
    [description]
    N)ConversionBackendPATHc            	       6    \ rS rSrSrS
S\S\S\SS4S jjrS	rg)PopplerBackend   z3Classmethod to create a poplerBackendBackend class.pdf_pathpng_path
resolutionreturnNc                 &   [         R                  " S[        S9nUc  [        S5      eXAU/n [        R
                  " SR                  U5      [        R                  SS9  g! [        R                   a  n[        UR                  5      UeSnAff = f)zConvert PDF to png.

Parameters
----------
pdf_path : str
    Path where to read the pdf file.
png_path : str
    Path where to save png file.

Raises
------
OSError
    [description]
ValueError
    [description]
pdftopng)pathNzWpdftopng is not installed. You can install it using the 'pip install pdftopng' command. F)stderrshell)shutilwhichr   OSError
subprocesscheck_outputjoinSTDOUTCalledProcessError
ValueErroroutput)selfr   r	   r
   pdftopng_executablepdftopng_commandes          \/var/www/html/land-ocr/venv/lib/python3.13/site-packages/camelot/backends/poppler_backend.pyconvertPopplerBackend.convert   s    " %ll:DA&i  08D	.##)*!((
 ,, 	.QXX&A-	.s   3A! !B5BB )i,  )	__name__
__module____qualname____firstlineno____doc__strintr!   __static_attributes__r#       r    r   r      s+    = .  .s  .  .d  .  .r,   r   )r(   osr   r   syscamelot.backends.baser   r   dirname
executablepathsepenvironr   r#   r,   r    <module>r4      sW    
   
 3 
wws~~&3bjj6HH#.& #.r,   