o
    gi                     @   s   d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 ddlmZ dd	lmZ G d
d deZdS )u2  
An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF
document, or provides a way to interact with the user by means of the mouse and keyboard. PDF includes a
wide variety of standard annotation types, described in detail in 12.5.6, “Annotation Types.”
    N)Decimal)
Dictionary)List)Name)String)Color)	Rectanglec                       sv   e Zd ZdZ					ddedeje deje deje	 deje deje f fd	d
Z
ede	fddZ  ZS )
AnnotationuB  
    An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF
    document, or provides a way to interact with the user by means of the mouse and keyboard. PDF includes a
    wide variety of standard annotation types, described in detail in 12.5.6, “Annotation Types.”
    Nbounding_boxborder_widthcolorcontentshorizontal_corner_radiusvertical_corner_radiusc                    s  t t|   td| td< t d| td< | d t|  | d t|	  | d t| |
   | d t|	 |   |d urYt|| td< d}td|| td< t|  | td	< td
| td< |d ur|d ur|d urt d| td< | d t| | d t| | d t| |d urt d| td< | d t| j | d t| j | d t| j d S d S )NAnnotTypeTRectContentsr   zannotation-{0:03d}NMM   FBorderC)superr	   __init__r   r   set_is_inlineappendbDecimalget_xget_y	get_width
get_heightr   format_timestamp_to_strto_rgbredgreenblue)selfr
   r   r   r   r   r   
len_annots	__class__ `/home/ubuntu/.local/lib/python3.10/site-packages/borb/pdf/canvas/layout/annotation/annotation.pyr   !   s4   			zAnnotation.__init__returnc                  C   sJ   d} t j  }|j|j|j|j|j|jfD ]	}| d|7 } q| d7 } | S )NzD:z{0:02}Z00)	datetimenowyearmonthdayhourminutesecondr#   )timestamp_strr2   nr-   r-   r.   r$      s   
 zAnnotation._timestamp_to_str)NNNNN)__name__
__module____qualname____doc__r   typingOptionalr   r   strr   staticmethodr$   __classcell__r-   r-   r+   r.   r	      s,    pr	   )r>   r1   r?   decimalr   borb.io.read.typesr   r   r   r   r   borb.pdf.canvas.color.colorr   "borb.pdf.canvas.geometry.rectangler   r	   r-   r-   r-   r.   <module>   s   