§
    K˜ºh;  ã                   ó  — d Z dZdZddlmZmZmZmZmZ ddl	m
Z
mZ ddlmZ dd	lmZmZmZmZmZmZmZmZmZmZ dd
lmZmZmZmZmZmZm Z m!Z!m"Z"m#Z# ddl$m%Z% ddl&m'Z'm(Z( ddl)m*Z* ddl	m+Z+m,Z,m-Z-m.Z.m/Z/ ddl0m1Z1 de
ded         fd„Z2	 dde
dede3ee3         ee4e3f         f         ded         fd„Z5	 ddee3e6f         dede3ee3         ee4e3f         f         deeef         fd„Z7 e%j8        ¦   «         Z9 G d„ d¦  «        Z:g d¢Z;dS )zHImplementation of generic PDF objects (dictionary, number, string, ...).zMathieu Fenniakzbiziqe@mathieu.fenniak.neté    )ÚDictÚListÚOptionalÚTupleÚUnioné   )Ú
StreamTypeÚdeprecate_with_replacement)ÚOutlineFontFlagé   )
ÚBooleanObjectÚByteStringObjectÚFloatObjectÚIndirectObjectÚ
NameObjectÚ
NullObjectÚNumberObjectÚ	PdfObjectÚTextStringObjectÚencode_pdfdocencoding)
ÚArrayObjectÚContentStreamÚDecodedStreamObjectÚDestinationÚDictionaryObjectÚEncodedStreamObjectÚFieldÚStreamObjectÚ
TreeObjectÚread_object)ÚFit)ÚBookmarkÚOutlineItem©ÚRectangleObject)Úcreate_string_objectÚdecode_pdfdocencodingÚ
hex_to_rgbÚread_hex_string_from_streamÚread_string_from_stream)ÚViewerPreferencesÚstreamÚreturn)r   r   c                 óB   — t          ddd¦  «         t          | ¦  «        S )z,Deprecated, use read_hex_string_from_stream.ÚreadHexStringFromStreamr)   ú4.0.0)r
   r)   )r,   s    ú^/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/pypdf/generic/__init__.pyr/   r/   I   s.   € õ Ø!Ð#@À'ñô ð õ ' vÑ.Ô.Ð.ó    NÚforced_encodingc                 óD   — t          ddd¦  «         t          | |¦  «        S )z(Deprecated, use read_string_from_stream.ÚreadStringFromStreamr*   r0   )r
   r*   )r,   r3   s     r1   r5   r5   S   s0   € õ
 ØÐ 9¸7ñô ð õ # 6¨?Ñ;Ô;Ð;r2   Ústringc                 óD   — t          ddd¦  «         t          | |¦  «        S )z%Deprecated, use create_string_object.ÚcreateStringObjectr&   r0   )r
   r&   )r6   r3   s     r1   r8   r8   ^   s(   € õ
 Ð3Ð5KÈWÑUÔUÐUÝ ¨Ñ8Ô8Ð8r2   c                   óô  — e Zd ZdZddlmZ e	 	 d3deeee	e	e	e	f         f         de
ded	ed
ef
d„¦   «         Ze	 	 	 	 	 	 	 d4de
deeee	e	e	e	f         f         de
dedede
de
dee
         dee
         d
efd„¦   «         Zeddddœdeeee	e	e	e	f         f         d	edee         ded
ef
d„¦   «         Ze	 	 d5dee	e	f         dee	e	f         deeee	e	e	e	f         f         de
dee
         d
efd „¦   «         Zed!eee	e	f                  d
efd"„¦   «         Ze	 d6deeee	e	e	e	f         f         d#ee
         d
efd$„¦   «         Zed%d&œdeeee	e	e	e	f         f         d'ed(e
d
efd)„¦   «         Ze	 d6deeee	e	e	e	f         f         d#ee
         d
efd*„¦   «         Zed!eee	e	f                  d
efd+„¦   «         Zd,d-lmZ edddefdeeee	e	e	e	f         f         d.ee         d/ee
         d0ee         d1ed
efd2„¦   «         ZdS )7ÚAnnotationBuilderzâ
    The AnnotationBuilder is deprecated.

    Instead, use the annotation classes in pypdf.annotations.

    See `adding PDF annotations <../user/adding-pdf-annotations.html>`_ for
    it's usage combined with PdfWriter.
    r   r$   Fr   ÚrectÚtextÚopenÚflagsr-   c                 óN   — t          ddd¦  «         ddlm}  || |||¬¦  «        S )a^  
        Add text annotation.

        Args:
            rect: array of four integers ``[xLL, yLL, xUR, yUR]``
                specifying the clickable rectangular area
            text: The text that is added to the document
            open:
            flags:

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.textzpypdf.annotations.Textr0   r   )ÚText)r;   r<   r=   r>   )r
   Úannotationsr@   )r;   r<   r=   r>   r@   s        r1   r<   zAnnotationBuilder.textv   sK   € õ( 	#Ø$Ð&>Àñ	
ô 	
ð 	
ð 	'Ð&Ð&Ð&Ð&Ð&àˆt˜ D¨t¸5ÐAÑAÔAÐAr2   Ú	HelveticaÚ14ptÚ000000ÚffffffÚfontÚboldÚitalicÚ	font_sizeÚ
font_colorÚborder_colorÚbackground_colorc	                 óX   — t          ddd¦  «         ddlm}	  |	| ||||||||¬¦	  «	        S )a@  
        Add text in a rectangle to a page.

        Args:
            text: Text to be added
            rect: array of four integers ``[xLL, yLL, xUR, yUR]``
                specifying the clickable rectangular area
            font: Name of the Font, e.g. 'Helvetica'
            bold: Print the text in bold
            italic: Print the text in italic
            font_size: How big the text will be, e.g. '14pt'
            font_color: Hex-string for the color, e.g. cdcdcd
            border_color: Hex-string for the border color, e.g. cdcdcd.
                Use ``None`` for no border.
            background_color: Hex-string for the background of the annotation,
                e.g. cdcdcd. Use ``None`` for transparent background.

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.free_textzpypdf.annotations.FreeTextr0   r   )ÚFreeText)	r<   r;   rF   rG   rH   rI   rJ   rL   rK   )r
   rA   rN   )
r<   r;   rF   rG   rH   rI   rJ   rK   rL   rN   s
             r1   Ú	free_textzAnnotationBuilder.free_text‘   sg   € õ@ 	#Ø)Ð+GÈñ	
ô 	
ð 	
ð 	+Ð*Ð*Ð*Ð*Ð*àˆxØØØØØØØ!Ø-Ø%ð

ñ 

ô 

ð 
	
r2   N)r>   Úparentr=   rP   c                 ó^   — t          ddd¦  «         ddlm}  || ||¬¦  «        }||_        |S )aŽ  
        Add a popup to the document.

        Args:
            rect:
                Specifies the clickable rectangular area as `[xLL, yLL, xUR, yUR]`
            flags:
                1 - invisible, 2 - hidden, 3 - print, 4 - no zoom,
                5 - no rotate, 6 - no view, 7 - read only, 8 - locked,
                9 - toggle no view, 10 - locked contents
            open:
                Whether the popup should be shown directly (default is False).
            parent:
                The contents of the popup. Create this via the AnnotationBuilder.

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.popupzpypdf.annotations.Popupr0   r   )ÚPopup)r;   r=   rP   )r
   rA   rR   r>   )r;   r>   rP   r=   rR   Úpopups         r1   rS   zAnnotationBuilder.popupÂ   sT   € õ4 	#Ø%Ð'@À'ñ	
ô 	
ð 	
ð 	(Ð'Ð'Ð'Ð'Ð'à�˜4 d°6Ð:Ñ:Ô:ˆØˆŒàˆr2   Ú Úp1Úp2Ú	title_barc                 óP   — t          ddd¦  «         ddlm}  || ||||¬¦  «        S )a  
        Draw a line on the PDF.

        Args:
            p1: First point
            p2: Second point
            rect: array of four integers ``[xLL, yLL, xUR, yUR]``
                specifying the clickable rectangular area
            text: Text to be displayed as the line annotation
            title_bar: Text to be displayed in the title bar of the
                annotation; by convention this is the name of the author

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.linezpypdf.annotations.Liner0   r   )ÚLine)rU   rV   r;   r<   rW   )r
   rA   rY   )rU   rV   r;   r<   rW   rY   s         r1   ÚlinezAnnotationBuilder.lineæ   sM   € õ. 	#Ø$Ð&>Àñ	
ô 	
ð 	
ð 	'Ð&Ð&Ð&Ð&Ð&àˆt�r˜b t°$À)ÐLÑLÔLÐLr2   Úverticesc                 óH   — t          ddd¦  «         ddlm}  || ¬¦  «        S )zä
        Draw a polyline on the PDF.

        Args:
            vertices: Array specifying the vertices (x, y) coordinates of the poly-line.

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.polylinezpypdf.annotations.PolyLiner0   r   )ÚPolyLine©r[   )r
   rA   r]   )r[   r]   s     r1   ÚpolylinezAnnotationBuilder.polyline  sE   € õ 	#Ø(Ð*FÈñ	
ô 	
ð 	
ð 	+Ð*Ð*Ð*Ð*Ð*àˆx Ð*Ñ*Ô*Ð*r2   Úinteriour_colorc                 óJ   — t          ddd¦  «         ddlm}  || |¬¦  «        S )aÛ  
        Draw a rectangle on the PDF.

        This method uses the /Square annotation type of the PDF format.

        Args:
            rect: array of four integers ``[xLL, yLL, xUR, yUR]``
                specifying the clickable rectangular area
            interiour_color: None or hex-string for the color, e.g. cdcdcd
                If None is used, the interiour is transparent.

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.rectanglezpypdf.annotations.Rectangler0   r   )Ú	Rectangle©r;   r`   )r
   rA   rb   )r;   r`   rb   s      r1   Ú	rectanglezAnnotationBuilder.rectangle  sG   € õ& 	#Ø)Ð+HÈ'ñ	
ô 	
ð 	
ð 	,Ð+Ð+Ð+Ð+Ð+àˆy˜d°OÐDÑDÔDÐDr2   Úff0000)Úhighlight_colorÚquad_pointsrf   c                 óL   — t          ddd¦  «         ddlm}  || ||¬¦  «        S )aä  
        Add a highlight annotation to the document.

        Args:
            rect: Array of four integers ``[xLL, yLL, xUR, yUR]``
                specifying the highlighted area
            quad_points: An ArrayObject of 8 FloatObjects. Must match a word or
                a group of words, otherwise no highlight will be shown.
            highlight_color: The color used for the hightlight

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.highlightzpypdf.annotations.Highlightr0   r   )Ú	Highlight)r;   rg   rf   )r
   rA   ri   )r;   rg   rf   ri   s       r1   Ú	highlightzAnnotationBuilder.highlight2  sR   € õ( 	#Ø)Ð+HÈ'ñ	
ô 	
ð 	
ð 	,Ð+Ð+Ð+Ð+Ð+àˆyØ ;Àð
ñ 
ô 
ð 	
r2   c                 óJ   — t          ddd¦  «         ddlm}  || |¬¦  «        S )aÜ  
        Draw a rectangle on the PDF.

        This method uses the /Circle annotation type of the PDF format.

        Args:
            rect: array of four integers ``[xLL, yLL, xUR, yUR]`` specifying
                the bounding box of the ellipse
            interiour_color: None or hex-string for the color, e.g. cdcdcd
                If None is used, the interiour is transparent.

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.ellipsezpypdf.annotations.Ellipser0   r   )ÚEllipserc   )r
   rA   rl   )r;   r`   rl   s      r1   ÚellipsezAnnotationBuilder.ellipseO  sG   € õ& 	#Ø'Ð)DÀgñ	
ô 	
ð 	
ð 	*Ð)Ð)Ð)Ð)Ð)àˆw˜D°/ÐBÑBÔBÐBr2   c                 óH   — t          ddd¦  «         ddlm}  || ¬¦  «        S )NzAnnotationBuilder.polygonzpypdf.annotations.Polygonr0   r   )ÚPolygonr^   )r
   rA   ro   )r[   ro   s     r1   ÚpolygonzAnnotationBuilder.polygoni  sC   € å"Ø'Ð)DÀgñ	
ô 	
ð 	
ð 	*Ð)Ð)Ð)Ð)Ð)àˆw Ð)Ñ)Ô)Ð)r2   r   )ÚDEFAULT_FITÚborderÚurlÚtarget_page_indexÚfitc                 óP   — t          ddd¦  «         ddlm}  || ||||¬¦  «        S )a(  
        Add a link to the document.

        The link can either be an external link or an internal link.

        An external link requires the URL parameter.
        An internal link requires the target_page_index, fit, and fit args.

        Args:
            rect: array of four integers ``[xLL, yLL, xUR, yUR]``
                specifying the clickable rectangular area
            border: if provided, an array describing border-drawing
                properties. See the PDF spec for details. No border will be
                drawn if this argument is omitted.
                - horizontal corner radius,
                - vertical corner radius, and
                - border width
                - Optionally: Dash
            url: Link to a website (if you want to make an external link)
            target_page_index: index of the page to which the link should go
                (if you want to make an internal link)
            fit: Page fit or 'zoom' option.

        Returns:
            A dictionary object representing the annotation.
        zAnnotationBuilder.linkzpypdf.annotations.Linkr0   r   )ÚLink)r;   rr   rs   rt   ru   )r
   rA   rw   )r;   rr   rs   rt   ru   rw   s         r1   ÚlinkzAnnotationBuilder.linkt  s[   € õD 	#Ø$Ð&>Àñ	
ô 	
ð 	
ð 	'Ð&Ð&Ð&Ð&Ð&àˆtØØØØ/Øð
ñ 
ô 
ð 	
r2   )Fr   )rB   FFrC   rD   rD   rE   )rT   N©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úgeneric._rectangler%   Ústaticmethodr   r   ÚfloatÚstrÚboolÚintr   r<   r   rO   rS   rZ   r   r_   rd   r   rj   rm   rp   Ú_fitrq   r!   rx   © r2   r1   r:   r:   j   sæ  € € € € € ðð ð 5Ð4Ð4Ð4Ð4Ð4àð Øð	Bð BØ�O U¨5°%¸ÀÐ+EÔ%FÐFÔGðBàðBð ðBð ð	Bð
 
ðBð Bð Bñ „\ðBð4 ð  ØØØØ"Ø&.Ø*2ð.
ð .
Øð.
à�O U¨5°%¸ÀÐ+EÔ%FÐFÔGð.
ð ð.
ð ð	.
ð
 ð.
ð ð.
ð ð.
ð ˜s”mð.
ð # 3œ-ð.
ð 
ð.
ð .
ð .
ñ „\ð.
ð` ð Ø-1Øð!ð !ð !à�O U¨5°%¸ÀÐ+EÔ%FÐFÔGð!ð ð!ð Ð)Ô*ð	!ð
 ð!ð 
ð!ð !ð !ñ „\ð!ðF ð
 Ø#'ðMð MØ�%˜�,ÔðMà�%˜�,ÔðMð �O U¨5°%¸ÀÐ+EÔ%FÐFÔGðMð ð	Mð
 ˜C”=ðMð 
ðMð Mð Mñ „\ðMð: ð+Ø�u˜U E˜\Ô*Ô+ð+à	ð+ð +ð +ñ „\ð+ð& ð *.ðEð EØ�O U¨5°%¸ÀÐ+EÔ%FÐFÔGðEà! #œðEð 
ðEð Eð Eñ „\ðEð2 ð
  (ð	
ð 
ð 
à�O U¨5°%¸ÀÐ+EÔ%FÐFÔGð
ð !ð
ð ð	
ð
 
ð
ð 
ð 
ñ „\ð
ð8 ð *.ðCð CØ�O U¨5°%¸ÀÐ+EÔ%FÐFÔGðCà! #œðCð 
ðCð Cð Cñ „\ðCð2 ð*˜$˜u U¨E \Ô2Ô3ð *Ð8Hð *ð *ð *ñ „\ð*ð "Ð!Ð!Ð!Ð!Ð!àð )-Ø!Ø+/Øð,
ð ,
Ø�O U¨5°%¸ÀÐ+EÔ%FÐFÔGð,
à˜Ô%ð,
ð �cŒ]ð,
ð $ Cœ=ð	,
ð
 ð,
ð 
ð,
ð ,
ð ,
ñ „\ð,
ð ,
ð ,
r2   r:   )!r   r   r   r   r   r   r   r   r   r:   r!   ÚPAGE_FITr   r   r   r   r   r   r   r%   r   r   r+   r#   r   r"   r    r&   r   r'   r(   r)   r*   ry   )<r}   Ú
__author__Ú__author_email__Útypingr   r   r   r   r   Ú_utilsr	   r
   Ú	constantsr   Ú_baser   r   r   r   r   r   r   r   r   r   Ú_data_structuresr   r   r   r   r   r   r   r   r   r    r„   r!   Ú_outliner"   r#   Ú
_rectangler%   r&   r'   r(   r)   r*   Ú_viewerprefr+   r/   r�   rƒ   r5   Úbytesr8   ru   r†   r:   Ú__all__r…   r2   r1   ú<module>r“      s7  ðð8 OÐ NØ€
Ø/Ð à 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5à ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð Ð Ð Ð Ð Ð Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'ðð ð ð ð ð ð ð ð ð ð ð ð ð ð +Ð *Ð *Ð *Ð *Ð *ð/Øð/à
Ð1Ô2ð/ð /ð /ð /ð DHð<ð <Øð<à˜4  d¨3¤i°°c¸3°h´Ð?Ô@ð<ð Ð1Ô2ð<ð <ð <ð <ð DHð9ð 9Ø�#�u�*Ôð9à˜4  d¨3¤i°°c¸3°h´Ð?Ô@ð9ð ÐÐ-Ð-Ô.ð9ð 9ð 9ð 9ð ˆ3Œ7‰9Œ9€ðw
ð w
ð w
ð w
ð w
ñ w
ô w
ð w
ðt	*ð *ð *€€€r2   