ó
    /j-jÕ¹  ã                   ón  • S r SSKrSSKrSSKrSSKJr  SSKJr  SSKJr  SSK	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJrJr  SSKJrJrJrJrJrJrJ r   SSK!J"r"J#r#J$r$  SS	K%J&r&J'r'J(r(J)r)  SS
K*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7  SSK8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@  SSKAJBrBJCrCJDrD  \
(       a  SSKEJFrF  SSKGJHrH  SSKIJJrJJKrK  \R˜                  " \M5      rN " S S\5      rO\O" SS5      rP\ " S S5      5       rQ " S S\5      rR\S   rS " S S\5      rT\ " S S\\S   5      5       rU\ " S S\U5      5       rV\ " S S\U5      5       rW\&" S 5      rX\ " S! S"\U5      5       rY\ " S# S$\U5      5       rZ " S% S&\U5      r[\ " S' S(\[5      5       r\\ " S) S*\[5      5       r] " S+ S,\\U   \5      r^ " S- S.\\^   5      r_g)/z1
PDF content objects created by the interpreter.
é    N)Úabstractmethod)Úcopy)Ú	dataclass)ÚTYPE_CHECKINGÚ
CollectionÚDictÚIterableÚIteratorÚListÚLiteralÚMappingÚ
NamedTupleÚSequenceÚSizedÚTupleÚTypeÚUnionÚoverload)ÚBASIC_BLACKÚLITERAL_DEFAULTÚLITERAL_NORMALÚLITERAL_RELATIVE_COLORIMETRICÚPREDEFINED_COLORSPACEÚColorÚ
ColorSpace)ÚCIDFontÚFontÚ	Type3Font)ÚLITÚContentParserÚLexerÚToken)ÚContentStreamÚMatrixÚ	PDFObjectÚPointÚ	PSKeywordÚ	PSLiteralÚRectÚ
dict_valueÚ	int_valueÚ
list_valueÚmatrix_valueÚ
rect_valueÚresolve1)Úapply_matrix_ptÚdecode_textÚ	get_boundÚget_bound_rectsÚmult_matrixÚtransform_bboxÚtranslate_matrixÚupdate_glyph_offset)ÚPageRefÚ_deref_documentÚ_deref_page)ÚDocument)ÚPage)ÚElementÚPageStructurec                   ó>   • \ rS rSr% Sr\\S4   \S'   \\S'   S rSr	g)	ÚDashPatternéK   z·
Line dash pattern in PDF graphics state (PDF 1.7 section 8.4.3.6).

Attributes:
  dash: lengths of dashes and gaps in user space units
  phase: starting position in the dash pattern
.ÚdashÚphasec                 ól   • [        U R                  5      S:X  a  gU R                   SU R                   3$ )Nr   Ú Ú )ÚlenrB   rC   ©Úselfs    ÚJ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/playa/content.pyÚ__str__ÚDashPattern.__str__W   s.   € Üˆt�y‰y‹>˜QÓØà—i‘i�[  $§*¡* Ð.Ð.ó    © N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚfloatÚ__annotations__rK   Ú__static_attributes__rN   rM   rJ   r@   r@   K   s"   ‡ ñð ��s�
Ñ
ÓØƒLõ/rM   r@   rN   c                   óÜ  • \ rS rSr% SrSrS\S'   Sr\\S'   Sr	\
\S'   Sr\
\S	'   S
r\\S'   \r\\S'   \r\\S'   Sr\\S'   \r\\\\   4   \S'   Sr\S\\\4   4   \S'   Sr\\S'   Sr\\S'   Sr\\S'   \ r!\\S'   Sr"\\S'   \#r$\%\S'   \&S   r'\(\S'   \#r)\%\S'   \&S   r*\(\S'   Sr+\\,S4   \S'   Sr-\\S'   Sr.\\S'   Sr/\\S'   S r0\\S!'   Sr1\\S"'   Sr2\
\S#'   Sr3\\S$'   S%r4\\S&'   S'r5g)(ÚGraphicStateéa   a‚  PDF graphics state (PDF 1.7 section 8.4) including text state
(PDF 1.7 section 9.3.1), but excluding coordinate transformations.

Contrary to the pretensions of pdfminer.six, the text state is for
the most part not at all separate from the graphics state, and can
be updated outside the confines of `BT` and `ET` operators, thus
there is no advantage and only confusion that comes from treating
it separately.

The only state that does not persist outside `BT` / `ET` pairs is
the text coordinate space (line matrix and text rendering matrix),
and it is also the only part that is updated during iteration over
a `TextObject`.

For historical reasons the main coordinate transformation matrix,
though it is also part of the graphics state, is also stored
separately.

Attributes:
  clipping_path: The current clipping path (sec. 8.5.4)
  linewidth: Line width in user space units (sec. 8.4.3.2)
  linecap: Line cap style (sec. 8.4.3.3)
  linejoin: Line join style (sec. 8.4.3.4)
  miterlimit: Maximum length of mitered line joins (sec. 8.4.3.5)
  dash: Dash pattern for stroking (sec 8.4.3.6)
  intent: Rendering intent (sec. 8.6.5.8)
  stroke_adjustment: A flag specifying whether to compensate for
    possible rasterization effects when stroking a path with a line
    width that is small relative to the pixel resolution of the output
    device (sec. 10.7.5)
  blend_mode: The current blend mode that shall be used in the
    transparent imaging model (sec. 11.3.5)
  smask: A soft-mask dictionary (sec. 11.6.5.1) or None
  salpha: The constant shape or constant opacity value used for
    stroking operations (sec. 11.3.7.2 & 11.6.4.4)
  nalpha: The constant shape or constant opacity value used for
    non-stroking operations
  alpha_source: A flag specifying whether the current soft mask and
    alpha constant parameters shall be interpreted as shape values
    (true) or opacity values (false). This flag also governs the
    interpretation of the SMask entry, if any, in an image dictionary
  black_pt_comp: The black point compensation algorithm that shall be
    used when converting CIE-based colours (sec. 8.6.5.9)
  flatness: The precision with which curves shall be rendered on
    the output device (sec. 10.6.2)
  scolor: Colour used for stroking operations
  scs: Colour space used for stroking operations
  ncolor: Colour used for non-stroking operations
  ncs: Colour space used for non-stroking operations
  font: The current font.
  fontsize: The "font size" parameter, which is **not** the font
    size in points as you might understand it, but rather a
    scaling factor applied to text space (so, it affects not only
    text size but position as well).  Since most reasonable people
    find that behaviour rather confusing, this is often just 1.0,
    and PDFs rely on the text matrix to set the size of text.
  charspace: Extra spacing to add after each glyph, expressed in
    unscaled text space units, meaning it is not affected by
    `fontsize`.  **BUT** it will be modified by `scaling` for
    horizontal writing mode (so, most of the time).
  wordspace: Extra spacing to add after a space glyph, defined
    very specifically as the glyph encoded by the single-byte
    character code 32 (SPOILER: it is probably a space).  Also
    expressed in unscaled text space units, but modified by
    `scaling`.
  scaling: The horizontal scaling factor as defined by the PDF
    standard (that is, divided by 100).
  leading: The leading as defined by the PDF standard, in unscaled
    text space units.
  render_mode: The PDF rendering mode.  The really important one
    here is 3, which means "don't render the text".  You might
    want to use this to detect invisible text.
  rise: The text rise (superscript or subscript position), in
    unscaled text space units.
  knockout: The text knockout flag, shall determine the behaviour of
    overlapping glyphs within a text object in the transparent imaging
    model (sec. 9.3.8)

NÚclipping_pathé   Ú	linewidthr   ÚlinecapÚlinejoiné
   Ú
miterlimitrB   ÚintentFÚstroke_adjustmentÚ
blend_modeÚsmaskÚsalphaÚnalphaÚalpha_sourceÚblack_pt_compÚflatnessÚscolorÚ
DeviceGrayÚscsÚncolorÚncsÚfontÚfontsizeÚ	charspaceÚ	wordspaceéd   ÚscalingÚleadingÚrender_modeÚriseTÚknockoutrN   )6rO   rP   rQ   rR   rS   rZ   rU   r\   rT   r]   Úintr^   r`   Ú
SOLID_LINErB   r@   r   ra   r(   rb   Úboolr   rc   r   r   rd   r   Ústrr%   re   rf   rg   r   rh   ri   r   rj   r   r   rl   r   rm   rn   ro   r   rp   rq   rr   rt   ru   rv   rw   rx   rV   rN   rM   rJ   rX   rX   a   sW  ‡ ñNð` €M�4ÓØ€IˆuÓØ€GˆSÓØ€HˆcÓØ€J�ÓØ"€Dˆ+Ó"Ø5€FˆIÓ5Ø#Ð�tÓ#Ø4B€J��i  i¡Ð0Ñ1ÓBØ/3€Eˆ5��t˜C ˜NÑ+Ð+Ñ,Ó3Ø€FˆEÓØ€FˆEÓØ€L�$ÓØ.€M�9Ó.Ø€HˆeÓØ€FˆEÓØ+¨LÑ9€CˆÓ9Ø€FˆEÓØ+¨LÑ9€CˆÓ9Ø"€Dˆ%��d�
Ñ
Ó"Ø€HˆeÓØ€IˆuÓØ€IˆuÓØ€GˆUÓØ€GˆUÓØ€K�ÓØ€Dˆ%ƒOØ€HˆdÖrM   rX   c                   óL   • \ rS rSr% Sr\\S4   \S'   \\S'   \	\\
4   \S'   Srg)ÚMarkedContentéÑ   zïMarked content point or section in a PDF page or Form XObject.

Attributes:
  mcid: Marked content section ID, or `None` for a marked content point.
  tag: Name of tag for this marked content.
  props: Marked content property dictionary.

NÚmcidÚtagÚpropsrN   )rO   rP   rQ   rR   rS   r   ry   rU   r|   r   r%   rV   rN   rM   rJ   r~   r~   Ñ   s,   ‡ ñð ��T�	Ñ
ÓØ	ƒHØ��Y�ÑÖrM   r~   )ÚhÚmÚlÚvÚcÚyc                   ó8   • \ rS rSr% Sr\\S'   \\S4   \S'   Sr	g)ÚPathSegmentéã   z!
Segment in a PDF graphics path.
Úoperator.ÚpointsrN   N)
rO   rP   rQ   rR   rS   ÚPathOperatorrU   r   r&   rV   rN   rM   rJ   rŠ   rŠ   ã   s   ‡ ñð ÓØ�%˜�*ÑÖrM   rŠ   c                   óP  • \ rS rSr% Sr\\S'   \\S4   \S'   \	\S'   \
\S'   \\S4   \S	'   S
\S    4S jrS
\4S jrSS jr\S
\4S j5       r\S
\\S4   4S j5       r\S
\\S4   4S j5       r\S
\\S4   4S j5       r\S
\S   4S j5       r\SS j5       r\SS j5       rSrg)ÚContentObjectéì   z»Any sort of content object.

Attributes:
  gstate: Graphics state.
  ctm: Coordinate transformation matrix (PDF 1.7 section 8.3.2).
  mcstack: Stack of enclosing marked content sections.
Ú_pagerefNÚ
_parentkeyÚgstateÚctm.ÚmcstackÚreturnc              #   ó$   #   • S S h  v•N   g  N7f)NrN   rN   rH   s    rJ   Ú__iter__ÚContentObject.__iter__ü   s   é € Ø�‹ùs   ‚ˆ‰c                 ó&   • [        S U  5       5      $ )zFReturn the number of children of this object (generic implementation).c              3   ó&   #   • U  H  nS v •  M	     g7f©r[   NrN   ©Ú.0Ú_s     rJ   Ú	<genexpr>Ú(ContentObject.__len__.<locals>.<genexpr>  s   é € Ð#šd˜•1šdùó   ‚)ÚsumrH   s    rJ   Ú__len__ÚContentObject.__len__ÿ   s   € äÑ#™dÓ#Ó#Ð#rM   c                 ó:   • [        U R                  5      U l        U $ )a  Finalize this content object so it can be reused.

Because certain elements (specifically the graphics state) are
references to mutable objects that are updated during content
parsing, reusing ContentObjects is fraught with peril.  This
was a conscious design choice to save time and memory, but
perhaps not a good one.

If you want to reuse a ContentObject, thus, you must call this
method on it.  For convenience, it returns the same
ContentObject, allowing you to do, for instance:

    objs = [x.finalize() for x in page]
)r   r”   rH   s    rJ   ÚfinalizeÚContentObject.finalize  s   € ô ˜4Ÿ;™;Ó'ˆŒØˆrM   c                 óh   • U R                   R                  nUS[        S5      *  R                  5       $ )z>Type of this object as a string, e.g. "text", "path", "image".NÚObject)Ú	__class__rO   rG   Úlower©rI   Únames     rJ   Úobject_typeÚContentObject.object_type  s0   € ð �~‰~×&Ñ&ˆØÐ$”s˜8“}�nÐ%×+Ñ+Ó-Ð-rM   c                 ó&   • [        S U  5       5      $ )z0The bounding box in device space of this object.c              3   ó8   #   • U  H  oR                   v •  M     g 7f©N)Úbbox)rŸ   Úitems     rJ   r¡   Ú%ContentObject.bbox.<locals>.<genexpr>   s   é € Ð:²T¨TŸyžy²Tùó   ‚)r3   rH   s    rJ   rµ   ÚContentObject.bbox  s   € ô
 Ñ:±TÓ:Ó:Ð:rM   c                 óF   • U R                   (       a  U R                   S   $ S$ )z1The immediately enclosing marked content section.éÿÿÿÿN)r–   rH   s    rJ   ÚmcsÚContentObject.mcs"  s   € ð $(§<§<ˆt�|‰|˜BÑÐ9°TÐ9rM   c                 óê   • [        U S5      (       a  U R                  $ U R                  SSS2    H.  nUR                  c  M  UR                  U l          U R                  $    SU l        U R                  $ )a³  The marked content ID of the nearest enclosing marked
content section with an ID.

This is notably what you should use (and what `parent` uses)
to find the parent logical structure element, because (PDF
14.7.5.1.1):

> A marked-content sequence corresponding to a structure
content item shall not have another marked-content sequence
for a structure content item nested within it though
non-structural marked-content shall be allowed.
Ú_mcidNr»   )Úhasattrr¿   r–   r€   )rI   r¼   s     rJ   r€   ÚContentObject.mcid'  si   € ô �4˜×!Ñ!Ø—:‘:ÐØ—<‘<¡ " Ô%ˆCØ�x‰xÓ#Ø/2¯x©x�”
Øð �z‰zÐñ &ð
 ˆDŒJØ�z‰zÐrM   ©r=   Nc                 óœ  • SSK Jn  [        U S5      (       a  U R                  $ SU l        U R                  nUc  U R                  $ U R
                  R                  nUc  U R                  $ U R                  nUc  U R                  $ [        UR                  U   5      nU[        U5      :¼  a,  [        R                  SU[        U5      5        U R                  $ XT   c7  [        R                  SUU R                  R                  5        U R                  $ UR                  " U R
                  [!        XT   5      5      U l        U R                  $ )ú0The enclosing logical structure element, if any.r   ©r=   Ú_parentNz1Invalid marked content ID: %d (page has %d MCIDs)z9Marked content ID %d on page_idx %d has no parent element)Úplaya.structurer=   rÀ   rÆ   r“   ÚdocÚ	structurer€   r,   Úparent_treerG   ÚlogÚwarningÚpageÚpage_idxÚ	from_dictr*   )rI   r=   Ú
parent_keyrÉ   r€   Úparentss         rJ   ÚparentÚContentObject.parent?  s  € õ 	,ô �4˜×#Ñ#Ø—<‘<ÐØ/3ˆŒØ—_‘_ˆ
ØÑØ—<‘<ÐØ—H‘H×&Ñ&ˆ	ØÑØ—<‘<ÐØ�y‰yˆØ‰<Ø—<‘<ÐÜ˜Y×2Ñ2°:Ñ>Ó?ˆØ”3�w“<ÓÜ�K‰KØCÀTÌ3ÈwË<ôð —<‘<ÐØ‰=Ñ Ü�K‰KØKØØ—	‘	×"Ñ"ôð
 —<‘<ÐØ×(Ò(¨¯©´:¸g¹mÓ3LÓMˆŒØ�|‰|ÐrM   c                 ó,   • [        U R                  5      $ )z(The page containing this content object.)r:   r’   rH   s    rJ   rÍ   ÚContentObject.pagea  s   € ô ˜4Ÿ=™=Ó)Ð)rM   c                 ó4   • U R                   u  p[        U5      $ )z,The document containing this content object.)r’   r9   )rI   Údocrefr    s      rJ   rÈ   ÚContentObject.docf  s   € ð —M‘M‰	ˆÜ˜vÓ&Ð&rM   )r¿   rÆ   r”   )r—   r�   )r—   r<   )r—   r;   )rO   rP   rQ   rR   rS   r8   rU   r   ry   rX   r$   r   r~   r
   r™   r¥   r¨   Úpropertyr|   r°   r)   rµ   r¼   r€   rÒ   rÍ   rÈ   rV   rN   rM   rJ   r�   r�   ì   s,  ‡ ñð ÓØ�c˜4�iÑ Ó ØÓØ	ƒKØ�= #Ð%Ñ&Ó&ð˜( ?Ñ3ô ð$˜ô $ôð$ ð.˜Só .ó ð.ð
 ð;�e˜D $˜JÑ'ó ;ó ð;ð ð:�U˜=¨$Ð.Ñ/ó :ó ð:ð ð�e˜C ˜IÑ&ó ó ðð. ð˜˜oÑ.ó ó ððB ó*ó ð*ð ó'ó ó'rM   r�   c                   óœ   ^ • \ rS rSr% Sr\\S'   S\4S jr\	S\4S j5       r
\	S\\S4   4U 4S jj5       r\	S\\S4   4S	 j5       rS
rU =r$ )Ú	TagObjectim  zA marked content tag..Ú_mcsr—   c                 ó   • g)z9A tag has no contents, iterating over it returns nothing.r   rN   rH   s    rJ   r¥   ÚTagObject.__len__s  s   € àrM   c                 ó   • U R                   $ )z'The marked content tag for this object.)rÜ   rH   s    rJ   r¼   ÚTagObject.mcsw  s   € ð �y‰yÐrM   Nc                 ór   >• U R                   R                  b  U R                   R                  $ [        TU ]  $ )zQThe marked content ID of the nearest enclosing marked
content section with an ID.)rÜ   r€   Úsuper)rI   r¬   s    €rJ   r€   ÚTagObject.mcid|  s+   ø€ ð �9‰9�>‰>Ñ%Ø—9‘9—>‘>Ð!Ü‰w‰|ÐrM   c                 ó   • g)z.A tag has no content and thus no bounding box.NrN   rH   s    rJ   rµ   ÚTagObject.bbox„  s   € ð rM   rN   )rO   rP   rQ   rR   rS   r~   rU   ry   r¥   rÙ   r¼   r   r€   r)   rµ   rV   Ú__classcell__©r¬   s   @rJ   rÛ   rÛ   m  s{   ø‡ á à
Óð˜ô ð ð�]ó ó ðð ð�e˜C ˜IÑ&ö ó ðð ð�e˜D $˜JÑ'ó ó örM   rÛ   c                   ó&  ^ • \ rS rSr% Sr\\S4   \S'   \\	\	4   \S'   \	\S'   \
\S'   \\S'   \\S4   \S	'   S
\S\
4S jrS
\S\4S jrSS
\S\S\4S jjrS\	4S jr\S\S   4U 4S jj5       r\S\4S j5       r\S\\S4   4S j5       rSrU =r$ )ÚImageObjectiŠ  av  An image (either inline or XObject).

Attributes:
  xobjid: Name of XObject (or None for inline images).
  srcsize: Size of source image in pixels.
  bits: Number of bits per component, if required (otherwise 1).
  imagemask: True if the image is a mask.
  stream: Content stream with image data.
  colorspace: Colour space for this image, if required (otherwise
    None).
NÚxobjidÚsrcsizeÚbitsÚ	imagemaskÚstreamÚ
colorspacer¯   r—   c                 ó   • XR                   ;   $ r´   ©rî   r®   s     rJ   Ú__contains__ÚImageObject.__contains__Ÿ  s   € Ø—{‘{Ñ"Ð"rM   c                 ó    • U R                   U   $ r´   rñ   r®   s     rJ   Ú__getitem__ÚImageObject.__getitem__¢  s   € Ø�{‰{˜4Ñ Ð rM   Údefaultc                 ó8   • U R                   R                  X5      $ r´   )rî   Úget)rI   r¯   r÷   s      rJ   rù   ÚImageObject.get¥  s   € Ø�{‰{�‰˜tÓ-Ð-rM   c                 ó   • g)zpEven though you can __getitem__ from an image you cannot iterate
over its keys, sorry about that.  Returns zero.r   rN   rH   s    rJ   r¥   ÚImageObject.__len__¨  s   € ð rM   rÂ   c                 ó  >• SSK Jn  [        U S5      (       a  U R                  $ SU l        U R                  c  U R                  $ U R
                  R                  c  U R                  $  [        U R
                  R                  R                  U R                     5      n[        U[        5      (       a.  UR                  " U R
                  U5      U l        U R                  $ U ?[        TU ]4  $ ! [         a     U R                  $ f = f©rÄ   r   rÅ   rÆ   N©rÇ   r=   rÀ   rÆ   r“   rÈ   rÉ   r/   rÊ   Ú
isinstanceÚdictrÏ   râ   rÒ   Ú
IndexError©rI   r=   rÒ   r¬   s      €rJ   rÒ   ÚImageObject.parent­  óÚ   ø€ õ 	,ä�4˜×#Ñ#Ø—<‘<ÐØˆŒØ�?‰?Ñ"Ø—<‘<Ðà�8‰8×ÑÑ%Ø—<‘<Ðð	Ü˜dŸh™h×0Ñ0×<Ñ<¸T¿_¹_ÑMÓNˆFÜ˜&¤$×'Ñ'Ø&×0Ò0°·±¸6ÓB�”ð �|‰|Ðð	 �LÜ‘w‘~Ð%øÜó 	ØØ�|‰|Ðð	úó   Á)A-C. Ã"C. Ã.
DÄDc                 ó.   • U R                   R                  $ )z$Binary stream content for this image©rî   ÚbufferrH   s    rJ   r	  ÚImageObject.bufferÅ  ó   € ð �{‰{×!Ñ!Ð!rM   c                 ó.   • [        U R                  S5      $ )N)r   r   r[   r[   )r5   r•   rH   s    rJ   rµ   ÚImageObject.bboxÊ  s   € ô ˜dŸh™h¨Ó5Ð5rM   )rÆ   r´   )rO   rP   rQ   rR   rS   r   r|   rU   r   ry   r{   r#   r   rò   r%   rõ   rù   r¥   rÙ   rÒ   Úbytesr	  r)   rµ   rV   ræ   rç   s   @rJ   ré   ré   Š  sò   ø‡ ñ
ð �#�t�)ÑÓØ�3˜�8‰_ÓØ
ƒIØƒOØÓØ�j $Ð&Ñ'Ó'ð# ð #¨ô #ð! ð !¨	ô !ñ.˜ð . ið .¸9õ .ð˜ô ð
 ð˜˜oÑ.ö ó ðð. ð"˜ó "ó ð"ð ð6�e˜D $˜JÑ'ó 6ó ö6rM   ré   ÚTransparencyc                   óä  ^ • \ rS rSr% Sr\\S'   \\S'   \S\	\\
4   4   \S'   \S\	\\
4   4   \S'   \S\4S	 j5       r\S\4S
 j5       r\S\\   4S j5       r\S\\
   4S j5       r  SS\\\\      S4   S\\\   S4   S\\   4S jjrS\\   4S jr\S\S   4U 4S jj5       r\SS j5       r\S S j5       r\S\\\4   4S j5       r\ S\SSS\S\!S\"S\#\$S4   SS 4S j5       r%Sr&U =r'$ )!ÚXObjectObjecti×  a^  An eXternal Object, in the context of a page.

There are a couple of kinds of XObjects.  Here we are only
concerned with "Form XObjects" which, despite their name, have
nothing at all to do with fillable forms.  Instead they are like
little embeddable PDF pages, possibly with their own resources,
definitely with their own definition of "user space".

Image XObjects are handled by `ImageObject`.

Attributes:
  xobjid: Name of this XObject (in the page resources).
  stream: Content stream with PDF operators.
  resources: Resources specific to this XObject, if any.
  group: Transparency group, if any.
rê   rî   NÚ	resourcesÚgroupr—   c                 óü   • SU R                   ;  aA  [        R                  SU R                  U R                   5        U R                  R
                  $ [        U R                  [        U R                   S   5      5      $ )z5Get the bounding box of this XObject in device space.ÚBBoxzXObject %r has no BBox: %r)	rî   rË   Údebugrê   rÍ   Úcropboxr5   r•   r.   rH   s    rJ   rµ   ÚXObjectObject.bboxï  sX   € ð ˜Ÿ™Ó$Ü�I‰IÐ2°D·K±KÀÇÁÔMØ—9‘9×$Ñ$Ð$Ü˜dŸh™h¬
°4·;±;¸vÑ3FÓ(GÓHÐHrM   c                 ó.   • U R                   R                  $ )z#Raw stream content for this XObjectr  rH   s    rJ   r	  ÚXObjectObject.bufferø  r  rM   c              #   ód   #   • [        U R                  R                  5       H	  u  pUv •  M     g7f)z4Iterate over tokens in the XObject's content stream.N)r!   rî   r	  )rI   r    Útoks      rJ   ÚtokensÚXObjectObject.tokensý  s'   é € ô ˜DŸK™K×.Ñ.Ö/‰FˆAØŒIò 0ùs   ‚.0c              #   óh   #   • [        U R                  /U R                  5       H	  u  pUv •  M     g7f)z0Iterator over PDF objects in the content stream.N)r    rî   rÈ   )rI   ÚposÚobjs      rJ   ÚcontentsÚXObjectObject.contents  s)   é € ô & t§{¡{ m°T·X±XÖ>‰HˆCØŒIò ?ùs   ‚02Úfilter_classesÚrestrict_opsc                 ó¢   • SSK Jn  U" U R                  U R                  /U R                  U R
                  U R                  U R                  UUS9$ )Nr   ©ÚLazyInterpreter)r•   r”   rÐ   r$  r%  )Úplaya.interpr(  rÍ   rî   r  r•   r”   r“   )rI   r$  r%  r(  s       rJ   ÚinterpÚXObjectObject.interp	  sH   € õ
 	1áØ�I‰IØ�[‰[ˆMØ�N‰NØ—‘Ø—;‘;ð
 —‘Ø)Ø%ñ
ð 	
rM   c                 ó"   • U R                  5       $ r´   )r*  rH   s    rJ   r™   ÚXObjectObject.__iter__  s   € Ø�{‰{‹}ÐrM   rÂ   c                 ó  >• SSK Jn  [        U S5      (       a  U R                  $ SU l        U R                  c  U R                  $ U R
                  R                  c  U R                  $  [        U R
                  R                  R                  U R                     5      n[        U[        5      (       a.  UR                  " U R
                  U5      U l        U R                  $ U ?[        TU ]4  $ ! [         a     U R                  $ f = frþ   rÿ   r  s      €rJ   rÒ   ÚXObjectObject.parent"  r  r  c                 óB  • SSK Jn  [        U S5      (       a  U R                  $ U" U R                  / 5      U l        U R
                  R                  c  U R                  $ U R                  c  U R                  $  U" U R                  U R
                  R                  R                  U R                     5      U l        U R                  $ ! [         a6  n[        R                  SU R                  U5         SnAU R                  $ SnAf[         a     U R                  $ f = f)z«Mapping of marked content IDs to logical structure elements.

As with pages, Form XObjects can also contain their own
mapping of marked content IDs to structure elements.
r   )r>   Ú
_structmapNzInvalid StructParents: %r (%s))rÇ   r>   rÀ   r1  r’   rÈ   rÉ   r“   rÊ   r  rË   rÌ   Ú	TypeError)rI   r>   Úes      rJ   rÉ   ÚXObjectObject.structure:  sí   € õ 	2ä�4˜×&Ñ&Ø—?‘?Ð"Ù)6°t·}±}ÀbÓ)IˆŒØ�8‰8×ÑÑ%Ø—?‘?Ð"Ø�?‰?Ñ"Ø—?‘?Ð"ð		Ù+Ø—‘˜tŸx™x×1Ñ1×=Ñ=¸d¿o¹oÑNóˆDŒOð �‰Ðøô ó 	NÜ�K‰KÐ8¸$¿/¹/È1×MÐMð
 �‰Ðûô	 ó 	ð Ø�‰Ðð		ús   Á9AC Ã
DÃ!DÄDÄDc                 ót   • [        U S5      (       a  U R                  $ [        U 5      U l        U R                  $ )a`  A [`ContentSequence`][playa.content.ContentSequence] containing
content objects associated with the structural elements in
[`structure`][playa.content.XObjectObject.structure].  They
consist of a sequence with the same indices (these are the
marked content IDs) as the structure so can be zipped:

    for element, contents in zip(xobj.structure,
                                 xobj.marked_content):
        for obj in contents:
            ...  # do something with it

Or you can also access the contents of a single element:

    for obj in xobj.marked_content[mcid]:
        ... # do something with it

Ú_marked_contents)rÀ   r6  ÚContentSequencerH   s    rJ   Úmarked_contentÚXObjectObject.marked_contentV  s7   € ô& �4Ð+×,Ñ,Ø×(Ñ(Ð(Ü1@ÀÓ1FˆÔØ×$Ñ$Ð$rM   c                 óè   • SSK Jn  [        U S5      (       a  U R                  $ U" U R                  (       a  U R                  R                  S5      OSU R                  5      U l        U R                  $ )aò  Mapping of resource names to fonts for this Form XObject.

Note: This is not the same as `playa.Document.fonts`.
    The resource names (e.g. `F1`, `F42`, `FooBar`) here are
    specific to a page (or Form XObject) resource dictionary
    and have no relation to the font name as commonly
    understood (e.g. `Helvetica`,
    `WQERQE+Arial-SuperBold-HJRE-UTF-8`).  Since font names are
    generally considered to be globally unique, it may be
    possible to access fonts by them in the future.

r   )ÚFontMappingÚ_fontmapr   N)r)  r;  rÀ   r<  r  rù   rÈ   )rI   r;  s     rJ   ÚfontsÚXObjectObject.fontsn  sV   € õ 	-ä�4˜×$Ñ$Ø—=‘=Ð Ù,7Ø*.¯.¯.ˆD�N‰N×Ñ˜vÔ&¸dÀDÇHÁHó-
ˆŒð �}‰}ÐrM   rÍ   r<   r”   r•   r–   .c                 óà  • SU;   a  [        [        US   5      U5      nUR                  S5      nUc  SO
[        U5      nUR                  S5      n	U	c  SO
[        U	5      n
U
(       aD  U
R                  S5      [        :X  a+  [        U5      n[        Ul        S=Ul        Ul	        SUl
        SU;   a  [        US   5      nOSU;   a  [        US   5      nOSnU " UR                  UUUUUUUU
S	9	$ )
z1Create a new XObjectObject from a content stream.r$   Ú	ResourcesNÚGroupÚSr[   ÚStructParentÚStructParents)	r’   r“   r”   r•   r–   rê   rî   r  r  )r4   r-   rù   r*   ÚLITERAL_TRANSPARENCYr   r   rc   re   rf   rd   r+   Úpageref)Úclsrî   rÍ   rê   r”   r•   r–   Úxobjresr  Úxobjgrpr  rÐ   s               rJ   Úfrom_streamÚXObjectObject.from_stream…  sþ   € ð �vÓÜœl¨6°(Ñ+;Ó<¸cÓBˆCð —*‘*˜[Ó)ˆØ#™O‘D´¸GÓ1Dˆ	Ø—*‘*˜WÓ%ˆØ™‘¬Z¸Ó-@ˆö �U—Y‘Y˜s“^Ô';Ó;ô ˜&“\ˆFÜ .ˆFÔØ,-Ð-ˆFŒM˜FœMØˆFŒLð ˜VÓ#Ü" 6¨.Ñ#9Ó:‰JØ Ó&Ü" 6¨/Ñ#:Ó;‰JàˆJÙØ—\‘\Ø!ØØØØØØØñ

ð 
	
rM   )r<  r6  rÆ   r1  )NN)r—   r>   )r—   r7  )(rO   rP   rQ   rR   rS   r|   rU   r#   r   r   r%   rÙ   r)   rµ   r  r	  r
   r"   r  r"  r   r   r�   r'   r*  r™   rÒ   rÉ   r8  r   r   r=  ÚclassmethodrX   r$   r   r~   rJ  rV   ræ   rç   s   @rJ   r  r  ×  sï  ø‡ ñð" ƒKØÓØ�T˜4  Y Ñ/Ð/Ñ0Ó0Ø��t˜C ˜NÑ+Ð+Ñ,Ó,àðI�dó Ió ðIð ð"˜ó "ó ð"ð ð˜ ™ó ó ðð
 ð˜( 9Ñ-ó ó ðð HLØ;?ñ
à˜j¨¨mÑ)<Ñ=¸tÐCÑDð
ð ˜J yÑ1°4Ð7Ñ8ð
ð 
�-Ñ	 õ	
ð,˜( =Ñ1ô ð ð˜˜oÑ.ö ó ðð. óó ðð6 ó%ó ð%ð. ð�w˜s D˜yÑ)ó ó ðð, ð6
àð6
ð ð6
ð ð	6
ð
 ð6
ð ð6
ð �} cÐ)Ñ*ð6
ð 
ó6
ó ö6
rM   r  c                   ó~   • \ rS rSr% Sr\\   \S'   \\S'   \\S'   \\S'   \	S\
\   4S j5       r\	S\4S	 j5       rS
rg)Ú
PathObjecti¿  aL  A path object.

Attributes:
  raw_segments: Segments in path (in user space).
  stroke: True if the outline of the path is stroked.
  fill: True if the path is filled.
  evenodd: True if the filling of complex paths uses the even-odd
    winding rule, False if the non-zero winding number rule is
    used (PDF 1.7 section 8.5.3.3)
Úraw_segmentsÚstrokeÚfillÚevenoddr—   c                 ó0   ^ • U 4S jT R                    5       $ )z"Get path segments in device space.c              3   óŠ   >#   • U  H8  n[        UR                  [        U4S  jUR                   5       5      5      v •  M:     g7f)c              3   óP   >#   • U  H  n[        TR                  U5      v •  M     g 7fr´   )r0   r•   )rŸ   ÚpointrI   s     €rJ   r¡   Ú0PathObject.segments.<locals>.<genexpr>.<genexpr>×  s   øé € ÐMÂH¸5”o d§h¡h°×6Ð6ÂHùs   ƒ#&N)rŠ   rŒ   Útupler�   )rŸ   ÚprI   s     €rJ   r¡   Ú&PathObject.segments.<locals>.<genexpr>Ô  s?   øé € ð 
ò
 '�ô	 Ø—
‘
ÜÔMÀAÇHÂHÓMÓM÷ð ò 'ùs   ƒA A)rO  rH   s   `rJ   ÚsegmentsÚPathObject.segmentsÑ  s   ø€ ô
ð
 ×&Ò&ó
ð 	
rM   c                 ó    • [        [        R                  R                  S U R                   5       5      5      n[        U R                  U5      $ )zUGet bounding box of path in device space as defined by its
points and control points.c              3   ó8   #   • U  H  oR                   v •  M     g 7fr´   )r�   )rŸ   Úsegs     rJ   r¡   Ú"PathObject.bbox.<locals>.<genexpr>â  s   é € Ð)RÒ@Q¸¯*®*Ò@Qùr¸   )r2   Ú	itertoolsÚchainÚfrom_iterablerO  r5   r•   )rI   rµ   s     rJ   rµ   ÚPathObject.bboxÜ  s?   € ô
 Ü�O‰O×)Ñ)Ñ)RÀ×@QÒ@QÓ)RÓRó
ˆô ˜dŸh™h¨Ó-Ð-rM   rN   N)rO   rP   rQ   rR   rS   r   rŠ   rU   r{   rÙ   r
   r[  r)   rµ   rV   rN   rM   rJ   rN  rN  ¿  s\   ‡ ñ	ð �{Ñ#Ó#ØƒLØ
ƒJØƒMàð
˜( ;Ñ/ó 
ó ð
ð ð.�dó .ó ó.rM   rN  c                   óì   • \ rS rSrSr\\S\4S j5       5       r\\S\	4S j5       5       r
\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S	 j5       r\S\4S
 j5       r\S\	4S j5       rSrg)ÚTextBaseiè  z-Common properties for text and glyph objects.r—   c                 ó   • g)ziRendering matrix `T_rm`, which transforms text space coordinates to
device space (PDF 2.0 section 9.4.4).NrN   rH   s    rJ   ÚmatrixÚTextBase.matrixë  ó   � rM   c                 ó   • g)z7Vector to the origin of the next glyph in device space.NrN   rH   s    rJ   ÚdisplacementÚTextBase.displacementñ  rj  rM   c                 ó<   • U R                   R                  nUc   eU$ )zFont for this text object.)r”   ro   ©rI   ro   s     rJ   ro   ÚTextBase.fontö  s$   € ð �{‰{×ÑˆØÑÐÐØˆrM   c                 óH  • U R                   R                  c  SOU R                   R                  R                  nU(       a  U R                  u  p#      nOU R                  u    pBn  nUS:X  a  [	        U5      $ US:X  a  [	        U5      $ SSKnUR                  X"-  X3-  -   5      $ )zÝFont size for this text object.

This is the actual font size in device space, which is **not**
the same as `GraphicState.fontsize`.  That's the font size in
text space which is not a very useful number (it's usually 1).
NFr   )r”   ro   Úverticalrh  ÚabsÚmathÚsqrt)rI   ÚvertÚdxÚdyr    rt  s         rJ   ÚsizeÚTextBase.sizeý  s’   € ð Ÿ™×(Ñ(Ñ0‰u°d·k±k×6FÑ6F×6OÑ6OˆÞà!%§¡ÑˆB�A�q˜!™Qð "&§¡ÑˆAˆq�b˜!˜QØ�‹7Ü�r“7ˆNØ�1‹WÜ�r“7ˆNãà—9‘9˜R™W r¡wÑ.Ó/Ð/rM   c                 ó.   • U R                   R                  $ )zFont name for this text object)ro   ÚfontnamerH   s    rJ   r|  ÚTextBase.fontname  s   € ð �y‰y×!Ñ!Ð!rM   c                 óX   • U R                   nUR                  S5      u  p#nU(       a  U$ U$ )a¼  Original font name for this text object.

Fonts in PDF files are usually "subsetted", meaning only the
glyphs actually used in the document are included.  In this
case the font's `fontname` property usually consists of an
arbitrary "tag", plus (literally, a `+`) and the original
name.  This is a convenience property to get that original
name.

This is not the same as `GraphicState.font.basefont` which
usually also includes the subset tag.

Ú+)r|  Ú	partition)rI   r|  Úsubsetr    Úbases        rJ   ÚfontbaseÚTextBase.fontbase  s.   € ð —=‘=ˆØ"×,Ñ,¨SÓ1‰ˆ�4ÞØˆKØˆrM   c                 óJ   • U R                    S[        U R                  5       3$ )zOConvenient short form of the font name and size.

For example, "Helvetica 12".
rF   )rƒ  Úroundry  rH   s    rJ   ÚtextfontÚTextBase.textfont/  s#   € ð —-‘-� ¤%¨¯	©	Ó"2Ð!3Ð4Ð4rM   c                 ó,   • U R                   u        pnX#4$ )z+Origin of this text object in device space.)rh  )rI   r    rw  rx  s       rJ   ÚoriginÚTextBase.origin7  s   € ð "Ÿ[™[Ñˆˆ1ˆa�˜ØˆvˆrM   rN   N)rO   rP   rQ   rR   rS   rÙ   r   r$   rh  r&   rl  r   ro   rT   ry  r|   r|  rƒ  r‡  rŠ  rV   rN   rM   rJ   rf  rf  è  sî   † Ù7àØð1˜ó 1ó ó ð1ð ØðF˜eó Fó ó ðFð ð�dó ó ðð ð0�eó 0ó ð0ð. ð"˜#ó "ó ð"ð ð˜#ó ó ðð( ð5˜#ó 5ó ð5ð ð˜ó ó órM   rf  c                   óÊ   • \ rS rSr% Sr\\S'   \\S4   \S'   \	\S'   \
\S'   \\S'   S	\\   4S
 jr\S	\	4S j5       r\S	\4S j5       r\S	\4S j5       r\S	\4S j5       rSrg)ÚGlyphObjecti>  a{  Individual glyph on the page.

Attributes:
  font: Font for this glyph.
  size: Effective font size for this glyph.
  fontname: Font name.
  fontbase: Short (non-subset) font name.
  textfont: Combined short name and size for the font.
  cid: Character ID for this glyph.
  text: Unicode mapping of this glyph, if any.
  matrix: Rendering matrix `T_rm` for this glyph, which transforms
          text space coordinates to device space (PDF 2.0 section
          9.4.4).
  origin: Origin of this glyph in device space.
  displacement: Vector to the origin of the next glyph in device space.
  bbox: glyph bounding box in device space.

ÚcidNÚtextÚ_matrixÚ_displacementÚ_cornersr—   c           	      óJ  • SSK Jn  U R                  n[        S5      n[	        U[
        5      (       d  U$ UR                  R                  U R                  5      nUc#  [        R                  SU R                  U5        U$ [        UR                  R                  U5      5      n[	        U[        5      (       d  [        R                  SXB5        U$ U" U R                  U/UR                  [!        UR"                  U R"                  5      U R$                  S9n[        U5      nU$ )zêPossibly iterate over paths in a glyph.

For Type3 fonts, you can iterate over paths (or anything
else) inside a glyph, in the coordinate space defined by the
text rendering matrix.

Otherwise, you can't do that, and you get nothing.
r   )ÚType3InterpreterrN   zUnknown CID %d in Type3 font %rz!CharProc %s not found in font %r )r•   r”   )r)  r”  ro   Úiterr   r   Úencodingrù   rŽ  rË   rÌ   r/   Ú	charprocsr#   rÍ   r  r4   rh  r”   )rI   r”  ro   ÚitorÚgidÚcharprocr*  s          rJ   r™   ÚGlyphObject.__iter__Y  sæ   € õ 	2à�y‰yˆÜ(,¨R«ˆÜ˜$¤	×*Ñ*ØˆKØ�m‰m×Ñ §¡Ó)ˆØ‰;Ü�K‰KÐ9¸4¿8¹8ÀTÔJØˆKÜ˜DŸN™N×.Ñ.¨sÓ3Ó4ˆÜ˜(¤M×2Ñ2Ü�K‰KÐ;¸SÔGØˆKá!Ø�I‰IØˆJØ�N‰NÜ˜DŸK™K¨¯©Ó5ð —;‘;ñ
ˆô �F‹|ˆð ˆrM   c                 ó   • U R                   $ r´   )r�  rH   s    rJ   rh  ÚGlyphObject.matrix€  s   € à�|‰|ÐrM   c                 ó,   • U R                   =(       d    S$ )NrE   )r�  rH   s    rJ   ÚcharsÚGlyphObject.chars„  s   € à�y‰y�˜BÐrM   c                 óÊ   • U R                   u  pp4  nU R                  R                  (       a  X0R                  -  X@R                  -  4$ XR                  -  X R                  -  4$ r´   )rh  ro   rr  r‘  )rI   ÚaÚbr‡   Údr    s         rJ   rl  ÚGlyphObject.displacementˆ  s]   € ð  Ÿ;™;Ñˆˆa�A�qØ�9‰9××Ø×)Ñ)Ñ)¨1×/AÑ/AÑ+AÐAÐAà×)Ñ)Ñ)¨1×/AÑ/AÑ+AÐAÐArM   c           
      óÂ  • U R                   R                  U R                  5      u  pp4U R                  (       ac  [	        [        U R                  X45      [        U R                  X45      [        U R                  X445      [        U R                  X245      45      $ [        U R                  X45      u  p[        U R                  X445      u  p4X1:  a  X1p1XB:  a  XBpBXX44$ r´   )ro   Ú	char_bboxrŽ  r’  r2   r0   rh  )rI   Úx0Úy0Úx1Úy1s        rJ   rµ   ÚGlyphObject.bbox•  sÀ   € àŸ™×,Ñ,¨T¯X©XÓ6‰ˆ�Ø�=�=Üä# D§K¡K°"°Ó:Ü# D§K¡K°"°Ó:Ü# D§K¡K°"°Ó:Ü# D§K¡K°"°Ó:ð	óð ô % T§[¡[°2°(Ó;‰FˆBÜ$ T§[¡[°2°(Ó;‰FˆBØ‹wØ�BØ‹wØ�BØ˜BÐ#Ð#rM   rN   )rO   rP   rQ   rR   rS   ry   rU   r   r|   r$   rT   r{   r
   r�   r™   rÙ   rh  rŸ  r&   rl  r)   rµ   rV   rN   rM   rJ   r�  r�  >  s®   ‡ ñð& 
ƒHØ
��T�	Ñ
ÓØƒOØÓØƒNð%˜( =Ñ1ô %ðN ð˜ó ó ðð ð�só ó ðð ð
B˜eó 
Bó ð
Bð ð$�dó $ó ó$rM   r�  c                   ó�  • \ rS rSr% Sr\\\\4      \	S'   \
\	S'   \\	S'   Sr\\
S4   \	S'   Sr\\\   S4   \	S'   Sr\\S4   \	S	'   Sr\\S4   \	S
'   Sr\\S4   \	S'   S\\   4S jrS\4S jr\S\
4S j5       r\S\
4S j5       r\S\
4S j5       r\S\4S j5       r\S\\S4   4S j5       r\S\4S j5       rS\4S jrSr g)Ú
TextObjecti«  aÜ  Text object (contains one or more glyphs).

Attributes:

  matrix: Initial rendering matrix `T_rm` for this text object,
          which transforms text space coordinates to device space
          (PDF 2.0 section 9.4.4).
  origin: Origin of this text object in device space.
  displacement: Vector to the origin of the next text object in
                device space.
  font: Font for this text object.
  size: Effective font size for this text object.
  fontname: Font name.
  fontbase: Short (non-subset) font name.
  textfont: Combined short name and size for the font.
  text_matrix: Text matrix `T_m` for this text object, which
               transforms text space coordinates to user space.
  line_matrix: Text line matrix `T_lm` for this text object, which
               is the text matrix at the beginning of the "current
               line" (PDF 2.0 section 9.4.1).  Note that this is
               **not** reliable for detecting line breaks.
  scaling_matrix: The anonymous but rather important matrix which
                  applies font size, horizontal scaling and rise to
                  obtain the rendering matrix (PDF 2.0 sec 9.4.4).
  args: Strings or position adjustments.
  bbox: Text bounding box in device space.

ÚargsÚline_matrixÚ_glyph_offsetNr�  Ú_charsÚ_bboxÚ_next_glyph_offsetr‘  r—   c              #   óP  #   • U R                   nU R                  R                  nUc'  [        R	                  SU R
                  5        Xl        gU R                  c   e[        U R                  U R                  5      nUu  pEpg  nXW-  S:  =(       d    XF-  S:  n	U R                  R                  n
U R                  R                  S-  nU
S:X  a  S=pÍO2U R                  R                  U
-  nU R                  R                  U
-  nX«-  SSU
SU R                  R                  4nUR                  nUR                   (       a  SnUu  nnU(       a  UOUnU R
                   GH  n[#        U[$        [&        45      (       a$  U(       a  UUS-  U
-  -  nM3  UUS-  U
-  U-  -  nMC  UR)                  U5       HÇ  u  nnU(       a  UU4OUU4nU(       a  UR+                  U5      OUR-                  U5      nUU-  nUS:X  a  UU-  n[        U[/        X15      5      n[1        U R2                  U R4                  U R                  U R                  U R6                  UUUUU	S9
nUv •  U(       a
  UUU
-  -  nM¼  UUU
-  U-  -  nMÉ     GM"     U(       a  UU4OUU4nU R                  c  Xl        gg7f)	z$Generate glyphs for this text objectNú@No font is set, will not update text state or output text: %r TJr   ç{®Gáz„?g        çü©ñÒMbP?é    )
r’   r“   r”   r•   r–   rŽ  r�  r�  r‘  r’  )r±  r”   ro   rË   rÌ   r¯  r´  r•   r4   r°  rp   rt   rq   rr   rw   rr  Ú	multibyter   ry   rT   ÚdecodeÚvdispÚhdispr6   r�  r’   r“   r–   )rI   Úglyph_offsetro   Útlm_ctmr¢  r£  r‡   r¤  r    Úcornersrp   Úhorizontal_scalingÚscaled_charspaceÚscaled_wordspaceÚscaling_matrixrv  Úxrˆ   r   r!  rŽ  r�  Údisprh  Úglyphs                            rJ   r™   ÚTextObject.__iter__Ô  sœ  é € à×)Ñ)ˆØ�{‰{×Ñˆð ‰<Ü�K‰KØRØ—	‘	ôð '3Ô#ØØ�x‰xÑ#Ð#Ð#ä˜d×.Ñ.°·±Ó9ˆà"Ñˆˆa�A�qØ‘%˜!‘)×(˜q™u q™yˆØ—;‘;×'Ñ'ˆØ!Ÿ[™[×0Ñ0°4Ñ7Ðð
 �s‹?à25Ð5ÐÐ/à#Ÿ{™{×4Ñ4°xÑ?Ðà#Ÿ{™{×4Ñ4°xÑ?Ðð Ñ)ØØØØØ�K‰K×Ñð
ˆð �}‰}ˆà�>�>Ø ÐØ‰ˆˆAÞ‰a˜QˆØ—9•9ˆCÜ˜#¤¤U˜|×,Ñ,ÞØ˜3 ™;¨Ñ1Ñ1’Cà˜3 ™;¨Ñ1Ð4FÑFÑF’Cà!%§¡¨SÖ!1‘I�C˜Þ/3 A s¡8¸#¸q¸�LÞ.2˜4Ÿ:™: cœ?¸¿
¹
À3»�DØÐ,Ñ,�DØ˜b“yØÐ 0Ñ0˜Ü(Ø&Ô(8¸Ó(Oó�Fô (Ø!%§¡Ø#'§?¡?Ø#Ÿ{™{Ø ŸH™HØ $§¡ØØ!Ø &Ø&*Ø!(ñ�Eð  ’KæØ˜t h™Ñ.šà˜t h™Ð1CÑCÑCšô5 "2ñ öD $(˜˜3‘x¨c°1¨XˆØ×"Ñ"Ñ*Ø&2Õ#ð +ùs   ‚J$J&c                 ó¢  • U R                   b  U R                   $ U R                  U l         U R                  R                  nUc,  [        R                  SU R                  5        U R                   $ [        U R                  5      S:X  a  U R                   $ [        U R                  XR                  U R                  5      U l         U R                   $ )z?Update only the glyph offset without calculating anything else.r¶  r   )	r´  r±  r”   ro   rË   rÌ   r¯  rG   r7   ro  s     rJ   Ú_get_next_glyph_offsetÚ!TextObject._get_next_glyph_offset3  s¬   € à×"Ñ"Ñ.Ø×*Ñ*Ð*Ø"&×"4Ñ"4ˆÔØ�{‰{×ÑˆØ‰<Ü�K‰KØRØ—	‘	ôð ×*Ñ*Ð*Üˆt�y‰y‹>˜QÓØ×*Ñ*Ð*ä"5Ø×Ñ §k¡k°4·9±9ó#
ˆÔð ×&Ñ&Ð&rM   c                 ó¾   • U R                   b  U R                   $ [        U R                  [        U R                  U R                  5      5      U l         U R                   $ r´   )r�  r4   rÄ  Útext_matrixr•   rH   s    rJ   rh  ÚTextObject.matrixG  sJ   € à�<‰<Ñ#Ø—<‘<ÐÜ"Ø×Ñ¤¨T×-=Ñ-=¸t¿x¹xÓ!Hó
ˆŒð �|‰|ÐrM   c                 óœ   • U R                   R                  S-  nU R                   R                  nX!-  SSUSU R                   R                  4$ )Nr·  r   )r”   rt   rp   rw   )rI   rÁ  rp   s      rJ   rÄ  ÚTextObject.scaling_matrixP  sO   € à!Ÿ[™[×0Ñ0°4Ñ7ÐØ—;‘;×'Ñ'ˆàÑ)ØØØØØ�K‰K×Ñð
ð 	
rM   c                 óB   • [        U R                  U R                  5      $ r´   )r6   r°  r±  rH   s    rJ   rÍ  ÚTextObject.text_matrix]  s   € ä × 0Ñ 0°$×2DÑ2DÓEÐErM   c           
      ó2  • U R                   b  U R                   $ U R                  n[        U R                  [        [	        U R
                  U R                  5       5      U R                  5      5      nUS   US   -
  US   US   -
  4U l         U R                   $ )Néþÿÿÿr»   )r‘  rh  r4   rÄ  r6   r°  rÊ  r•   )rI   rh  Únext_matrixs      rJ   rl  ÚTextObject.displacementa  s”   € à×ÑÑ)Ø×%Ñ%Ð%Ø—‘ˆÜ!Ø×ÑÜÜ  ×!1Ñ!1°4×3NÑ3NÓ3PÓQØ—‘óó
ˆð )¨™_¨v°b©zÑ9¸;Àr¹?ÈVÐTVÉZÑ;WÐWˆÔØ×!Ñ!Ð!rM   c                 óÈ  • U R                   b  U R                   $ U R                  R                  nUcD  [        R	                  SU R
                  5        S U l         U R                  U l        U R                   $ [        U R
                  5      S:X  a$  S U l         U R                  U l        U R                   $ U R                  R                  nU R                  R                  n[        U R                  U R                  5      nU R                  R                  S-  nU R                  R                  nU R                  R                   nUR"                  nUR$                  (       a  SnU R                  u  pšU(       a  U
OU	nU	=pÍX£-   =pïSnU(       dS  Xe-  nXu-  nUR&                  u  nnnnnnUS:X  a2  US:X  a,  SnUUUR(                  -  U-  -  nUUUR*                  -  U-  -  nU R
                   GH4  n[-        U[.        [0        45      (       a  UUS-  U-  U-  -  nM/  UR3                  U5       Hð  u  nnU(       a  X›4OXº4u  pšU(       a.  [-        U[4        5      (       d   eX±R7                  U5      U-  -  nOUR9                  U5      nUUU-  U-  -  nU(       a  UnOpUR;                  U5      u  nnnnUX%-  -  nUX%-  -  nUU-  nUU-  nUU-  nUU-  n[=        XÉU-   5      n[=        XêU-   5      n[?        XÙU-   5      n[?        XúU-   5      nX¶-  nUS:X  d  Mì  X·-  nMò     GM7     U R                  c  U(       a  X›4OXº4U l        [A        XLXíU45      U l         U R                   $ )Nr¶  r   r·  FTr¸  r¹  )!r³  r”   ro   rË   rÌ   r¯  r±  r´  rG   rp   rw   r4   r°  r•   rt   rq   rr   rr  rº  rh  ÚdescentÚascentr   ry   rT   r»  r   r¼  r½  r§  ÚminÚmaxr5   )rI   ro   rp   rw   rh  rÁ  rq   rr   rv  rÅ  rˆ   r   r¨  rª  r©  r«  Ú	fast_pathr¢  r£  r‡   r¤  r3  Úfr!  rŽ  r    r½  Úgx0Úgy0Úgx1Úgy1s                                  rJ   rµ   ÚTextObject.bboxp  s8  € ð �:‰:Ñ!Ø—:‘:ÐØ�{‰{×ÑˆØ‰<Ü�K‰KØRØ—	‘	ôð ˆDŒJØ&*×&8Ñ&8ˆDÔ#Ø—:‘:ÐÜˆt�y‰y‹>˜QÓØˆDŒJØ&*×&8Ñ&8ˆDÔ#Ø—:‘:Ðà—;‘;×'Ñ'ˆØ�{‰{×ÑˆÜ˜T×-Ñ-¨t¯x©xÓ8ˆØ!Ÿ[™[×0Ñ0°4Ñ7ÐØ—K‘K×)Ñ)ˆ	Ø—K‘K×)Ñ)ˆ	Ø�}‰}ˆØ�>�>ØˆIØ×#Ñ#‰ˆÞ‰a˜QˆØˆˆØ‘(ÐˆØˆ	ÞàÑ+ˆIØÑ+ˆIð  $Ÿ{™{ÑˆAˆq�!�Q˜˜1Ø�A‹v˜!˜q›&Ø �	Ø�a˜$Ÿ,™,Ñ&¨Ñ1Ñ1�Ø�a˜$Ÿ+™+‘o¨Ñ0Ñ0�Ø—9•9ˆCÜ˜#¤¤U˜|×,Ñ,Ø�s˜U‘{ XÑ-Ð0BÑBÑB’à"Ÿk™k¨#Ö.‘F�C˜Þ'+˜A™8°#°‘D�AÞÜ)¨$´×8Ñ8Ð8Ð8ØŸz™z¨#›°Ñ9Ñ9™à $§
¡
¨3£˜Ø˜u xÑ/Ð2DÑDÑD˜Þ Ø ™à-1¯^©^¸CÓ-@Ñ*˜˜S # sØ˜xÑ<Ñ<˜Ø˜xÑ<Ñ<˜Ø˜x™˜Ø˜t™˜Ø˜x™˜Ø˜t™˜Ü  ¨¡WÓ-˜Ü  ¨¡WÓ-˜Ü  ¨¡WÓ-˜Ü  ¨¡WÓ-˜ØÑ$�CØ˜b•yØÑ(šô1 /ñ	 ð< ×"Ñ"Ñ*Þ26 q¡h¸S¸HˆDÔ#Ü# F°¸Ð,<Ó=ˆŒ
Ø�z‰zÐrM   c                 ó”  • U R                   b  SR                  U R                   5      $ / U l         U R                  R                  nUc   S5       eU R                   HO  n[        U[        5      (       d  M  UR                  U5       H   u  p4U R                   R                  U5        M"     MQ     SR                  U R                   5      $ )z=Get the Unicode characters (in stream order) for this object.rE   úNo font was selected)	r²  Újoinr”   ro   r¯  r   r  r»  Úappend)rI   ro   r!  r    r�  s        rJ   rŸ  ÚTextObject.charsÂ  s£   € ð �;‰;Ñ"Ø—7‘7˜4Ÿ;™;Ó'Ð'ØˆŒØ�{‰{×ÑˆØÑÐ7Ð!7Ó7ÐØ—9”9ˆCÜ˜c¤5×)Ñ)ÙØŸ;™; sÖ+‘�Ø—‘×"Ñ" 4Ö(ó ,ñ ð
 �w‰w�t—{‘{Ó#Ð#rM   c                 óæ   • SnU R                   R                  nUc   S5       eU R                   H>  n[        U[        5      (       d  M  U[        S UR                  U5       5       5      -  nM@     U$ )z¡Return the number of glyphs that would result from iterating over
this object.

Important: this is the number of glyphs, *not* the number of
Unicode characters.
r   rä  c              3   ó&   #   • U  H  nS v •  M	     g7fr�   rN   rž   s     rJ   r¡   Ú%TextObject.__len__.<locals>.<genexpr>Þ  s   é € Ð7Ò&6 �1Ò&6ùr£   )r”   ro   r¯  r   r  r¤   r»  )rI   Únglyphsro   r!  s       rJ   r¥   ÚTextObject.__len__Ñ  sm   € ð ˆØ�{‰{×ÑˆØÑÐ7Ð!7Ó7ÐØ—9”9ˆCÜ˜c¤5×)Ñ)ÙØ”sÑ7 d§k¡k°#Ô&6Ó7Ó7Ñ7ŠGñ ð ˆrM   )r³  r²  r‘  r�  r´  )!rO   rP   rQ   rR   rS   r   r   r  rT   rU   r$   r&   r�  r²  r|   r³  r)   r´  r‘  r
   r�  r™   rÊ  rÙ   rh  rÄ  rÍ  rl  rµ   rŸ  ry   r¥   rV   rN   rM   rJ   r®  r®  «  sk  ‡ ñð: ˆu�U˜E�\Ñ"Ñ
#Ó#ØÓØÓà#'€GˆU�6˜4�<Ñ Ó'Ø%)€FˆE�$�s‘)˜T�/Ñ"Ó)Ø#€Eˆ5��t�ÑÓ#Ø-1Ð˜˜e T˜kÑ*Ó1Ø(,€M�5˜ ˜Ñ%Ó,ð]3˜( ;Ñ/ô ]3ð~'¨ô 'ð( ð˜ó ó ðð ð

 ó 

ó ð

ð ðF˜Vó Fó ðFð ð"˜eó "ó ð"ð ðO�e˜D $˜JÑ'ó Oó ðOðb ð$�só $ó ð$ð˜÷ rM   r®  c                   óp   • \ rS rSrSrS\\   SS4S jrS\4S jr	S\
\   4S jr\S\\   4S	 j5       rS
rg)ÚContentSectioniâ  zËSequence of content objects in a marked content section.

This is a `Sized` collection so that you can quickly check if it
is non-empty by its truth value.  The actual length may or may not
be relevant.
Úobjsr—   Nc                 óf   • U Vs/ s H  o"R                  5       PM     snU l        S U l        g s  snf r´   )r¨   Ú_objsÚ_texts)rI   rï  r!  s      rJ   Ú__init__ÚContentSection.__init__ê  s(   € Ù04Ó5²¨—l‘l–n±Ñ5ˆŒ
Ø.2ˆ�ùò 6s   ….c                 ó,   • [        U R                  5      $ r´   )rG   rñ  rH   s    rJ   r¥   ÚContentSection.__len__î  s   € Ü�4—:‘:‹ÐrM   c                 ó,   • [        U R                  5      $ r´   )r•  rñ  rH   s    rJ   r™   ÚContentSection.__iter__ñ  s   € Ü�D—J‘JÓÐrM   c                 óö  • U R                   b  U R                   $ / U l         U R                   H¾  n[        U[        5      (       d  M  UR                  nUb  UR
                  c  M8  SUR                  ;   a=  [        UR                  S   [        5      (       d   e[        UR                  S   5      nOUR                  nUR                  SS5      nU R                   R                  U5        MÀ     U R                   $ )z6Sequence of text strings for a marked content section.Ú
ActualTextô   Â­rE   )rò  rñ  r   r®  r¼   r€   r‚   r  r1   rŸ  Úreplaceræ  )rI   r!  r¼   rŸ  s       rJ   ÚtextsÚContentSection.textsô  sÉ   € ð �;‰;Ñ"Ø—;‘;ÐØˆŒØ—:”:ˆCÜ˜c¤:×.Ñ.ÙØ—'‘'ˆCØ‰{˜cŸh™hÑ.ÙØ˜sŸy™yÓ(Ü! #§)¡)¨LÑ"9¼5×AÑAÐAÐAÜ# C§I¡I¨lÑ$;Ó<‘àŸ	™	�à—M‘M &¨"Ó-ˆEØ�K‰K×Ñ˜uÖ%ñ ð �{‰{ÐrM   )rñ  rò  )rO   rP   rQ   rR   rS   r	   r�   ró  ry   r¥   r
   r™   rÙ   r   r|   rý  rV   rN   rM   rJ   rî  rî  â  s[   † ñð3˜X mÑ4ð 3¸ô 3ð˜ô ð ˜( =Ñ1ô  ð ð�x ‘}ó ó órM   rî  c                   óÆ   • \ rS rSrSrS\\   SS4S jrS\4S jr	\
S\\   4S j5       r\S	\S\4S
 j5       r\S	\S\\   4S j5       rS	\\\4   S\\\\   4   4S jrSrg)r7  i  zòCollect content object in marked content sections.

These are ordered by marked content ID, and you can index into
this to get the content for a specific MCID.

You can iterate over them in page content order with the
`page_order` property.

Ústreamerr—   Nc                 óÔ  • SSK Jn  0 U l        SU l        [        R
                  " U[        R                  " S5      5       H=  u  p4Uc  M
  [        U5      U R                  U'   [        U R                  U5      U l        M?     [        X5      (       aX  UR                   HG  n[        U R                  U5      U l        X0R                  ;  d  M/  [        / 5      U R                  U'   MI     g g )Nr   r'  r€   )r)  r(  Ú	_contentsÚ_maxidra  ÚgroupbyrŒ   Ú
attrgetterrî  rÛ  r   Ú_mcstart)rI   r   r(  r€   rï  s        rJ   ró  ÚContentSequence.__init__  s¸   € Ý0à46ˆŒØˆŒÜ#×+Ò+¨H´h×6IÒ6IÈ&Ó6QÖR‰JˆDØ‰|Ùô $2°$Ó#7ˆD�N‰N˜4Ñ Ü˜dŸk™k¨4Ó0ˆDŽKñ Sô �h×0Ñ0Ø ×)Ô)�Ü! $§+¡+¨tÓ4�”ØŸ~™~Õ-Ü+9¸"Ó+=�D—N‘N 4Ó(ò *ð 1rM   c                 ó    • U R                   S-   $ )Nr[   )r  rH   s    rJ   r¥   ÚContentSequence.__len__+  s   € Ø�{‰{˜Q‰ÐrM   c              #   óT   #   • U R                   R                  5        Sh  v•N   g N7f)z.Marked content sections in page content order.N)r  ÚvaluesrH   s    rJ   Ú
page_orderÚContentSequence.page_order.  s   é € ð —>‘>×(Ñ(Ó*×*Ó*ùs   ‚( &¡(r€   c                 ó   • g r´   rN   ©rI   r€   s     rJ   rõ   ÚContentSequence.__getitem__3  s   € Ø8;rM   c                 ó   • g r´   rN   r  s     rJ   rõ   r  6  s   € ØDGrM   c                 ó8  • [        U[        5      (       a>  [        UR                  UR                  UR
                  5       Vs/ s H  o U   PM	     sn$ XR                  :”  a  [        SU S35      eU R                  R                  U[        / 5      5      $ s  snf )NzMarked content ID z out of range)r   ÚsliceÚrangeÚstartÚstopÚstepr  r  r  rù   rî  )rI   r€   Úidxs      rJ   rõ   r  9  s€   € ô �dœE×"Ñ"Ü).¨t¯z©z¸4¿9¹9ÀdÇiÁiÔ)PÓQÒ)P #˜”IÑ)PÑQÐQà—k‘kÓ!Ü Ð#5°d°V¸=Ð!IÓJÐJØ—>‘>×%Ñ% d¬N¸2Ó,>Ó?Ð?ùò	 Rs   ÁB)r  r  )rO   rP   rQ   rR   rS   r	   r�   ró  ry   r¥   rÙ   r
   rî  r  r   rõ   r  r   r   rV   rN   rM   rJ   r7  r7    s²   † ñð> ¨-Ñ!8ð >¸Tô >ð*˜ô ð ð+˜H ^Ñ4ó +ó ð+ð Ø; Ð;¨Ó;ó Ø;àØG ÐG¨(°>Ñ*BÓGó ØGð@Ø˜#˜u˜*Ñ%ð@à	ˆ~˜x¨Ñ7Ð7Ñ	8÷@rM   r7  )`rS   ra  ÚloggingrŒ   Úabcr   r   Údataclassesr   Útypingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   Úplaya.colorr   r   r   r   r   r   r   Ú
playa.fontr   r   r   Úplaya.parserr   r    r!   r"   Úplaya.pdftypesr#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   Úplaya.utilsr0   r1   r2   r3   r4   r5   r6   r7   Úplaya.workerr8   r9   r:   Úplaya.documentr;   Ú
playa.pager<   rÇ   r=   r>   Ú	getLoggerrO   rË   r@   rz   rX   r~   rŽ   rŠ   r�   rÛ   ré   rE  r  rN  rf  r�  r®  rî  r7  rN   rM   rJ   Ú<module>r&     s  ðñó Û Û Ý Ý Ý !÷÷ ÷ ÷ ñ ÷$÷ ñ ÷ 0Ñ /ß 9Ó 9÷÷ ÷ õ ÷	÷ 	ó 	÷ ?Ñ >æÝ'Ýß6à×Ò˜Ó!€ô/�*ô /ñ& ˜˜QÓ€
ð ÷lð ló ðlô^ �Jô  ð Ð3Ñ4€ô�*ô ð ô}'�E˜8 OÑ4ó }'ó ð}'ð@ ô�ó ó ðð8 ôE6�-ó E6ó ðE6ñR ˜>Ó*Ð ð ôd
�Mó d
ó ðd
ðN ô%.�ó %.ó ð%.ôPSˆ}ô Sðl ôi$�(ó i$ó ði$ðX ôs�ó só ðsôl	&�X˜mÑ,¨eô &ôR6@�h˜~Ñ.õ 6@rM   