+
    ŠvjÒ!  ã                   óÊ   € R t ^ RIHtHt ^ RIHtHt ^RIHt ^RI	H
t
 ^RIHtHtHtHtHt R R ltR R	 ltR
 R ltR R ltR R ltR R ltR R ltR R ltR R ltR# )u£  
Page labels are shown by PDF viewers as "the page number".

A page has a numeric index, starting at 0. Additionally, the page
has a label. In the most simple case:

    label = index + 1

However, the title page and the table of contents might have Roman numerals as
page labels. This makes things more complicated.

Example 1
---------

>>> reader.root_object["/PageLabels"]["/Nums"]
[0, IndirectObject(18, 0, 139929798197504),
 8, IndirectObject(19, 0, 139929798197504)]
>>> reader.get_object(reader.root_object["/PageLabels"]["/Nums"][1])
{'/S': '/r'}
>>> reader.get_object(reader.root_object["/PageLabels"]["/Nums"][3])
{'/S': '/D'}

Example 2
---------
The following is a document with pages labeled
i, ii, iii, iv, 1, 2, 3, A-8, A-9, ...

1 0 obj
    << /Type /Catalog
       /PageLabels << /Nums [
                        0 << /S /r >>
                        4 << /S /D >>
                        7 << /S /D
                             /P ( A- )
                             /St 8
                        >>
                        % A number tree containing
                        % three page label dictionaries
                        ]
                   >>
    ...
    >>
endobj


Â§12.4.2 PDF Specification 1.7 and 2.0
=====================================

Entries in a page label dictionary
----------------------------------
The /S key:
D       Decimal Arabic numerals
R       Uppercase Roman numerals
r       Lowercase Roman numerals
A       Uppercase letters (A to Z for the first 26 pages,
                           AA to ZZ for the next 26, and so on)
a       Lowercase letters (a to z for the first 26 pages,
                           aa to zz for the next 26, and so on)
)ÚCallableÚIterator)ÚOptionalÚcast)ÚPdfCommonDocProtocol)Úlogger_warning)ÚArrayObjectÚDictionaryObjectÚ
NullObjectÚNumberObjectÚis_null_or_nonec                ó0   € V ^8„  d   QhR\         R\        /# ©é   ÚnumÚreturn©ÚintÚstr)Úformats   "ÚV/var/www/html/daimler-pipeline/venv/lib/python3.14/site-packages/pypdf/_page_labels.pyÚ__annotate__r   K   s   € ÷ )ñ )¬ð )´ñ )ó    c                 ó^   a€ . ROoR V3R llpRP                  \        V! V 4      4      4      # )éè  c                óF   € V ^8„  d   QhR\         R\        \        ,          /# r   )r   r   r   )r   s   "r   r   Ú4number2uppercase_roman_numeral.<locals>.__annotate__\   s   € ÷ ñ ”sð œx¬�}ñ r   c              3   ó†   <"  € S F5  w  r\        W4      w  r4W#,          x € WV,          ,          p V ^ 8:  g   K4   R# 	  R# 5i)é    N)Údivmod)r   ÚdecimalÚ
roman_reprÚxÚ_Úromans   &    €r   Ú	roman_numÚ1number2uppercase_roman_numeral.<locals>.roman_num\   s=   øé € Û#(ÑˆGÜ˜#Ó'‰DˆAØ•.Ò Ø˜Q•;ÕˆCØ�aŽxÚó $)ùs
   ƒ2AºAÚ ))r   ÚM)i„  ÚCM)iô  ÚD)i�  ÚCD)éd   ÚC)éZ   ÚXC)é2   ÚL)é(   ÚXL)é
   ÚX)é	   ÚIX)é   ÚV)é   ÚIV)é   ÚI)ÚjoinÚlist)r   r%   r$   s   & @r   Únumber2uppercase_roman_numeralr@   K   s.   ø€ ò€E÷ ð ð �7‰7”4™	 #›Ó'Ó(Ð(r   c                ó0   € V ^8„  d   QhR\         R\        /# ©r   Únumberr   r   )r   s   "r   r   r   g   s   € ÷ :ñ :¬3ð :´3ñ :r   c                 ó4   € \        V 4      P                  4       # ©N)r@   Úlower©rC   s   &r   Únumber2lowercase_roman_numeralrH   g   s   € Ü)¨&Ó1×7Ñ7Ó9Ð9r   c                ó0   € V ^8„  d   QhR\         R\        /# rB   r   )r   s   "r   r   r   k   s   € ÷ ñ ¤Cð ¬Cñ r   c                 ó6  € V ^ 8:  d   \        R4      h\        \        R4      \        R4      ^,           4       Uu. uF  p\        V4      NK  	  ppRpV ^ 8”  d<   V ^,          pV^ 8X  d   ^pW$^,
          ,          V,           pW,          p V ^,          p KB  V# u upi )r   zExpecting a positive numberÚAÚZr'   )Ú
ValueErrorÚrangeÚordÚchr)rC   ÚiÚalphabetÚrepÚ	remainders   &    r   Únumber2uppercase_letterrU   k   s�   € Ø�„{ÜÐ6Ó7Ð7Ü %¤c¨#£h´°C³¸1µÔ =Ó>Ñ =˜1”�A–Ñ =€HÐ>Ø
€CØ
�1Œ*Ø˜R•Kˆ	Ø˜Œ>ØˆIØ 1•}Õ%¨Õ+ˆàÕˆØ˜2•ŠØ€Jùò ?s   ºBc                ó0   € V ^8„  d   QhR\         R\        /# rB   r   )r   s   "r   r   r   {   s   € ÷ 3ñ 3¤Cð 3¬Cñ 3r   c                 ó4   € \        V 4      P                  4       # rE   )rU   rF   rG   s   &r   Únumber2lowercase_letterrX   {   s   € Ü" 6Ó*×0Ñ0Ó2Ð2r   c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   Údictionary_objectÚindexr   )r	   r   r   )r   s   "r   r   r      s'   € ÷ "Bñ "BÔ+;ð "BÄCð "BÌCñ "Br   c                 ót  € \        \        V R ,          4      p^ pRp^ pV\        V4      8  d^   W#,          pW#^,           ,          P                  4       pV^,           \        V4      8X  d   M W#^,           ,          V8”  d   MV^,          pKm  RR R\        R\
        R\        R\        R\        /p\        V\        4      '       g   \	        V^,           4      # VP                  R^4      p\        \        VP                  R	R
4      4      pWdP                  R4      ,          p	W‰! W,
          V,           4      ,           # )ú/NumsNc                 ó   € R # )r'   © )r#   s   &r   Ú<lambda>Ú%get_label_from_nums.<locals>.<lambda>”   s   € ™r   z/Dz/Rz/rz/Az/az/Stz/Pr'   z/S)r   r   ÚlenÚ
get_objectr   r@   rH   rU   rX   Ú
isinstanceÚdictÚget)
rZ   r[   ÚnumsrQ   ÚvalueÚstart_indexÚmÚstartÚprefixÚmapping_functions
   &&        r   Úget_label_from_numsrn      s  € ô ”Ð.¨wÕ7Ó8€DØ	€AØ€EØ€KØ
Œc�$‹iŒ-Ø•gˆØ˜•U•×&Ñ&Ó(ˆØˆq�5”C˜“IÔØØ�A•�;˜ÔØØ	ˆQ�Šà‰lØŒcØÔ,ØÔ,ØÔ%ØÔ%ð4€Aô �eœT×"Ò"Ü�5˜1•9‹~ÐØ�I‰I�e˜QÓ€EÜ”#�u—y‘y  rÓ*Ó+€FØŸ™ 4›Õ)ÐØÐ$ UÕ%8¸5Õ%@ÓAÕAÐAr   c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   Úreaderr[   r   )r   r   r   )r   s   "r   r   r   ¤   s"   € ÷ .ñ .Ô,ð .´Sð .¼Sñ .r   c                óò  € \        \        V P                  4      pRV9  d   \        V^,           4      # \        \        VR,          P	                  4       4      pRV9   d   \        W14      # RV9   dä   \        VR,          \        4      '       gÇ   ^ pV^d8  d¾   \        \        \        ,          VR,          4      pV F”  p\        \        \        ,          VR,          4      pV^ ,          Tu;8:  d   V^,          8:  g   KD  M KH  \        VP                  RR4      4      '       g!   V^,          pV^d8X  d   \        R4      hTp K´  \        Wa4      u # 	   \        R\        VR7       \        V^,           4      # )	z•
See 7.9.7 "Number Trees".

Args:
    reader: The PdfReader
    index: The index of the page

Returns:
    The label of the page, e.g. "iv" or "4".

z/PageLabelsr]   z/Kidsz/LimitsNz"Too deep nesting is not supported.z6Could not reliably determine page label for %(index)d.)Úsourcer[   )r   r	   Úroot_objectr   rc   rn   rd   r
   r?   r   r   rf   ÚNotImplementedErrorr   Ú__name__)rp   r[   ÚrootÚnumber_treeÚlevelÚkidsÚkidÚlimitss   &&      r   Úindex2labelr|   ¤   s>  € ô Ô  &×"4Ñ"4Ó5€DØ˜DÔ Ü�5˜1•9‹~ÐÜÔ'¨¨mÕ)<×)GÑ)GÓ)IÓJ€KØ�+ÔÜ" ;Ó6Ð6Ø�+Ô¤j°¸WÕ1EÄz×&RÒ&Rð ˆØ�cŒkÜœÔ-Õ.°¸GÕ0DÓEˆDÛ�äœd¤3�i¨¨Y­Ó8�Ø˜!•9 Ö2¨°­×2Ò2Ü*¨3¯7©7°7¸DÓ+A×BÒBà �
˜Ø  Cœ<Ü"5Ø Dó#ð ð '*˜ò Ü.¨sÓ:Ò:ñ ð& äÐKÔT\ÐdiÕjÜˆu�q�y‹>Ðr   c                ó@   € V ^8„  d   QhR\         R\        R\        RR/# )r   Úkeyrh   rg   r   N)r   r	   r   )r   s   "r   r   r   Õ   s0   € ÷ "ñ "Ü	ð"äð"ô ð"ð 
ñ	"r   c                óT  € \        V4      ^,          ^ 8w  d   \        R4      h\        V4      pV^ 8w  d    WV^,
          ,          8:  d   V^,
          pK&  V\        V4      8  d   WV,          8X  d   WV^,           &   R# VP                  W04       VP                  V^,           V4       R# )z¬
Insert a key, value pair in a Nums array.

See 7.9.7 "Number Trees".

Args:
    key: number key of the entry
    value: value of the entry
    nums: Nums array to modify

ú6A nums like array must have an even number of elementsN)rb   rM   Úinsert)r~   rh   rg   rQ   s   &&& r   Únums_insertr‚   Õ   s‚   € ô  ˆ4ƒy�1…}˜ÔÜÐQÓRÐRäˆD‹	€AØ
ˆqŒ&�S  Q¥�KÔ'Ø��EŠàŒ3ˆt‹9„}˜ Q¥œØˆQ��U‹à�‰�AÔØ�‰�A˜•E˜5Ö!r   c                ó@   € V ^8„  d   QhR\         R\        R\        RR/# )r   r~   Úpage_index_torg   r   N)r   r   r   )r   s   "r   r   r   ó   s0   € ÷ ñ Ü	ðäðô ðð 
ñ	r   c                ó"  € \        V4      ^,          ^ 8w  d   \        R4      hW8  d   \        R4      hVP                  V 4      ^,           pV\        V4      8  d4   W#,          V8:  d%   VP                  V4       VP                  V4       KA  R# R# )zö
Remove all entries in a number tree in a range after an entry.

See 7.9.7 "Number Trees".

Args:
    key: number key of the entry before the range
    page_index_to: The page index of the upper limit of the range
    nums: Nums array to modify

r€   z/page_index_to must be greater or equal than keyN)rb   rM   r[   Úpop)r~   r„   rg   rQ   s   &&& r   Únums_clear_ranger‡   ó   su   € ô  ˆ4ƒy�1…}˜ÔÜÐQÓRÐRØÔÜÐJÓKÐKà�
‰
�3‹˜!Õ€AØ
Œc�$‹iŒ-˜D�G }Ô4Ø�‰�ŒØ�‰�Žñ 5‰-r   c          	      óŠ   € V ^8„  d   QhR\         R\        R\        \        \         ,          \        \        ,          3,          /# )r   r~   rg   r   )r   r   Útupler   r	   )r   s   "r   r   r     s;   € ÷ ñ Ü	ðä
ðô Œ8”LÕ!¤8Ô,<Õ#=Ð=Õ>ñr   c                óÈ   € \        V4      ^,          ^ 8w  d   \        R4      hVP                  V 4      ^,           pV\        V4      8  d   W,          W^,           ,          3# R# )z™
Return the (key, value) pair of the entry after the given one.

See 7.9.7 "Number Trees".

Args:
    key: number key of the entry
    nums: Nums array

r€   )NN)rb   rM   r[   )r~   rg   rQ   s   && r   Ú	nums_nextr‹     sV   € ô ˆ4ƒy�1…}˜ÔÜÐQÓRÐRà�
‰
�3‹˜!Õ€AØŒ3ˆt‹9„}Ø•˜ !�e�Ð%Ð%ØÐr   N)Ú__doc__Úcollections.abcr   r   Útypingr   r   Ú
_protocolsr   Ú_utilsr   Úgenericr   r	   r
   r   r   r@   rH   rU   rX   rn   r|   r‚   r‡   r‹   r_   r   r   Ú<module>r’      sS   ðñ:÷x /ß !å ,Ý "÷õ õ)õ8:õõ 3õ"BõJ.õb"õ<÷6r   