o
    j                     @   s@   d dl Z d dlZd dlmZ dd Zdd ZG dd deZdS )	    Nfind_libraryc                  C   s   t d} | d uS )Ngsr   library r   j/var/www/html/fyndo/pharma/fyndo/venv/lib/python3.10/site-packages/camelot/backends/ghostscript_backend.pyinstalled_posix   s   r	   c                  C   s,   t ddtttjd df} | d uS )N gsdll   z.dll)r   joinstrctypessizeofc_voidpr   r   r   r   installed_windows   s   r   c                   @   s   e Zd Zdd ZdddZdS )GhostscriptBackendc                 C   s&   t jdv rt S t jdkrt S t S )N)linuxdarwinwin32)sysplatformr	   r   )selfr   r   r   	installed   s
   

zGhostscriptBackend.installed,  c                 C   s>   |   stddd l}dddd|d| |g}|j|  d S )NzGhostscript is not installed. You can install it using the instructions here: https://camelot-py.readthedocs.io/en/master/user/install-deps.htmlr   r   z-qz-sDEVICE=png16mz-oz-r)r   OSErrorghostscriptGhostscript)r   pdf_pathpng_path
resolutionr   
gs_commandr   r   r   convert   s   	zGhostscriptBackend.convertN)r   )__name__
__module____qualname__r   r#   r   r   r   r   r      s    r   )r   r   ctypes.utilr   r	   r   objectr   r   r   r   r   <module>   s   