o
    vh6                     @   sn   d dl mZ d dlmZmZ d dlmZ ddlmZm	Z	 ddgZ
edd	G d
d de	ZG dd deZdS )    )	dataclass)contentlayout)BasePdfFileWriter   )	BaseStampBaseStampStyleStaticStampStyleStaticContentStampT)frozenc                   @   sP   e Zd ZU dZdZeed< 	 e	d	 dddZde	d	e
jd
eddfddZdS )r	   za
    Stamp style that does not include any custom parts; it only renders
    the background.
    g      ?background_opacityr   returnc                 K   s   t ddtj||di|S )a  
        Create a :class:`StaticStampStyle` from a page from an external PDF
        document. This is a convenience wrapper around
        :class:`~content.ImportedPdfContent`.

        The remaining keyword arguments are passed to
        :class:`StaticStampStyle`'s init method.

        :param file_name:
            File name of the external PDF document.
        :param page_ix:
            Page index to import. The default is ``0``, i.e. the first page.
        
background)page_ixN )r	   r   ImportedPdfPage)cls	file_namer   kwargsr   r   R/var/www/html/hyperkenya/venv/lib/python3.10/site-packages/pyhanko/stamp/static.pyfrom_pdf_file   s
   zStaticStampStyle.from_pdf_filewriterboxtext_paramsr
   c                 C   s   t || |dS )N)r   styler   )r
   )selfr   r   r   r   r   r   create_stamp.   s   zStaticStampStyle.create_stampN)r   )r   r	   )__name__
__module____qualname____doc__r   float__annotations__classmethodr   r   r   BoxConstraintsdictr   r   r   r   r   r	      s$   
 c                       s8   e Zd ZdZdededejf fddZdd Z	  Z
S )	r
   z.Class representing stamps with static content.r   r   r   c                    s0   |r|j r|jstdt j|||d d S )Nz9StaticContentStamp requires a predetermined bounding box.)r   r   r   )height_definedwidth_definedr   LayoutErrorsuper__init__)r   r   r   r   	__class__r   r   r*   :   s
   zStaticContentStamp.__init__c                 C   s   g S )Nr   )r   r   r   r   _render_inner_contentF   s   z(StaticContentStamp._render_inner_content)r   r   r   r    r   r	   r   r$   r*   r-   __classcell__r   r   r+   r   r
   7   s    N)dataclassesr   pyhanko.pdf_utilsr   r   pyhanko.pdf_utils.writerr   baser   r   __all__r	   r
   r   r   r   r   <module>   s    +