
    }fo                     B   d dl mZmZmZmZ d dlmZ ddlmZ  G d de          Z	 G d de          Z
 G d	 d
e          Z G d de          Z G d de
          Z G d de
          Z G d de
          Z G d de
          Z G d de          Z G d de          Z G d de
          Z G d de
          Z G d de
          Z G d d e          Z G d! d"e
          Z G d# d$e          Z G d% d&e
          Z G d' d(e
          Z G d) d*e          Z G d+ d,e
          Z G d- d.e
          Z G d/ d0e
          Z G d1 d2e
          Z G d3 d4e          Z  G d5 d6e
          Z! G d7 d8e
          Z" G d9 d:e
          Z# G d; d<e
          Z$ G d= d>e
          Z% G d? d@e          Z& G dA dBe          Z' G dC dDe          Z( G dE dFe
          Z) G dG dHe          Z* G dI dJe          Z+ G dK dLe          Z, G dM dNe
          Z-dOS )P    )EnumIntEnumFlagIntFlag)intern   )Namec                       e Zd ZdZ	 dZdS )SignatureFlagr      N)__name__
__module____qualname__SIGNATURES_EXISTAPPEND_ONLY     C/var/www/rtfcompare/venv/lib/python3.11/site-packages/fpdf/enums.pyr   r      s"        AK r   r   c                   (    e Zd ZdZed             ZdS )CoerciveEnumzQAn enumeration that provides a helper to coerce strings into enumeration members.c                 B   t          ||           r|S t          |t                    r`	  | |          S # t          $ r Y nw xY w	 | |                                         S # t          $ r Y nw xY wt          | d| j                   t          | d| j                   )a  
        Attempt to coerce `value` into a member of this enumeration.

        If value is already a member of this enumeration it is returned unchanged.
        Otherwise, if it is a string, attempt to convert it as an enumeration value. If
        that fails, attempt to convert it (case insensitively, by upcasing) as an
        enumeration name.

        If all different conversion attempts fail, an exception is raised.

        Args:
            value (Enum, str): the value to be coerced.

        Raises:
            ValueError: if `value` is a string but neither a member by name nor value.
            TypeError: if `value`'s type is neither a member of the enumeration nor a
                string.
         is not a valid z cannot be converted to a )
isinstancestr
ValueErrorupperKeyErrorr   	TypeErrorclsvalues     r   coercezCoerciveEnum.coerce   s    * eS!! 	LeS!! 
	Gs5zz!   5;;==))    EEs|EEFFF5JJCLJJKKKs!   
4 
A AA 
A,+A,Nr   r   r   __doc__classmethodr"   r   r   r   r   r      s8        WW#L #L [#L #L #Lr   r   c                   (    e Zd ZdZed             ZdS )CoerciveIntEnumzl
    An enumeration that provides a helper to coerce strings and integers into
    enumeration members.
    c                 H   t          ||           r|S t          |t                    rC	 | |                                         S # t          $ r t	          | d| j                   dw xY wt          |t                    r | |          S t          | d| j                   )a  
        Attempt to coerce `value` into a member of this enumeration.

        If value is already a member of this enumeration it is returned unchanged.
        Otherwise, if it is a string, attempt to convert it (case insensitively, by
        upcasing) as an enumeration name. Otherwise, if it is an int, attempt to
        convert it as an enumeration value.

        Otherwise, an exception is raised.

        Args:
            value (IntEnum, str, int): the value to be coerced.

        Raises:
            ValueError: if `value` is an int but not a member of this enumeration.
            ValueError: if `value` is a string but not a member by name.
            TypeError: if `value`'s type is neither a member of the enumeration nor an
                int or a string.
        r   N cannot convert to a r   r   r   r   r   r   intr   r   s     r   r"   zCoerciveIntEnum.coerceB   s    * eS!! 	LeS!! 	UU5;;==)) U U U E!I!I3<!I!IJJPTTU eS!! 	3u::5EEs|EEFFFs   A %A(Nr#   r   r   r   r'   r'   <   s>         
  G  G [ G  G  Gr   r'   c                   (    e Zd ZdZed             ZdS )CoerciveIntFlagz
    Enumerated constants that can be combined using the bitwise operators,
    with a helper to coerce strings and integers into enumeration members.
    c                    t          ||           r|S t          |t                    r	 | |                                         S # t          $ r Y nw xY w	 | |d                                                  }|dd         D ]}|| |                                         z  } |S # t          $ r t	          | d| j                   dw xY wt          |t                    r | |          S t          | d| j                   )a  
        Attempt to coerce `value` into a member of this enumeration.

        If value is already a member of this enumeration it is returned unchanged.
        Otherwise, if it is a string, attempt to convert it (case insensitively, by
        upcasing) as an enumeration name. Otherwise, if it is an int, attempt to
        convert it as an enumeration value.
        Otherwise, an exception is raised.

        Args:
            value (IntEnum, str, int): the value to be coerced.

        Raises:
            ValueError: if `value` is an int but not a member of this enumeration.
            ValueError: if `value` is a string but not a member by name.
            TypeError: if `value`'s type is neither a member of the enumeration nor an
                int or a string.
        r   r   Nr   r)   r*   )r    r!   flagschars       r   r"   zCoerciveIntFlag.coercel   s9   ( eS!! 	LeS!! 	U5;;==))   UE!HNN,,-!!""I 6 6D!C

$55EE U U U E!I!I3<!I!IJJPTTU eS!! 	3u::5EEs|EEFFFs   A 
AAAB   %CNr#   r   r   r   r-   r-   f   s>         
 &G &G [&G &G &Gr   r-   c                   @    e Zd ZdZ ed          Z	  ed          ZdS )WrapModez7Defines how to break and wrap lines in multi-line text.WORDCHARN)r   r   r   r$   r   r3   r4   r   r   r   r2   r2      s3        ==6&>>D6&>>Dr   r2   c                       e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z	dS )CharVPosz;Defines the vertical position of text relative to the line.SUPSUBNOMDENOMLINEN)
r   r   r   r$   r   r7   r8   r9   r:   r;   r   r   r   r6   r6      sc        AA
&--C
&--C
&--CF7OOE6&>>Dr   r6   c                        e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		 e
 fd            Z xZS )Alignz$Defines how to render text in a cellCENTERX_CENTERLEFTRIGHTJUSTIFYc                 d    |dk    r| j         S t          | |                               |          S N )Lsuperr"   r    r!   	__class__s     r   r"   zAlign.coerce   /    B;;5LS#%%e,,,r   )r   r   r   r$   r   CXrF   RJr%   r"   __classcell__rI   s   @r   r=   r=      s        **xAzA8vAwAyA- - - - [- - - - -r   r=   c                   z     e Zd ZdZ ed          Z	  ed          Z	  ed          Z	 e fd            Z	 xZ
S )VAlignzLDefines how to vertically render text in a cell.
    Default value is MIDDLEMIDDLETOPBOTTOMc                 d    |dk    r| j         S t          | |                               |          S rD   )MrG   r"   rH   s     r   r"   zVAlign.coerce   rJ   r   )r   r   r   r$   r   rW   TBr%   r"   rO   rP   s   @r   rR   rR      s          	xAuACxAF- - - - [- - - - -r   rR   c                   `     e Zd ZdZdZ	 dZ	 dZ	 dZ	 ed             Z	e
 fd            Z xZS )TextEmphasisz
    Indicates use of bold / italics / underline.

    This enum values can be combined with & and | operators:
        style = B | I
    r   r   r      c                 ~     d                      fd j        j                                        D                       S )NrE   c              3   ,   K   | ]\  }}|z  
|V  d S Nr   ).0namer!   selfs      r   	<genexpr>z%TextEmphasis.style.<locals>.<genexpr>   sE       
 
 T5%RV,

 
 
 
 
 
r   )joinrI   __members__itemsrb   s   `r   stylezTextEmphasis.style   sP    ww 
 
 
 
$(N$>$D$D$F$F
 
 
 
 
 	
r   c                 H   t          |t                    rj|dk    r| j        S |                                dk    r| j        S |                                dk    r| j        S |                                dk    r| j        S t          | |                               |          S )NrE   BOLDITALICS	UNDERLINE)	r   r   NONEr   rY   IUrG   r"   rH   s     r   r"   zTextEmphasis.coerce   s    eS!! 	{{x{{}}&&u{{}}	))u{{}}++uS#%%e,,,r   )r   r   r   r$   rm   rY   rn   ro   propertyrh   r%   r"   rO   rP   s   @r   r[   r[      s          D	A
	A	A
 
 X

 
- 
- 
- 
- [
- 
- 
- 
- 
-r   r[   c                   "    e Zd ZdZdZ	 dZ	 dZdS )MethodReturnValuez
    Defines the return value(s) of a FPDF content-rendering method.

    This enum values can be combined with & and | operators:
        PAGE_BREAK | LINES
    r   r   r\   N)r   r   r   r$   
PAGE_BREAKLINESHEIGHTr   r   r   rr   rr     s1          JIE[F==r   rr   c                       e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
	  ed          Zd	S )
TableBordersLayoutz#Defines how to render table bordersALLrm   INTERNALMINIMALHORIZONTAL_LINESNO_HORIZONTAL_LINESSINGLE_TOP_LINEN)r   r   r   r$   r   rx   rm   ry   rz   r{   r|   r}   r   r   r   rw   rw     s        ))
&--C"6&>>Dvj!!H6fYG\v011  &!677Gf.//O==r   rw   c                        e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
	 e fd            Zd	 Z xZS )
TableCellFillModez!Defines which table cells to fillrm   rx   ROWSCOLUMNS	EVEN_ROWSEVEN_COLUMNSc                     t          t          |dd                    r|S t                                          |          S )zgAny class that has a .should_fill_cell() method is considered a valid 'TableCellFillMode' (duck-typing)should_fill_cellN)callablegetattrrG   r"   rH   s     r   r"   zTableCellFillMode.coerceF  s=     GE#5t<<== 	Lww~~e$$$r   c                     | | j         u rdS | | j        u rdS | | j        u r	|dz  dk    S | | j        u r	|dz  dk    S | | j        u r	|dz  dk    S | | j        u r	|dz  dk    S t          )NFTr   r   r   )rm   rx   r   r   r   r   NotImplementedError)rb   ijs      r   r   z"TableCellFillMode.should_fill_cellM  s    49548449q5A:4<q5A:4>!!q5A:4$$$q5A:!!r   )r   r   r   r$   r   rm   rx   r   r   r   r   r%   r"   r   rO   rP   s   @r   r   r   1  s        ''6&>>D
&--C6&>>D'fYG*{##I(6.))L+% % % % [%" " " " " " "r   r   c                   <    e Zd Z ed          Z	  ed          ZdS )	TableSpanROWCOLN)r   r   r   r   r   r   r   r   r   r   r   ]  s-        
&--C:
&--C==r   r   c                       e Zd ZdZdZ	 dZdS )TableHeadingsDisplayz2Defines how the table headings should be displayedr   r   N)r   r   r   r$   rm   ON_TOP_OF_EVERY_PAGEr   r   r   r   r   e  s$        88DE__r   r   c                        e Zd ZdZ ed          Z	  ed          Z	  ed          Z	 ed             Z	ed             Z
ed             Ze fd            Z xZS )	RenderStylezDefines how to render shapesDRAWFILL	DRAW_FILLc                 <    | j         d| j        d| j        di|          S )NSfrY   )DFDFrg   s    r   operatorzRenderStyle.operator  s     TVS$'37==r   c                 "    | | j         | j        fv S r_   )r   r   rg   s    r   is_drawzRenderStyle.is_draw      (((r   c                 "    | | j         | j        fv S r_   )r   r   rg   s    r   is_fillzRenderStyle.is_fill  r   r   c                 l    |s| j         S |dk    rd}t          | |                               |          S )NFDr   )r   rG   r"   rH   s     r   r"   zRenderStyle.coerce  s<     	5LD==ES#%%e,,,r   )r   r   r   r$   r   r   r   r   rp   r   r   r   r%   r"   rO   rP   s   @r   r   r   o  s        ""vA 	vA
 
		B> > X> ) ) X) ) ) X) - - - - [- - - - -r   r   c                   2    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
S )TextModez:Values described in PDF spec section 'Text Rendering Mode'r   r   r      r\            N)r   r   r   r$   r   STROKEFILL_STROKE	INVISIBLE	FILL_CLIPSTROKE_CLIPFILL_STROKE_CLIPCLIPr   r   r   r   r     s=        @@DFKIIKDDDr   r   c                       e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
	  ed          Z	  ed	          Zd
S )XPoszFPositional values in horizontal direction for use after printing text.r@   rA   STARTENDWCONTr>   LMARGINRMARGINN)r   r   r   r$   r   r@   rA   r   r   r   r>   r   r   r   r   r   r   r     s        LL6&>>DF7OOE%F7OOE
&--CF7OOE9VHFfYG0fYG//r   r   c                       e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z	dS )YPoszCPositional values in vertical direction for use after printing textrT   LASTNEXTTMARGINBMARGINN)
r   r   r   r$   r   rT   r   r   r   r   r   r   r   r   r     sg        II
&--C%6&>>D=6&>>D/fYG/fYG00r   r   c                   2    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
S )AnglezTDirection values used for mirror transformations specifying the angle of mirror lineZ   r   i     -   i;        N)r   r   r   r$   NORTHEASTSOUTHWEST	NORTHEAST	SOUTHEAST	SOUTHWEST	NORTHWESTr   r   r   r   r     s<        ZZEDEDIIIIIIr   r   c                       e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
dS )	
PageLayoutzASpecify the page layout shall be used when the document is opened
SinglePage	OneColumnTwoColumnLeftTwoColumnRightTwoPageLeftTwoPageRightN)r   r   r   r$   r	   SINGLE_PAGE
ONE_COLUMNTWO_COLUMN_LEFTTWO_COLUMN_RIGHTTWO_PAGE_LEFTTWO_PAGE_RIGHTr   r   r   r   r     s        GG$|$$K k""J%d?++OKt,--LD''MJT.))NKKr   r   c                       e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
dS )	PageModezBSpecifying how to display the document on exiting full-screen modeUseNoneUseOutlines	UseThumbs
FullScreenUseOCUseAttachmentsN)r   r   r   r$   r	   USE_NONEUSE_OUTLINES
USE_THUMBSFULL_SCREENUSE_OCUSE_ATTACHMENTSr   r   r   r   r     s|        HHtIH;4&&Lk""J$|$$KVT']]F*d+,,Or   r   c                   j    e Zd ZdZ ed          Z ed          Z ed          Z ed          ZdS )TextMarkupTypez#Subtype of a text markup annotation	Highlight	UnderlineSquiggly	StrikeOutN)	r   r   r   r$   r	   	HIGHLIGHTrl   SQUIGGLY
STRIKE_OUTr   r   r   r   r   
  sP        ))[!!I[!!ItJHk""JJJr   r   c                      e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
	  ed          Z	  ed	          Z	  ed
          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          ZdS )	BlendModezLAn enumeration of the named standard named blend functions supported by PDF.NormalMultiplyScreenOverlayDarkenLighten
ColorDodge	ColorBurn	HardLight	SoftLight
Difference	ExclusionHue
SaturationColor
LuminosityN)r   r   r   r$   r	   NORMALMULTIPLYSCREENOVERLAYDARKENLIGHTENCOLOR_DODGE
COLOR_BURN
HARD_LIGHT
SOFT_LIGHT
DIFFERENCE	EXCLUSIONHUE
SATURATIONCOLOR
LUMINOSITYr   r   r   r   r     sQ       RRT(^^F<tJH<T(^^F d9ooG T(^^FAd9ooGB$|$$K k""J k""J k""J l##JV[!!I
 $u++C l##J
 DMME
 l##J r   r   c                   H    e Zd ZdZ	 dZ	 dZ	 dZ	 dZ	 dZ	 dZ		 dZ
	 d	Z	 d
ZdS )AnnotationFlagr   r   r\             @            N)r   r   r   r   HIDDENPRINTNO_ZOOM	NO_ROTATENO_VIEW	READ_ONLYLOCKEDTOGGLE_NO_VIEWLOCKED_CONTENTSr   r   r   r  r  a  si        I FZE<G`I\G_I F NNOUUr   r  c                       e Zd ZdZ ed          Z ed          Z ed          Z ed          Z ed          Z	 ed          Z
dS )	AnnotationNameCThe name of an icon that shall be used in displaying the annotationNoteCommentHelp	ParagraphNewParagraphInsertN)r   r   r   r$   r	   NOTECOMMENTHELP	PARAGRAPHNEW_PARAGRAPHINSERTr   r   r   r)  r)    sf        II4<<Dd9ooG4<<D[!!ID((MT(^^FFFr   r)  c                   T    e Zd ZdZ ed          Z ed          Z ed          ZdS )FileAttachmentAnnotationNamer*  PushPinGraphPushPinPaperclipTagN)r   r   r   r$   r	   PUSH_PINGRAPH_PUSH_PINPAPERCLIP_TAGr   r   r   r8  r8    s?        IItIHT.))ND((MMMr   r8  c                       e Zd ZdZdZ	 dZdS )IntersectionRulea)  
    An enumeration representing the two possible PDF intersection rules.

    The intersection rule is used by the renderer to determine which points are
    considered to be inside the path and which points are outside the path. This
    primarily affects fill rendering and clipping paths.
    nonzeroevenoddNr   r   r   r$   NONZEROEVENODDr   r   r   r@  r@    s1          G G r   r@  c                   :    e Zd ZdZdZ	 dZ	 dZ	 dZ	 dZ	 dZ		 dZ
d	S )
PathPaintRulezu
    An enumeration of the PDF drawing directives that determine how the renderer should
    paint a given path.
    r   r   zf*rY   zB*nautoN)r   r   r   r$   r   FILL_NONZEROFILL_EVENODDSTROKE_FILL_NONZEROSTROKE_FILL_EVENODD
DONT_PAINTAUTOr   r   r   rG  rG    sk          FL
 L
   J D r   rG  c                       e Zd ZdZdZ	 dZdS )ClippingPathIntersectionRulezSAn enumeration of the PDF drawing directives that define a path as a clipping path.WzW*NrC  r   r   r   rQ  rQ    s+        YYG G r   rQ  c                   "    e Zd ZdZdZ	 dZ	 dZdS )StrokeCapStylez
    An enumeration of values defining how the end of a stroke should be rendered.

    This affects the ends of the segments of dashed strokes, as well.
    r   r   r   N)r   r   r   r$   BUTTROUNDSQUAREr   r   r   rT  rT    s=          D E F r   rT  c                   "    e Zd ZdZdZ	 dZ	 dZdS )StrokeJoinStylezn
    An enumeration of values defining how the corner joining two path components should
    be rendered.
    r   r   r   N)r   r   r   r$   MITERrV  BEVELr   r   r   rY  rY    s=         
 E
 E E r   rY  c                       e Zd ZdZ ed          Z ed          Z ed          Z ed          Z ed          Z	 ed          Z
 ed          Z ed	          Z ed
          ZdS )PDFStyleKeysz?An enumeration of the graphics state parameter dictionary keys.caBMCASALWLCLJMLr   N)r   r   r   r$   r	   
FILL_ALPHA
BLEND_MODESTROKE_ALPHASTROKE_ADJUSTMENTSTROKE_WIDTHSTROKE_CAP_STYLESTROKE_JOIN_STYLESTROKE_MITER_LIMITSTROKE_DASH_PATTERNr   r   r   r]  r]  3  s        EEdJdJ4::LT

4::LtDzzT

d$s))r   r]  c                       e Zd ZdZdZdZdZdS )Corner	TOP_RIGHTTOP_LEFTBOTTOM_RIGHTBOTTOM_LEFTN)r   r   r   rq  rr  rs  rt  r   r   r   rp  rp  A  s"        IH!LKKKr   rp  c                   (    e Zd ZdZdZ	 dZ	 dZ	 dZdS )FontDescriptorFlagszAn enumeration of the flags for the unsigned 32-bit integer entry in the font descriptor specifying various
    characteristics of the font. Bit positions are numbered from 1 (low-order) to 32 (high-order).
    r   r\   r  i   N)r   r   r   r$   FIXED_PITCHSYMBOLICITALIC
FORCE_BOLDr   r   r   rv  rv  H  sI          K
 H
 F J r   rv  c                   n    e Zd ZdZdZ	 dZ	 dZ	 dZ	 dZ	 dZ		 dZ
	 d	Z	 ed
             Zed             ZdS )AccessPermissionzJPermission flags will translate as an integer on the encryption dictionaryr\   r  r  r  r  r  i   i   c                 B    d}t          t                    D ]}||z  }|S )zAll flags enabledr   )listr|  )r    result
permissions      r   allzAccessPermission.all  s2     /00 	) 	)Jj(FFr   c                     dS )zAll flags disabledr   r   )r    s    r   nonezAccessPermission.none  s	     qr   N)r   r   r   r$   PRINT_LOW_RESMODIFYCOPY
ANNOTATION
FILL_FORMSCOPY_FOR_ACCESSIBILITYASSEMBLEPRINT_HIGH_RESr%   r  r  r   r   r   r|  r|  f  s        PP"MF)D9J$J.+VHM#N.  [   [  r   r|  c                   "    e Zd ZdZdZdZdZdZdS )EncryptionMethodz,Algorithm to be used to encrypt the documentr   r   r   r   N)r   r   r   r$   NO_ENCRYPTIONRC4AES_128AES_256r   r   r   r  r    s(        22M
CGGGGr   r  c                   p    e Zd ZdZ ed          Z	  ed          Z	  ed          Z	  ed          ZdS )TextDirectionz)Text rendering direction for text shapingLTRRTLTTBBTTN)	r   r   r   r$   r   r  r  r  r  r   r   r   r  r    sR        //
&--C
&--C
&--C
&--COr   r  N).enumr   r   r   r   sysr   syntaxr	   r   r   r'   r-   r2   r6   r=   rR   r[   rr   rw   r   r   r   r   r   r   r   r   r   r   r   r   r  r)  r8  r@  rG  rQ  rT  rY  r]  rp  rv  r|  r  r  r   r   r   <module>r     s   - - - - - - - - - - - -                G   'L 'L 'L 'L 'L4 'L 'L 'LT'G 'G 'G 'G 'Gg 'G 'G 'GT-G -G -G -G -Gg -G -G -G`    |       |   $- - - - -L - - -2- - - - -\ - - -(%- %- %- %- %-? %- %- %-P> > > > > > > >$> > > > > > > >2)" )" )" )" )" )" )" )"X> > > > > > > >` ` ` ` `? ` ` `%- %- %- %- %-, %- %- %-P	 	 	 	 	 	 	 	0 0 0 0 0< 0 0 081 1 1 1 1< 1 1 1&	 	 	 	 	O 	 	 	L L L L L L L L,         |      ,	# 	# 	# 	# 	#\ 	# 	# 	#H H H H H H H HVV V V V V_ V V V@    \   ) ) ) ) )< ) ) )    |   >3 3 3 3 3L 3 3 3l    <   0    _   0    o   4$ $ $ $ $4 $ $ $         \          $   <& & & & &w & & &R    t       L     r   