o
    &zh
                     @   s   d dl mZ ddlmZmZ ddlmZmZ ddgZde	de	d	ed
e
de
de
fddZ	dde	de	d	ed
e
de
de
fddZ	dde	de	d	ed
e
de
de
de	fddZdS )    )IncrementalPdfFileWriter   )QRStampQRStampStyle)	TextStampTextStampStyleqr_stamp_filetext_stamp_file
input_nameoutput_namestyle	dest_pagexyc              	   K   s   t | dB}t|dd}	|d|	|d|}
|
||| t |d}|	| W d    n1 s2w   Y  W d    d S W d    d S 1 sJw   Y  d S )NrbF)strict)writerr   wb )openr   applywrite)r
   r   r   stamp_classr   r   r   stamp_kwargsfinpdf_outstampoutr   r   R/var/www/html/kangema/venv/lib/python3.10/site-packages/pyhanko/stamp/functions.py_stamp_file	   s   
"r   Nc              
   C   s   t | ||t||||d dS )a5  
    Add a text stamp to a file.

    :param input_name:
        Path to the input file.
    :param output_name:
        Path to the output file.
    :param style:
        Text stamp style to use.
    :param dest_page:
        Index of the page to which the stamp is to be applied (starting at `0`).
    :param x:
        Horizontal position of the stamp's lower left corner on the page.
    :param y:
        Vertical position of the stamp's lower left corner on the page.
    :param text_params:
        Additional parameters for text template interpolation.
    )text_paramsN)r   r   )r
   r   r   r   r   r   r    r   r   r   r	      s   
urlc                 C   s   t | ||t|||||d	 dS )aj  
    Add a QR stamp to a file.

    :param input_name:
        Path to the input file.
    :param output_name:
        Path to the output file.
    :param style:
        QR stamp style to use.
    :param dest_page:
        Index of the page to which the stamp is to be applied (starting at `0`).
    :param x:
        Horizontal position of the stamp's lower left corner on the page.
    :param y:
        Vertical position of the stamp's lower left corner on the page.
    :param url:
        URL for the QR code to point to.
    :param text_params:
        Additional parameters for text template interpolation.
    )r!   r    N)r   r   )r
   r   r   r   r   r   r!   r    r   r   r   r   C   s   
)N)$pyhanko.pdf_utils.incremental_writerr   qrr   r   textr   r   __all__strintr   r	   r   r   r   r   r   <module>   s^    

/