+
    bIi.d                    J   R t Rt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHtHtHtHtHtHtHtHt ^ RIHtHtHtHt ^ RIHt ^ R	IHt ^ R
IHt  ! R R] 4      t!Rt"Rt#Rt$Rt%Rt&Rt'](! RR7      t)R t*RR lt+R t,],t- ! R R4      t. ! R R4      t/ ! R R]/4      t0 ! R R]/4      t1Rt2Rt3R t4 ! R! R"]/4      t5R# t6^ RI7t7]7Pp                  ! R$4      t9A7R% t:R& t; ! R' R(]/4      t<]=! ^!4      ]=! ^~4      3R) lt> ! R* R+]/4      t? ! R, R-4      t@R. tA ! R/ R0]?4      tB ! R1 R2]B4      tC ! R3 R44      tD]D! 4       tE ! R5 R64      tF]F! 4       tG ! R7 R8]/4      tHRR9 ltIR:tJ ! R; R<]/4      tK ! R= R>]K4      tL ! R? R@]/4      tM ! RA RB]/4      tN ! RC RD]/4      tO ! RE RF]/4      tP ! RG RH]/4      tQ ! RI RJ]/4      tR ! RK RL]H4      tS ! RM RN]/4      tT ! RO RP]T4      tU ! RQ RR]T4      tV ! RS RT] 4      tW ! RU RV]T4      tX ! RW RX]T4      tYRY tZRZt[ ! R[ R\]/4      t\ ! R] R^]/4      t] ! R_ R`]/4      t^RRa lt_Rbt` ! Rc Rd]/4      ta ! Re Rf]/4      tb ! Rg Rh]b4      tc ! Ri Rj]b4      td ! Rk Rl]b4      te ! Rm Rn]e4      tfRo tg ! Rp Rq]/4      th ! Rr Rs]/4      ti ! Rt Ru]/4      tj ! Rv Rw]/4      tk ! Rx Ry]/4      tl ! Rz R{]l4      tm ! R| R}]/4      tn ! R~ R]n4      to ! R R]/4      tp ! R R]p4      tq ! R R]/4      tr ! R R]/4      ts ! R R]/4      tt ! R R]t4      tu ! R R]/4      tv ! R R]/4      twRRRRRR/tx ! R R]/4      ty ! R R4      tz ! R R]/4      t{ ! R R]{4      t| ! R R]{4      t} ! R R]/4      t~ ! R R]~4      t ! R R]~4      t ! R R]~4      t]R8X  d   ]! R4       R# R# )z4.2.0a_  
The module pdfdoc.py handles the 'outer structure' of PDF documents, ensuring that
all objects are properly cross-referenced and indexed to the nearest byte.  The
'inner structure' - the page descriptions - are presumed to be generated before
each page is saved.
pdfgen.py calls this and provides a 'canvas' object to handle page marking operators.
piddlePDF calls pdfgen and offers a high-level interface.

The classes within this generally mirror structures in the PDF file
and are not part of any public interface.  Instead, canvas and font
classes are made available elsewhere for users to manipulate.
N)OrderedDict)pdfutils)	rl_config)
open_for_readmakeFileNameisSeqisBytes	isUnicode	_digesterisStrbytestrannotateException	TimeStamp)	escapePDFfp_strasciiBase85EncodeasciiBase85Decode)
pdfmetrics)md5)stderrc                       ] tR t^tRtR# )PDFError N__name__
__module____qualname____firstlineno____static_attributes__r       ځC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\reportlab/pdfbase/pdfdoc.pyr   r          r   r   __InternalName____RefOnly____Comment__
BasicFontsPages)transparencyc                 T    \        V \        4      '       d   V P                  R 4      # T # )	extpdfdoc)
isinstancestrencode)xs   &r    	pdfdocEncr.   5   s"    $.q$5$5188K <1<r   c                |   \        V \        4      '       d   V'       g7   \        V \        4      '       d!   VP	                  V 4      P                  V4      # V P                  V4      p\        P                  '       gP   \        P                  '       d:   \        V \        4      '       d$   \        RV P                  ,          4      V,           pV# \        V 4      \        \        39   d   \        \        V 4      4      # \        V 4      '       d   V # \!        V 4      '       d   \        V 4      # \        \#        V 4      4      # )zrIndirection step for formatting.
Ensures that document parameters alter behaviour
of formatting for all elements.
z%% %s
)r*   	PDFObjecthasattrr#   	Referenceformatr   	invariantpdfCommentsr$   r.   typefloatintr   r   r	   r+   )elementdocumenttoplevelfs   &&& r    r3   r3   8   s    
 ')$$GG[99 %%g.55h??x(A&&&9+@+@+@WWVaEbEbi'*=*==>q@H	g5#,	& ))				7		!!W&&r   c                     R V ,          # )z
FormXob.%sr   )externalnames   &r    xObjectNamer?   R   s    ,&&r   c                   8   a  ] tR t^Yt o R tR tR tR tRtV t	R# )NoEncryptionc                    V# )zencode a string, stream, textr   )selfts   &&r    r,   NoEncryption.encodeZ   s    r   c                    R # Nr   rC   r:   s   &&r    prepareNoEncryption.prepare]       r   c                    R # rG   r   )rC   objnumversions   &&&r    registerNoEncryption.register`   rK   r   c                    R # rG   r   rC   s   &r    infoNoEncryption.infoc   s    r   r   N)
r   r   r   r   r,   rI   rO   rS   r   __classdictcell____classdict__s   @r    rA   rA   Y   s      r   rA   c                       ] tR t^gtRtR# )r0   r   Nr   r   r   r    r0   r0   g   r!   r   r0   c                   (    ] tR t^jtRt]! 4       tRtR# )DummyDocz'used to bypass encryption when requiredr   N)r   r   r   r   __doc__rA   encryptr   r   r   r    rZ   rZ   j   s    -nGr   rZ   c                   8  a  ] tR t^ot o Rt]! 4       t^ ]P                  ]P                  R]
R3R ltR tR tR tR tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R t$R t%R t&R t'R$R lt(R  t)R! t*R%R" lt+R#t,V t-R# )&PDFDocumentNc                   R V n         ^ V n        ^ V n        R V n        ^V n        Vf   \
        P                  V n        MW0n        V P                  V4       WPn        \        RR7      ;qpn
        VP                  R4       \        V P                  4      V n        V P                  P                  p\        V4      pVP                  \!        V4      4       / V n        / V n        / V n        / V n        \+        4       ;p;V n        V n        \1        4       ;qn        Wn        V'       d   TM\
        P4                  pV'       d   \7        V4      Vn        V'       d   \;        4       M	\=        4       ;V n        ;V n         Vn         \C        4       V n"        / V n#        \I        / 4      p
RV
n%        V PM                  V
\N        4       . V n(        R # )NF)usedforsecuritys   a reportlab documentzThe standard fonts dictionary))_IDobjectcountershadingCounterinObjectpageCounterr   r4   setCompression_pdfVersionr   	signatureupdater   
_timeStamprD   asciir   idToObjectNumberAndVersion
idToObject
idToOffset
numberToId
PDFCatalogCatalog_catalogPDFPagesr&   documentLang	PDFStringLangPDFOutlines0PDFOutlinesoutlineOutlinesPDFInforS   fontMappingPDFDictionaryr$   r2   r%   delayedFonts)rC   dummyoutlinecompressionr4   filename
pdfVersionlangsigcatpagesDDs   &&&&&&&    r    __init__PDFDocument.__init__s   se     &00DN&NK(%"599n

*+#DNN3ooCj

73< *,'-7\99dlT]%Z'
	t!7!7 CHHTlnZeZgggt}s|I	 28r:&r   c                    Wn         R # rG   r   rC   onoffs   &&r    rf   PDFDocument.setCompression   s     r   c                d    V F)  p\        V P                  \        V,          4      V n        K+  	  R# )zREnsure that the pdf version is greater than or equal to that specified by the keysN)maxrg   PDF_SUPPORT_VERSION)rC   keysks   &* r    ensureMinPdfVersionPDFDocument.ensureMinPdfVersion   s'    A"4#3#35H5KLD r   c                v    V P                   '       d   R# V P                  P                  \        V4      4       R# )z add information to the signatureN)ra   rh   ri   r   )rC   things   &&r    updateSignaturePDFDocument.updateSignature   s#    888Vgen-r   c                   V P                   '       d   V P                   # V P                  P                  4       p\        4       p\	        VRR7      P                  V4      pRV,           V,           R,           V n         V P                   # )z<A unique fingerprint for the file (unless in invariant mode)raw)encs   
[s<   ]
% ReportLab generated PDF document -- digest (opensource)
)ra   rh   digestrZ   PDFTextr3   )rC   r   docIDss   &   r    IDPDFDocument.ID   sb    88888O&&(jf'..s33JsN#ddxxr   c                ~   \        V R R4      '       d'   \        RV P                  P                  ,          4      hRV n        \        \        VRR4      R4      '       dw   ^ pTp\        VRR4      p\        V\        4      '       d   RV,          pM9\        V4      '       g)   R	VP                  P                  \        V4      3,          p\        V4      pMF\        V4      '       d   ^p\        V4      p\        VR
4      pM\        R\        V4      ,          4      hV P                  V4      p\        V4      '       d   VP!                  R4      pVP#                  V4       V'       d4   VP%                  4        ^ RIpVP(                  R8X  d   ^ RIHp V! V4       \        VRR4      '       d   \/        RV: 24       R# R# )_savedToFileFz)class %s instances can only be saved onceTwriteN__call__namez
<os fd:%d>z<%s@0X%8.8X>wbz#Cannot use %s as a filename or filelatin1mac)markfilename
_verbosityzsaved )getattrRuntimeError	__class__r   r   r1   r*   r8   r   idr   open	TypeErrorrepr
GetPDFDatar	   r,   r   closeosr   reportlab.lib.utilsr   print)rC   r   canvasmyfiler<   datar   r   s   &&&     r    
SaveToFilePDFDocument.SaveToFile   sS   4u--JT^^MdMddee 78WT2:>>FAq-H(3'''18__)Q[[-A-A"Q%,HH#H-H8__F#H-HXt$AADNRSSv&T??;;x(D	GGIww~<X&6,t,,e(4L.M,r   c                   V P                    F  pVP                  V 4       K  	  V P                  V P                  n        V P                  P	                  V P
                  4       V P                  V P                  4       V P                  V P                  4       V P                  P                  W4       V P                  P                  ^ 8  d   RV P                  n        V P                  4       # )    N)r~   
addObjectsr4   rS   r   rh   r2   rq   rz   rI   readyr3   )rC   r   fnts   && r    r   PDFDocument.GetPDFData   s    $$CNN4  % #nn				( 	t||$tyy!d+==q $(DLL!{{}r   c                    V P                   e0   V P                   R8X  d   R# \        RV P                   ,          4      hRV n         R# )zXspecify the current object as a page (enables reference binding and other page features)Npagez%can't go in page already in object %s)rd   
ValueErrorrR   s   &r    inPagePDFDocument.inPage   s6    ==$}}f$fDt}}TUUr   c                    RV n         R# )zBspecify that we are in a form xobject (disable page features, etc)formN)rd   rR   s   &r    inFormPDFDocument.inForm   s    
 r   c                D   V P                   pW9   d	   W!,          #  \        P                  ! V4      pVP                  '       d   \	        R \        V4      ,          4      hVP                  V 4       W!,          #   \         d    \	        R\        T4      ,          4      hi ; i)z1getInternalFontName(%s) called for a dynamic fontzFont %s not known!)r|   r   getFont_dynamicFontr   r   r   KeyError)rC   
psfontnamefmfontObjs   &&  r    getInternalFontNamePDFDocument.getInternalFontName   s    >!H$,,Z8'''"#VY]^hYi#ijj""4(~% H3d:6FFGGHs   'A8 3A8 8'Bc                :    R \        V P                  4      ,           # )Page)r   re   rR   s   &r    thisPageNamePDFDocument.thisPageName  s    d4++,,,r   c                4    \        V P                  4       4      # rG   )PDFObjectReferencer   rR   s   &r    thisPageRefPDFDocument.thisPageRef  s    !$"3"3"566r   c                    V P                  4       pV P                  W4       V P                  P                  V4       V ;P                  ^,          un        RV n        R# )   N)r   r2   r&   addPagere   rd   )rC   r   r   s   && r    r   PDFDocument.addPage  sF      "t"

4 Ar   c                    V P                   R8w  d   V P                  4        V P                  V\        V4      4       RV n         R# )zadd a Form XObject.r   N)rd   r   r2   r?   )rC   r   r   s   &&&r    addFormPDFDocument.addForm  s3     ==F"KKMt[./r   c                    R V,          # )zAnnot.%sr   )rC   r>   s   &&r    annotationNamePDFDocument.annotationName#  s    ,&&r   c                F    V P                  W P                  V4      4       R # rG   )r2   r   )rC   r   
annotations   &&&r    addAnnotationPDFDocument.addAnnotation&  s    z#6#6t#<=r   c                :    V P                  V4      p\        V4      # rG   )r   r   rC   r   internalnames   && r    refAnnotationPDFDocument.refAnnotation)  s    **40!,//r   c                    R V P                   ,          pV P                  W4       V ;P                   ^,          un         V# )zSh%d)rc   r2   )rC   shadingr   s   && r    
addShadingPDFDocument.addShading-  s4    ,,,		&				!	r   c                   VP                   pV'       Eg   VP                  ^ 8X  d&   VP                  ^ 8X  d   VP                  ^ 8X  d   RpMVP                  ^ 8X  d&   VP                  ^ 8X  d   VP                  ^ 8X  d   RpMkVP                  ^ 8X  d&   VP                  ^ 8X  d   VP                  ^ 8X  d   RpM5VP                  ^ 8X  d%   VP                  ^ 8X  d   VP                  ^ 8X  d   RpV'       g   \        RV,          4      hVP                  VR7      p\        V4      R,          pW0P                  9  d+   \        V4      P                  4       pV P                  WC4       W23# )r   BLACKCYANMAGENTAYELLOWz&CMYK colour %r used without a spotName)spotNamer   NN)r   cyanmagentayellowblackr   clonePDFNamerm   PDFSeparationCMYKColorvaluer2   )rC   cmyksnamer   seps   &&   r    addColorPDFDocument.addColor3  s   uyy!|aDKKNQ4<<?t{{A~A$**a-DKKN!A$,,/djj!m  !ID!PQQzzUz3u~b!&(.446CNN3$zr   c                T    Vf   RV P                   n        R# WP                   n        R# )embeds in PDF fileN(anonymous))rS   title)rC   r  s   &&r    setTitlePDFDocument.setTitleH  s    =+DIIO#IIOr   c                T    Vf   RV P                   n        R# WP                   n        R# )zembedded in PDF fileNr  )rS   author)rC   r  s   &&r    	setAuthorPDFDocument.setAuthorO  s     >,DII%IIr   c                T    Vf   RV P                   n        R# WP                   n        R# r
  Nz(unspecified))rS   subject)rC   r  s   &&r    
setSubjectPDFDocument.setSubjectW  s     ? /DII 'IIr   c                T    Vf   RV P                   n        R# WP                   n        R# r  )rS   creator)rC   r  s   &&r    
setCreatorPDFDocument.setCreator`  s    ? /DII 'IIr   c                \    Vf   \         V P                  n        R# WP                  n        R# )r
  N)_default_producerrS   producer)rC   r  s   &&r    setProducerPDFDocument.setProducerg  s    !2DII!)IIr   c                T    Vf   RV P                   n        R# WP                   n        R# )z/embeds a string containing keywords in PDF fileN )rS   keywords)rC   r#  s   &&r    setKeywordsPDFDocument.setKeywordsn  s      !#DII!)IIr   c                &    WP                   n        R # rG   )rS   _dateFormatter)rC   dateFormatters   &&r    setDateFormatterPDFDocument.setDateFormatterw  s    #0		 r   c                    \        V P                  P                  4       4      p^ RIHp VP
                   F  pW19  g   K  VP                  V4       K  	  VP                  4        V# )r   )	_fontdata)listr|   r   reportlab.pdfbaser,  standardFontsappendsort)rC   	fontnamesr,  r   s   &   r    getAvailableFontsPDFDocument.getAvailableFontsz  sT    ))..01	/++D$  & , 	r   c           	        V P                   P                  V 4       V P                  pV P                  pV P	                  V4       V P	                  V4       R pV P                   P                  4       pV'       d   V P	                  V4      p^ p. pV P
                  pV P                  pV P                  p	V P                  p
\        V P                  4      ;V n        p V^,          pWW9  d   MWu,          pW,          p\        W4      pVP                  V 4      p\        P                  '       gX   \        P                   '       dB    VP"                  P$                  pTP)                  R\'        T4      : RTR,          : R24       VP)                  V4      pVW&   VP+                  V4       K  V =\-        V4      pV^,
          V8w  d   \/        RV: RV: 24      h\1        4       pVP3                  ^ V4       VP                  V 4      pVP)                  V4      p\5        VV^,           V P	                  V4      V P	                  V4      VV P7                  4       R7      pVP                  V 4      pVP)                  V4       \9        V R. 4       F  pVP;                  V4       K  	  VP                  V 4      #    \'        T4      p ELj; i)	Nz% z: class :N2   Nz 
zcounter z' doesn't match number to id dictionary )	startxrefSizeRootInfoEncryptr   	_digiSigs)r\   rI   rq   rS   r2   ro   rl   rm   rn   PDFFilerg   	__accum__PDFIndirectObjectr3   r   r4   r5   r   r   rk   addr0  lenr   PDFCrossReferenceTable
addsection
PDFTrailerr   r   sign)rC   r   rS   
encryptrefencryptinfocounterids
numbertoididToNVidToObidToOfFileoidobjIOIOf	classnameoffsetlnoxrefxreff
xrefoffsettrailertrailerfdss   &                        r    r3   PDFDocument.format  sA    	T"llyyst
ll'')4J__
00 !((8(8 99qLG(%%C+C"3,B))D/C&&&9+@+@+@+ # 6 6I sYs^^LMXXc]F FKJJsON*o19c>U\^abcc%'3D!XXe_
"q5>>#&>>$'  >>$'${2.BGGDM / {{4  =+ %c
Is   J5 5Kc                4    \        V4      pW P                  9   # )z test for existence of named form)r?   rm   r   s   && r    hasFormPDFDocument.hasForm  s    "4(..r   c                   \        V4      pW0P                  9   d   V P                  V,          p\        VR4      '       d   VP                  V,          # \	        V\
        4      '       d   VP                  4       # \	        V\        4      '       d1   \        VP                  P                  V,          P                  4      # \        R\        V4      ,          4      hR# )zget the declared bounding box of the form as a list.
If you specify a different PDF box definition (e.g. the
ArtBox) and it has one, that's what you'll get._extra_pageCatcher_infoz'I don't understand the form instance %sN)r?   rm   r1   ra  r*   PDFFormXObjectBBoxList	PDFStreamr-  
dictionarydictsequencer   r   )rC   r   boxTyper   theforms   &&&  r    getFormBBoxPDFDocument.getFormBBox  s     #4(??*ool3Gw89966w??'>22''))GY//G..33G<EEFF !JTRVZ!WXX +r   c                    \        V4      # )zaLets canvas find out what form is called internally.
Never mind whether it is defined yet or not.)r?   rC   r   s   &&r    getXObjectNamePDFDocument.getXObjectName  s     4  r   c                b    / pV F  p\        V4      p\        V4      pWRV&   K  	  \        V4      # )zzconstruct an xobject dict (for inclusion in a resource dict, usually)
from a list of form names (images not yet supported))r?   r   r}   )rC   	formnamesDr   r   	references   &&    r    xobjDictPDFDocument.xobjDict  s;     D&t,L*<8I'lO 
 Qr   c                   \        V\        4      pV P                  pVf   V'       d   VP                  \        J d   V# \        V\        4      '       ds   VP                  pVe,   W%8w  d&   \        R\        V4      : R\        V4      : 24      hWT9  d'   \        R\        V4      : R\        V4      : R24      h\	        V4      # V P                  ^,           ;q`n        Vf   R\        V4      ,           pW$9   d5   WB,          pWq8w  d   \        R\        V4      ,           4      h\	        V4      # V'       d   W!n        V^ 3V P                  V&   W P                  V&   WV&   \	        V4      # )Nzattempt to reregister object z with new name zobject of type z
 named as z, but not registeredRzredefining named object: )r*   r0   rm   r   r   r1   r"   r   r   r6   rk   rb   rl   ro   )rC   rP  r   iobrm   intnamerb   others   &&&     r    r2   PDFDocument.Reference  s<    Y'__
<9K(KJ3())**GDM M4:"/ 0 0( X\]`Xabghobp!qrr%g..-1-?-?-AA*<tM**D$Ez !<T$Z!GHH%d++#' 1>0B''-)-&4!$''r   )rq   rz   r&   ra   r>  rr   rg   r   rj   r   r~   r|   rm   rl   rn   rd   rS   r4   ro   rb   ry   re   rc   rh   )MediaBoxrG   ).r   r   r   r   defaultStreamFiltersrA   r\   r   pageCompressionr4   PDF_VERSION_DEFAULTr   rf   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r$  r)  r3  r3   r^  rj  rn  rt  r2   r   rU   rV   s   @r    r^   r^   o   s     nG&66$../3j!M
.
N@ H-7'>0*$&((**1C!J/
Y$!
	 ( (r   r^   truefalsenullc                   6   a  ] tR tRt o RR ltR tR tRtV tR# )r   i  c                    Wn         W n        R # rG   )rD   r   )rC   rD   r   s   &&&r    r   PDFText.__init__  s    r   c                    V P                   p\        V4      '       d   VP                  V P                  4      p\        P
                  ! VP                  P                  V4      4      pR V,           R,           # )   <   >)rD   r	   r,   r   binasciihexlifyr\   )rC   r:   rD   results   &&  r    r3   PDFText.format  sV    FFQ<<"A!!("2"2"9"9!"<=f}t##r   c                8    \        4       pV P                  V4      # rG   )rZ   r3   )rC   dummydocs   & r    __str__PDFText.__str__   s    :{{8$$r   )r   rD   N)zutf-8)	r   r   r   r   r   r3   r  r   rU   rV   s   @r    r   r     s     $% %r   r   c                     V # rG   r   )ns   &r    	PDFnumberr  $  s    Hr   z[^()]c                    \         P                  RV 4      p ^ pV  F(  pVR8X  d   V^,          pK  V^,          pV^ 8  g   K'   ^ # 	  V'       * ;'       d    ^;'       g    ^ # )z+test whether a string is balanced in parensr"  ()_re_cleanparenssub)sr  cs   &  r    _isbalancedr  *  s\    Bq!A	Ac61a41FAs1	 
 5;;Q!r   c                \     V P                  R4       ^#   \         d   p Rp?^ # Rp?ii ; i)z(return true if no Pdfdoc encoding errorspdfdocN)r,   UnicodeEncodeError)utextes   & r    _checkPdfdocr  5  s)    X s    ++c                   :   a  ] tR tRt o RtRR ltR tR tRtV t	R# )	ru   i=  Fc                    \        V\        4      '       d6   VP                  V n        VP                  V n        VP                  V n        R# Wn        W n        W0n        R# )aJ  s can be unicode/utf8 or a PDFString
if escape is true then the output will be passed through escape
if enc is raw then bytes will be left alone
if enc is auto we'll try and automatically adapt to utf_16_be/utf_16_le if the
effective string is not entirely in pdfdoc
if self.unicodeEncValid unicode will use the specifed encoding
N)r*   ru   r  escaper   )rC   r  r  r   s   &&&&r    r   PDFString.__init__?  sA     a	""SSDF((DKuuDHF KHr   c           	     *   V P                   p\        V R R4      p\        V4      '       d   VR8X  d    VP                  \        P
                  4      '       d   VP                  R4      pMHVP                  \        P                  4      '       d   VP                  R4      pMVP                  R4      p\        V4      '       d   VP                  R4      pM\        P
                  VP                  R4      ,           pMM\        V4      '       d   VR8X  dK   \        V4      '       d   VP                  R4      pM\        P
                  VP                  R4      ,           pMpV P                  '       d   VP                  V P                  4      pMB\        P
                  VP                  R4      ,           pM\!        R\#        V4      ,          4      h\        V R^4      p\%        VP&                  \(        4      '       g   VP&                  P                  V4      p^pV'       d    R	\+        V4      ,          pT^,          '       d   TP-                  RR4      pT^,          '       d4   \/        T4      '       d#   TP-                  RR4      P-                  RR4      p\1        T4      # RV,           R,           #     TP                  R4        L   \        P                  ! R\        T4      : 24       h ; i; i   \!        R
T: R\        T4      : 24      h; i)r   auto	utf_16_be	utf_16_leutf8r  z	Error in z-PDFString argument must be str/unicode not %sr  (%s)zcannot escape  z\012
z\(r  z\))   (   ))r  r   r   
startswithcodecsBOM_UTF16_BEdecodeBOM_UTF16_LEr  r,   r   r   r   r	   unicodeEncValidr   r   r6   r*   r\   rA   r   replacer  r.   )rC   r:   r  r   ur  ess   &&     r    r3   PDFString.formatO  sJ   FFd5(1::f}||F$7$788HH[1f&9&9::HH[1HHV,#AHHX."//0EE $ q\\f}??*A++AHH[,AAA%%%HHTXX&''(==LtTUwVWWhq)(**<88  ''*AFGil* axxZZ-axxKOOZZc*225=R= !8d?"E*d1g%?@*G !T!W!EFFs<   $J2 6J2 AJ2 &J2 "K4 2K15K&K..K14Lc                :    R \        V P                  4      ,          # )r  )r   r  rR   s   &r    r  PDFString.__str__  s    	$&&)))r   )r   r  r  N)r   r  )
r   r   r   r   r  r   r3   r  r   rU   rV   s   @r    ru   ru   =  s     O 2#h* *r   ru   c                     \        V 4      p\        V4       F>  w  rEWQ8  g   WR8  g
   VR 9   g   K  R\        \        V4      4      R,          ,           W4&   K@  	  RRP	                  V4      ,           # )z
%()<>{}[]##:   NN/r"  )r-  	enumeratehexordjoin)r   lohiLir  s   &&&   r    r  r    sZ     	T
A|4141,s3q6{2&AD  
r   c                   \   a  ] tR tRt o RtRR ltR tR tR tR t	RR	 lt
R
 tR tRtV tR# )r}   i  TNc                J    Vf
   / V n         R# VP                  4       V n         R# )zPdict should be namestring to value eg "a": 122 NOT pdfname to value NOT "/a":122N)rf  copy)rC   rf  s   &&r    r   PDFDictionary.__init__  s    <DI		DIr   c                "    W P                   V&   R # rG   rf  )rC   r   r  s   &&&r    __setitem__PDFDictionary.__setitem__  s    		$r   c                (    V P                   V,          # rG   r  rC   as   &&r    __getitem__PDFDictionary.__getitem__  s    yy|r   c                    WP                   9   # rG   r  r  s   &&r    __contains__PDFDictionary.__contains__  s    II~r   c                d    VP                  V P                  V,          4      V P                  V&   R # rG   )r2   rf  )rC   r   r:   s   &&&r    r2   PDFDictionary.Reference  s"    ",,TYYt_=		$r   c                   V P                   p \        VP                  4       4      p\        T\        4      '       g   TP                  4        T Uu. uF6  p\        \        T4      T4      R ,           \        Y5,          T4      ,           NK8  	  ppT P                  '       d   \        P                  '       g   T P                  R8X  d   TP                  T4      pMLTP                  p\        \!        ^\#        T4      ^4      4       F  pT! TR4       K  	  R P                  T4      pRT,           R,           #    \        \	        T4      4       h ; iu upi )    forced   
 s   <<
s   
>>)rf  r-  r   r   rk   r*   r   r1  r3   r  	multiliner   pdfMultiLiner  insertreversedrangerA  )	rC   r:   INDrf  r   r   r  rD   r  s	   &&&      r    r3   PDFDictionary.format  s    yy			$D ${++TYY[RVWRVQfWQZ)$.vdgh/GGGRVWNNNy555$..(:RA hhAeAs1vq12!F 3		!Aqy  	%+Ws   D6 <E6Ec                ,    \        V P                  4      # rG   )r}   rf  rR   s   &r    r  PDFDictionary.copy  s    TYY''r   c                    V P                   pVP                  4        Uu. uF  q"P                  R 4      '       g   K  VNK  	  ppV F  pVP                  V4      WR,          &   K  	  R# u upi )r  r   N)rf  r   r  pop)rC   rr  r   Ks   &   r    	normalizePDFDictionary.normalize  sR    II61LL$5QQ6AuuQxAeH  7s
   A)A)r  rG   r  )r   r   r   r   r  r   r  r  r  r2   r3   r  r  r   rU   rV   s   @r    r}   r}     s7     I$ >!&(   r   r}   c                   ,   a  ] tR tRt o R tR tRtV tR# )checkPDFNamesi  c                B    \        \        \        V4      4      V n        R # rG   )r-  mapr  names)rC   r  s   &*r    r   checkPDFNames.__init__  s    #ge,-
r   c                n    VP                  R 4      '       g   \        V4      pWP                  9   d   V# R# )r  N)r  r  r  )rC   r  s   &&r    r   checkPDFNames.__call__  s0    $$%.EJJL r   )r  N)r   r   r   r   r   r   r   rU   rV   s   @r    r  r    s     . r   r  c                     V R9   d   V # R# )r  N)r  r  r   )r  s   &r    checkPDFBooleanr    s      , r   c                   4   a  ] tR tRt o / tRR ltR tRtV tR# )CheckedPDFDictionaryi  Nc                P    \         P                  W4       V'       d	   W n        R # R # rG   )r}   r   validate)rC   rf  r  s   &&&r    r   CheckedPDFDictionary.__init__  s    t)X]8r   c                    WP                   9  d   \        R V,          4      hV P                   V,          ! V4      pVf   \        RV: RV: 24      h\        P                  WV4       R# )zinvalid key, %rNz
Bad value z	 for key )r  r   r}   r  )rC   r   r  cvalues   &&& r    r   CheckedPDFDictionary.__setitem__  sU    }}$.566t$U+>%EFF!!$F3r   )r  NN)	r   r   r   r   r  r   r  r   rU   rV   s   @r    r  r    s     H.4 4r   r  c                   b   ] tR tRt]! ]]]]]]]! RP                  4       !  ]! RP                  4       !  ]! RP                  4       !  ]! RP                  4       !  ]! RP                  4       !  ]! RP                  4       !  ]! RP                  4       !  ]! RP                  4       !  R7      tRt	R	# )
ViewerPreferencesPDFDictionaryi  z#UseNone UseOutlines UseThumbs UseOCzL2R R2Lz(MediaBox CropBox BleedBox TrimBox ArtBoxzNone AppDefaultz.Simplex DuplexFlipShortEdge DuplexFlipLongEdge)HideToolbarHideMenubarHideWindowUI	FitWindowCenterWindowDisplayDocTitleNonFullScreenPageMode	DirectionViewAreaViewClip	PrintArea	PrintClipPrintScalingDuplexr   N)
r   r   r   r   rf  r  r  splitr  r   r   r   r    r  r    s    ++,), /&35Z5`5`5b&c'):;&(R(X(X(Z[&(R(X(X(Z[')S)Y)Y)[\')S)Y)Y)[\*,=,C,C,EF$&V&\&\&^_Hr   r  c                   0   a  ] tR tRt o RtR tR tRtV tR# )PDFStreamFilterZCompressi  FlateDecodec                r    \        V4      '       d   VP                  R 4      p\        P                  ! V4      # )r  )r	   r,   zlibcompressrC   texts   &&r    r,   PDFStreamFilterZCompress.encode  s(    T??;;v&D}}T""r   c                .    \         P                  ! V4      # rG   )r  
decompress)rC   encodeds   &&r    r  PDFStreamFilterZCompress.decode  s    w''r   r   N	r   r   r   r   pdfnamer,   r  r   rU   rV   s   @r    r  r    s     G#( (r   r  c                   0   a  ] tR tRt o RtR tR tRtV tR# )PDFStreamFilterBase85Encodei  ASCII85Decodec                d    ^ RI Hp \        V4      p\        P                  '       d	   V! V4      pV# )r   )_wrap)reportlab.pdfbase.pdfutilsr$  r   r   wrapA85)rC   r  r$  s   && r    r,   "PDFStreamFilterBase85Encode.encode  s)    4 &;Dr   c                    \        V4      # rG   )r   r  s   &&r    r  "PDFStreamFilterBase85Encode.decode  s     &&r   r   Nr  rV   s   @r    r!  r!    s     G' 'r   r!  c                   8   a  ] tR tRt o Rt^tRR ltR tRtV t	R# )rd  i  z@set dictionary elements explicitly stream.dictionary[name]=valueNc                F    Vf   \        4       pWn        W n        W0n        R # rG   )r}   re  contentfilters)rC   re  r,  r-  s   &&&&r    r   PDFStream.__init__	  s    &J$r   c                   V P                   p\        VP                  P                  4       4      pV P                  pV P
                  pV P                  f   \        R4      hVf   VP                  pVe|   RVP                  9  dk   \        V4      pVP                  4        . pV F9  pVP                  V4      pVP                  ^ \        VP                  4      4       K;  	  \        V4      VR&   VP                  P                  V4      p\!        W14      p\#        V4      VR&   \!        W!4      p	V	R,           V,           R,           # )Nzstream content not setFilterLengths   
stream
s
   endstream
)re  r}   rf  r  r,  r-  r   r}  r-  reverser,   r  r  r  PDFArrayr\   r3   rA  )
rC   r:   re  r,  r-  rffnamesr<   fcfds
   &&        r    r3   PDFStream.format  s   __
":??#7#7#9:
,,,,<<566?33G8:??#BgBJJLF ((7+a!34	  $,F#3Jx ""))'2G&"7|
8J)-">11r   )r,  re  r-  NNN)
r   r   r   r   r[   r#   r   r3   r   rU   rV   s   @r    rd  rd    s     JK2 2r   rd  c                     V f   \         p V P                  4       R,           p \        T \        P                  ;'       d    \
        \        .;'       g    \        .R7      pRVn        V# )Nr  )r,  r-  ztest stream)teststreamcontentstriprd  r   useA85PDFBase85EncodePDFZCompressr$   )r,  Ss   & r    
teststreamrA  /  sY    #mmo$GG%,,OO/,1OaaT`Sa	cA "AMHr   z\
1 0 0 1 0 0 cm BT /F9 12 Tf 14.4 TL ET
1.00 0.00 1.00 rg
n 72.00 72.00 432.00 648.00 re B*
c                   :   a  ] tR tRt o RtR tR tRR ltRtV t	R# )	r3  i?  Tc                &    \        V4      V n        R # rG   )r-  rg  )rC   rg  s   &&r    r   PDFArray.__init__A  s    Xr   c                b    \        \        VP                  V P                  4      4      V n        R# )z'make all objects in sequence referencesN)r-  r  r2   rg  rH   s   &&r    
ReferencesPDFArray.ReferencesC  s    S!3!3T]]CDr   c                   V P                    Uu. uF  p\        W14      NK  	  ppV P                  '       d   \        P                  '       g   V P                  R 8X  d   VP                  V4      pMg\        V4      pV^
8  dE   VP                  p\        \        ^
V^
4      4       F  pV! VR4       K  	  RP                  V4      pMRP                  V4      pRV,           R,           # u upi )r  r  r  s   [ s    ])
rg  r3   r  r   r  r  rA  r  r  r  )rC   r:   r  r  r  r  rD   r  s   &&&     r    r3   PDFArray.formatF  s    *.--8-QVA -8NNNy555$..(:RA!fAt((!%Ar"23AaK 4IIaLIIaLqy5   9s   C')rg  Nr  )
r   r   r   r   r  r   rF  r3   r   rU   rV   s   @r    r3  r3  ?  s     I'E! !r   r3  c                       ] tR tRtRtRtR# )PDFArrayCompactiV  Fr   N)r   r   r   r   r  r   r   r   r    rK  rK  V  s    Ir   rK  c                   0   a  ] tR tRt o ^tR tR tRtV tR# )r?  iY  c                    Wn         W n        R # rG   )r   r,  )rC   r   r,  s   &&&r    r   PDFIndirectObject.__init__[  s    	r   c                F   V P                   pVP                  V,          w  r4VP                  P                  W44       \	        V P
                  V^R7      p\        V: RV: R24      V,           VP                  R4      '       d   R,           R,           # R,           R,           # )r   r;   r  z obj
   
r   s   endobj
)r   rl   r\   rO   r3   r,  r.   endswith)rC   r:   r   r  vfcontents   &&    r    r3   PDFIndirectObject.format^  s    yy2248!!!'$,,1=1-.'0077D 	=BD 	r   )r,  r   N)	r   r   r   r   r#   r   r3   r   rU   rV   s   @r    r?  r?  Y  s     K r   r?  c                   ,   a  ] tR tRt o R tR tRtV tR# )r   ih  c                    Wn         R # rG   r   rm  s   &&r    r   PDFObjectReference.__init__i      	r   c                     \        R VP                  V P                  ,          ,          4      #    \        R\	        T P                  4      ,          4      h; i)z%s %s Rz:forward reference to %s not resolved upon final formatting)r.   rl   r   r   r   rH   s   &&r    r3   PDFObjectReference.formatk  sM    	kY)L)LTYY)WWXX	kWZ^_c_h_hZiijjs	   ,/ 'ArX  Nr   r   r   r   r   r3   r   rU   rV   s   @r    r   r   h  s     k kr   r   c                   >   a  ] tR tRt o ]3R ltR tR tR tRt	V t
R# )r=  iq  c                    . V n         V P                   P                  V n        ^ V n        V P	                  \        RV,          4      R,           4       R# )r   z%%PDF-%s.%ss5   
% ReportLab Generated PDF document (opensource)
N)stringsr0  r   rT  r@  r.   )rC   r   s   &&r    r   PDFFile.__init__s  sD    \\((
 	)MJ67RS 	r   c                    R # rG   r   rR   s   &r    closeOrResetPDFFile.closeOrReset  s    r   c                    \        V4      pV P                  pV\        V4      ,           V n        V P                  V4       V# )zGshould be constructed as late as possible, return position where placed)r.   rT  rA  r   )rC   r  r  s   && r    r@  PDFFile.add  s3    aLSVm

1r   c                8    R P                  V P                  4      # )r   )r  r`  rH   s   &&r    r3   PDFFile.format  s    xx%%r   )rT  r`  r   N)r   r   r   r   r  r   rc  r@  r3   r   rU   rV   s   @r    r=  r=  q  s!     !4 & &r   r=  c                   ,   a  ] tR tRt o R tR tRtV tR# )PDFCrossReferenceSubsectioni  c                    Wn         W n        R # rG   firstentrynumber
idsequence)rC   rm  rn  s   &&&r    r   $PDFCrossReferenceSubsection.__init__  s     0$r   c                   V P                   pV P                  p\        V4      p\        V4      p/ pV^ 8X  d!   RV^ &   V^,           pVP	                  ^ R4       VP
                  pVP                  pW%,           ^,
          p	V F  p
Wz,          w  rW9   d0   \        RV: R\        V
4      : R\        Wj,          4      : 24      hW8  g   W8  d   \        RV: RV: RV	: 24      hW,
          pWV&   W,          pRW3,          WK&   K  	  V: RV: 2pVP	                  ^ V4       VP                  R	4       \        R
P                  V4      4      # )z`id sequence should represent contiguous object nums else error. free numbers not supported (yet)zstandard free entryz0000000000 65535 f zobject number collision r  zobject number z not in range z..z%0.10d %0.5d n r"  r  )rm  rn  r-  rA  r  rl   rn   r   r   r0  r.   r  )rC   r:   rm  rn  entriesnentriestakenrK  rn   lastentrynumberr   numrN   rnumrT  	firstlines   &&              r    r3   "PDFCrossReferenceSubsection.format  s2   00__
z"z?Q,E!HzHNN13444((
*3A5B#ZNS| sDQSHVZ[`[dVe!fgg"c&: 3P`bq!rss'D#J^F,/@@GL   0:	q)$r7+,,r   rl  Nr]  rV   s   @r    rj  rj    s     %- -r   rj  c                   2   a  ] tR tRt o R tR tR tRtV tR# )rB  i  c                    . V n         R # rG   sectionsrR   s   &r    r   PDFCrossReferenceTable.__init__  s	    r   c                R    \        W4      pV P                  P                  V4       R # rG   )rj  r|  r0  )rC   
firstentryrI  sections   &&& r    rC  !PDFCrossReferenceTable.addsection  s    -j>W%r   c                    V P                   pV'       g   \        R 4      hR.pV P                    F  p\        WA4      pVP                  V4       K!  	  \	        RP                  V4      4      # )zno crossref sectionss   xref
r   )r|  r   r3   r0  r.   r  )rC   r:   r|  r  r  fss   &&    r    r3   PDFCrossReferenceTable.format  sY    ==344KA$BHHRL  !%%r   r{  N)	r   r   r   r   r   rC  r3   r   rU   rV   s   @r    rB  rB    s     && &r   rB  c                   0   a  ] tR tRt o RR ltR tRtV tR# )rD  i  Nc                    Wn         Ve   Vf   \        R4      h\        4       ;qn        RV3RV3RV3RV3RV3RV33 F  w  rV
f   K  WV	&   K  	  RVn        R # )	NzSize and Root keys requiredr8  Prevr9  r:  r   r;  r  )r7  r   r}   rf  r  )rC   r7  r8  r  r9  r:  r   r;  rf  r  rS  s   &&&&&&&&   r    r   PDFTrailer.__init__  st    "<4<:;;(?*ytnvtnvtntntRj9g2FHEQ}QH  r   c           
         V P                   P                  VR R7      pRP                  RVR\        \	        V P
                  4      4      R.4      # )rQ  r  r   s   trailer
s   
startxref
s   
%%EOF
)rf  r3   r  r.   r+   r7  )rC   r:   fdicts   && r    r3   PDFTrailer.format  sN    		  e 4xx #dnn-.  	r   )rf  r7  )NNNNNNr]  rV   s   @r    rD  rD    s     	 	 	r   rD  c                   H   a a ] tR tRt oRV 3R lltV 3R ltR tRtVtV ;t	# )XMPi  c           
       < V'       d   V'       d   \        R 4      hV'       g   V'       g   \        R4      h\        SV `	  \        \	        \        R4      \        R4      R7      4      R7       Wn        RV n        W n        R# )z5XMP is ambiguous with both path and creator argumentsz-XMP needs at least a path or creator argumentMetadataXML)TypeSubtype)re  N)	r   superr   r}   rf  r  
_XMP__path_XMP__pathContent_XMP__creator)rC   pathr  r   s   &&&r    r   XMP.__init__  si    GTUU'LMM$TZ(&  	 	
 ! r   c                V   < V P                  V4      V n        \        \        V `  V4      # rG   )makeContentr,  r  r  r3   )rC   r   r   s   &&r    r3   
XMP.format  s'    '',S%c**r   c                `   V P                   '       do   V P                  fU   ^ RIHp \	        V P                   R4      ;_uu_ 4       pV! VP                  4       4      V n        R R R 4       V P                  # V P                  # V P                  V4      #   + '       g   i     T P                  # ; i)N)smartDecoderb)r  r  reportlab.lib.rparsexmlr  r   readr  )rC   r   r  _s   &&  r    r  XMP.makeContent  s    ;;;!!)?$++d++q)4QVVX)>D& ,%%%4%%%>>#&&	 ,+%%%s   BB-	)	__creator__path__pathContentr,  r  )
r   r   r   r   r   r3   r  r   rU   __classcell__)r   rW   s   @@r    r  r    s     !+' 'r   r  c                      a  ] tR tRt o Rt^tR]! R4      R]! R4      RR/tR	P                  4       t	]	t
R
 tR tR tR tR tR tRtV tR# )rp   i  zDocument Rootr  rq   PageModeUseNonerv   Nz
        Dests Outlines Pages Threads AcroForm Names OpenAction PageMode URI
        ViewerPreferences PageLabels PageLayout JavaScript StructTreeRoot SpiderInfo
        MarkInfo Metadata Tabsc                   V P                  V4       V P                  pV P                  p/ pVP                  4        F  w  rV\	        WV4      pVf   K  WdV&   K  	  V P
                   F  p\	        WR 4      pVf   K  WdV&   K  	  V F$  pWT9   g   K  VP                  WE,          4      WE&   K&  	  \        V4      p\        Wq4      # rG   )	check_format__Defaults____Refs__itemsr   __NoDefault__r2   r}   r3   )rC   r:   defaultsRefsrr  r   rS  rf  s   &&      r    r3   PDFCatalog.format
  s    (#$$}}>>#CAq!A}! $ ##At$A}! $
 Av))!$/  Qd%%r   c                (    V P                  R 4       R# )UseOutlinesNsetPageModerR   s   &r    showOutlinePDFCatalog.showOutline  s    'r   c                (    V P                  R 4       R# )
FullScreenNr  rR   s   &r    showFullScreenPDFCatalog.showFullScreen"  s    &r   c                :    V'       d   \        V4      V n        R # R # rG   )r  
PageLayout)rC   layouts   &&r    setPageLayoutPDFCatalog.setPageLayout%  s    %foDO r   c                :    V'       d   \        V4      V n        R # R # rG   )r  r  )rC   modes   &&r    r  PDFCatalog.setPageMode)  s    #DMDM r   c                    R# )zfor use in subclassesNr   rH   s   &&r    r  PDFCatalog.check_format-  rK   r   )r  r  )r   r   r   r   r$   r#   r  r  r  r  r  r3   r  r  r  r  r  r   rU   rV   s   @r    rp   rp     sl     !KKGI.GI.L" #(%'  H&*('.* r   rp   c                   ~   a  ] tR tRt o RtRt^tR]! R4      /tRP                  4       t
R.tR tR	 tR
 tR tRtV tR# )rs   i1  zHPAGES TREE WITH ONE INTERNAL NODE, FOR "BALANCING" CHANGE IMPLEMENTATIONz	page treer  r&   zKids Count ParentParentc                    . V n         R # rG   r   rR   s   &r    r   PDFPages.__init__:  s	    
r   c                (    V P                   V,          # rG   r  )rC   items   &&r    r  PDFPages.__getitem__<  s    zz$r   c                <    V P                   P                  V4       R # rG   )r   r0  rC   r   s   &&r    r   PDFPages.addPage>  s    

$r   c                    V P                   p\        V4      pVP                  V4       W0n        \	        V4      V n        R # rG   )r   r3  rF  KidsrA  Count)rC   r:   r   kidss   &&  r    r  PDFPages.check_format@  s0    

!	Z
r   )r  r  r   N)r   r   r   r   r[   r$   r#   r  r  r  r  r  r   r  r   r  r   rU   rV   s   @r    rs   rs   1  sQ     RKKGG, L'--/MzH     r   rs   c                      a  ] tR tRt o Rt^ t^tR]! R4      /tRP                  4       t
RP                  4       tRtRtR	t^ t^ tR	t/ t/ tR	tR
 tR tR tR tR tRtV tR	# )PDFPageiI  zPage dictionaryr  r   zParent
        MediaBox Resources Contents CropBox Rotate Thumb Annots B Dur Hid Trans AA
        PieceInfo LastModified SeparationInfo ArtBox TrimBox BleedBox ID PZ
        TranszContents Parent IDS  iJ  Nc                D    V P                    F  p\        WR 4       K  	  R # rG   )r  setattrrm  s   & r    r   PDFPage.__init__c  s    &&DD% 'r   c                    Wn         R # rG   r   r   s   &&r    rf   PDFPage.setCompressiong  s     r   c                    V P                   '       d   \        R 4      h\        V4      '       d   RP                  V4      R,           pWn        R# )z&overridden! must set stream explicitlyr  N)Override_default_compilationr   r   r  stream)rC   codes   &&r    	setStreamPDFPage.setStreami  s:    ,,,EFF;;99T?4'Dr   c                &    \        V4      V n        R # rG   )r}   Trans)rC   tranDicts   &&r    setPageTransitionPDFPage.setPageTransitionp  s    "8,
r   c                (   V P                   '       d   R # V P                  ;'       g]    \        V P                  R9   ;'       d#    ^ ^ V P                  V P
                  .;'       g    ^ ^ V P
                  V P                  .4      V n        V P                  '       g	   R V n        M:\        V P                  \        4      '       g   \        V P                  4      V n        V P                  '       g   V P                  pV'       g   \        4       V n	        Mg\        4       pV P                  '       d9   \        P                  ;'       d    \         \"        .;'       g    \"        .Vn        W#n        RVn        W0n	        V P*                  '       g   \-        4       pVP/                  4        V P0                  '       d   VP3                  4        MVP5                  4        V P6                  '       d   V P6                  Vn        V P:                  '       d   V P:                  Vn        VP=                  V P>                  4       VPA                  V PB                  4       W@n        V PD                  '       g%   VPF                  pVPI                  V4      V n"        R # R # )Nzpage stream)Z   i  )%r  r|  r3  Rotate
pageheight	pagewidthAnnotsr*   r0   Contentsr  rA  rd  r   r   r=  r>  r?  r-  r,  r$   	ResourcesPDFResourceDictionary
basicFonts	hasImagesallProcs
basicProcsXObjectsXObject	ExtGState
setShading_shadingUsedsetColorSpace_colorsUsedr  r&   r2   )rC   r:   r  r@  	resourcesr   s   &&    r    r  PDFPage.check_formats  s   ,,,  _  _$++2I2r2rqQRSWSbSbcgcqcqNr  3^  3^wxz{  ~B  ~L  ~L  NR  N]  N]  w^  *_{{{DK dkk)44&t{{3}}}[[F *K### ) 0 0 T To|5T f fYeXfAI"	 - !~~~-/I  "~~~""$$$&}}}$(MM	!~~~&*nn	#  !2!23##D$4$45&N{{{NNE",,U3DK r   )r  r  r|  r  r  r  r   r  )r   r   r   r   r$   r  r#   r  r  r  r  r  r  r  r  r  r   r  r  _shadingsUsedr  r   rf   r  r  r  r   rU   rV   s   @r    r  r  I  s     #K $% KGFO L   (--/HIJFIKHKME&!-*4 *4r   r  c                       ] tR tRtRtR# )DuplicatePageLabelPagei  r   Nr   r   r   r    r  r    r!   r   r  c                   H   a  ] tR tRt o Rt^ t/ tR.t. tR t	R t
R tRtV tR# )PDFPageLabelsi  NNumsc                    . V n         R # rG   )labelsrR   s   &r    r   PDFPageLabels.__init__  s	    r   c                >    V P                   P                  W34       R# )aW  Adds a new PDFPageLabel to this catalog.
The 'page' argument, an integer, is the page number in the PDF document
with which the 'label' should be associated. Page numbering in the PDF
starts at zero! Thus, to change the label on the first page, '0' should be
provided as an argument, and to change the 6th page, '5' should be provided
as the argument.

The 'label' argument should be a PDFPageLabel instance, which describes the
format of the labels starting on page 'page' in the PDF and continuing
until the next encounter of a PDFPageLabel.

The order in which labels are added is not important.
N)r  r0  )rC   r   labels   &&&r    addPageLabelPDFPageLabels.addPageLabel  s     	D=)r   c                    V P                   P                  4        . pV P                    F'  w  rVVP                  V4       VP                  V4       K)  	  \        V4      V n
        \        P                  W4      #   \         d    \        T P                    Uu. uF  q"^ ,          NK  	  Mu upi up4      p\	        R\        \        T Uu. uF  q#P                  T4      ^8  g   K  TNK  	  Mu upi up4      4      ,          4        Li ; i)r   z-

!!!!! Duplicate PageLabel seen for pages %r)r  r1  r  sortedr   r-  setcountr0  r3  r  rp   r3   )rC   r:   r-   tmpr  r   r  s   &&     r    r3   PDFPageLabels.format  s    	AKK ;;KDMM$MM%  ' V$	  00 & 	A41A$$45CORVWZgj[}gjbcnwnwxynz{|n|\]\]gj[}W~R  A	As/   A: :D
B*
)!D

C-&C-,D
	D
)r  r  )r   r   r   r   __comment__r#   r  r  r  r   r  r3   r   rU   rV   s   @r    r  r    s4     KKLHMH* 1 1r   r  c                   t   a  ] tR tRt o Rt^ t/ tRP                  4       tRt	Rt
RtRtRtR	tRR
 ltR tRtV tR# )PDFPageLabeli  NzType S P Stz:ARABIC ROMAN_UPPER ROMAN_LOWER LETTERS_UPPER LETTERS_LOWERrr  rw  rAr  c                
   V'       dI   VP                  4       V P                  9   d   \        WP                  4       4      p\        V4      V n        V'       d   \        V4      V n        V'       d   \        V4      V n        R# R# )a	  
A PDFPageLabel changes the style of page numbering as displayed in a PDF
viewer. PDF page labels have nothing to do with 'physical' page numbers
printed on a canvas, but instead influence the 'logical' page numbers
displayed by PDF viewers. However, when using roman numerals (i, ii,
iii...) or page prefixes for appendecies (A.1, A.2...) on the physical
pages PDF page labels are necessary to change the logical page numbers
displayed by the PDF viewer to match up with the physical numbers. A
PDFPageLabel changes the properties of numbering at the page on which it
appears (see the class 'PDFPageLabels' for specifying where a PDFPageLabel
is associated) and all subsequent pages, until a new PDFPageLabel is
encountered.

The arguments to this initialiser determine the properties of all
subsequent page labels. 'style' determines the numberings style, arabic,
roman, letters; 'start' specifies the starting number; and 'prefix' any
prefix to be applied to the page numbers. All these arguments can be left
out or set to None.

* style:

    - None:                       No numbering, can be used to display the prefix only.
    - PDFPageLabel.ARABIC:        Use arabic numbers: 1, 2, 3, 4...
    - PDFPageLabel.ROMAN_UPPER:   Use upper case roman numerals: I, II, III...
    - PDFPageLabel.ROMAN_LOWER:   Use lower case roman numerals: i, ii, iii...
    - PDFPageLabel.LETTERS_UPPER: Use upper case letters: A, B, C, D...
    - PDFPageLabel.LETTERS_LOWER: Use lower case letters: a, b, c, d...

* start:

    -   An integer specifying the starting number for this PDFPageLabel. This
        can be used when numbering style changes to reset the page number back
        to one, ie from roman to arabic, or from arabic to appendecies. Can be
        any positive integer or None. I'm not sure what the effect of
        specifying None is, probably that page numbering continues with the
        current sequence, I'd have to check the spec to clarify though.

* prefix:

    -   A string which is prefixed to the page numbers. Can be used to display
        appendecies in the format: A.1, A.2, ..., B.1, B.2, ... where a
        PDFPageLabel is used to set the properties for the first page of each
        appendix to restart the page numbering at one and set the prefix to the
        appropriate letter for current appendix. The prefix can also be used to
        display text only, if the 'style' is set to None. This can be used to
        display strings such as 'Front', 'Back', or 'Cover' for the covers on
        books.

N)	upper__convertible__r   r  r@  r  Stru   P)rC   stylestartprefixs   &&&&r    r   PDFPageLabel.__init__  sT    d {{} 4 44gd;;=>YeU^DFIe,$'If-466r   c                F    \         P                  '       d   \        4       hR # )F)r   errorOnDuplicatePageLabelPager  )rC   oths   &&r    __lt__PDFPageLabel.__lt__  s    222(**r   )r  r@  r  r9  )r   r   r   r   r$   r#   r  r  r  r  ARABICROMAN_UPPERROMAN_LOWERLETTERS_UPPERLETTERS_LOWERr   r%  r   rU   rV   s   @r    r  r    sP     KKL!'')MROFKKMM6.p r   r  c                 "   \        4       p\        4       Vn        V P                  pV P	                  V4      Vn        \        . RO4      Vn        \        4       pVP                  4        VP                  4        W1n        VP                  V4       R# )r   N)r   r   r  iI  )r  rA  r  r&   r2   r  r3  r|  r  r  r  r  r   )r:   r  r   r  s   &   r    testpager-    sk    	AAJNNE!!%(AH*+AJ%'IK	MM!r   z/
<<
  /Count
      0
  /Type
      /Outlines
>>c                   R   a  ] tR tRt o Rt]P                  RR4      t^tR t	Rt
V tR# )rw   i*  zTEST OUTLINE!r  c                ,    \        V P                  4      # rG   )r.   r  rH   s   &&r    r3   PDFOutlines0.format.  s    ##r   r   N)r   r   r   r   r$   DUMMYOUTLINEr  r  r#   r3   r   rU   rV   s   @r    rw   rw   *  s+     !Kd+DK$ $r   rw   c                   J   a  ] tR tRt o RtR;t;t;t;t;t	;t
;ttR tRtV tR# )OutlineEntryObjecti1  zan entry in an outlineNc                    / p\        V P                  4      VR &   V P                  VR&   V P                  VR&   R F  p\	        W4      pVf   K  WBV&   K  	  \        V4      pVP                  V4      # )Titler  Dest)r  NextFirstLastr  )ru   r5  r  r6  r   r}   r3   )rC   r:   rr  r  rS  PDs   &&    r    r3   OutlineEntryObject.format4  sn    tzz*'
kk(II&	;A A}! < 1yy""r   r   )r   r   r   r   r[   r5  r6  r  r  r7  r8  r9  r  r3   r   rU   rV   s   @r    r3  r3  1  s:     AEEEEDE6EDE4E%E$
# 
#r   r3  c                   r   a  ] tR tRt o RtR;tt^ tRtR t	RR lt
R tR tR tR	 tR
 tR tRR ltRtV tR# )rx   i@  a  
takes a recursive list of outline destinations like::

    out = PDFOutline1()
    out.setNames(canvas, # requires canvas for name resolution
    "chapter1dest",
    ("chapter2dest",
    ["chapter2section1dest",
    "chapter2section2dest",
    "chapter2conclusiondest"]
    ), # end of chapter2 description
    "chapter3dest",
    ("chapter4dest", ["c4s1", "c4s2"])
    )

Higher layers may build this structure incrementally. KISS at base level.
Nc                L    / V n         / V n        . V n        . V n        / V n        R # rG   )destinationnamestotitlesdestinationstotitles
levelstack	buildtree	closedictrR   s   &r    r   PDFOutlines.__init__X  s'    (*%$&!r   c                   Vf   V^ 8w  d   \        R4      h\        V\        4      '       g   \        R\        V4      ,          4      hV^ 8  d   \        R4      hVf   TpV P                  pV P
                  pV P                  pW%8  dE   W%^,           8  d   \        RV: RV: RV: RV: R	2	4      hV^,           ;r%VP                  . 4       W%8  di   VR,          pVR VR,          p	V	R,          p
\        V
\        4      '       d    V
w  r\        R
\        V
4      ,           4      hT
pTpW3V	R&   V^,
          pKn  Vf   R# VR,          P                  V4       W0P                  V&   V'       d   ^V P                  V&   W n        R# )z/destinationname of None means "close the tree" Nzclose tree must have level of 0zlevel must be integer, got %sznegative levels not allowedzcan't jump from outline level z
 to level z&, need intermediates (destinationname=z, title=r  z cannot reset existing sections: )r   r*   r8   r6   currentlevelr@  rA  r0  tupler   r>  rB  )rC   destinationnamelevelr  closedrF  stacktreecurrentpreviouslastinpreviousr   sectionlists   &&&&&        r    addOutlineEntryPDFOutlines.addOutlineEntry_  s   "uax>??%$$J7VY]^cYd7d,e&e7*%BCC=/%((~~!^#   FR  TY  [j  lq  "r  s  s#/>1ELL BiGb	RyH%b\N.//&4# !Cd>FZ!Z[[%% $2'>L"Fb	)9>%%o6Q4>>/2!r   c                    Wn         R # rG   )mydestinations)rC   destinationtrees   &&r    setDestinationsPDFOutlines.setDestinations  s    -r   c                    / p\        R 4      VR&   V P                  VR&   V P                  VR&   V P                  VR&   \	        V4      pVP                  V4      # )rz   r  r  r8  r9  )r  r  firstlastr}   r3   rC   r:   rr  r:  s   &&  r    r3   PDFOutlines.format  sU    J'&	ZZ'
ZZ'
II&	1yy""r   c                J    V P                  W4      pV P                  V4       R # rG   translateNamesrV  rC   r   nametreedesttrees   &&* r    setNamesPDFOutlines.setNames  s     &&v8X&r   c                J    V P                  W4      pV P                  V4       R# )z1Explicit list so I don't need to do in the callerNr^  r`  s   &&& r    setNameListPDFOutlines.setNameList  s     &&v8X&r   c                0   V P                   pV P                  pV P                  p\        V4      '       di   \	        V4      '       g   VP                  R4      pVP                  V4      pTpW#9   d
   W2,          pMWsV&   WtV&   W%9   d   ^WV&   W!P                  V4      /# \        V4      '       dO   . pV F#  p	VP                  V P                  W4      4       K%  	  \        V\        4      '       d   \        V4      # V# \        R\        V4      ,          4      h)z=recursively translate tree of names into tree of destinationsr  z5in outline, destination name must be string: got a %s)r>  r?  rB  r   r	   r  _bookmarkReferencer   r0  r_  r*   rG  r   r6   )
rC   r   objectr>  r?  rB  destinationr  r  os
   &&&       r    r_  PDFOutlines.translateNames  s    #'#@#@ #88NN	==V$$v}}V/Df 33F;KE10827/05-")*	&55f=>>==A,,V78 &''QxHOPTU[P\\]]r   c                   V P                   fl   V P                  '       d<   V P                  R4       V P                  ^ ,          pV P                  W#4      V n         MR;V n        V n        ^ V n        RV n        R# \        V P                   V P                  4      V n        V P                  WP                   ^R7      w  V n        V n        ^V n        R# )zPprepare all data structures required for save operation (create related objects)NrP  rE  )
rT  r@  rQ  r_  rY  rZ  r  r   rB  maketree)rC   r:   r   	destnamess   &&& r    rI   PDFOutlines.prepare  s    &$$T* OOA.	&*&9&9&&L#)--
TY

 4..?
"&--:M:MXY-"ZTY
r   c                   V'       d   R pVP                  VP                  4      pM;V ;P                  ^,          un        RV P                  ,          pVf   \        R4      h\	        V4      '       g   \        R4      h\        V4      pV^,
          pR;p;rV P                  pV P                  p\        V4       EF>  p\        4       pW>n
        V: RV: 2pVP                  W4      pVe   VVn        Wn        V	f   Tp	Tp
TpTp
W-,          p\        V\        4      '       d   TpMi\        V\        4      '       d9    Vw  pp\        TT4      Tn        T P#                  TTT4      w  Tn        Tn        M\        R\)        V4      ,          4      h \+        VP-                  4       4      w  w  ppTT,          Tn        TTn        \        T\        4      '       g   EK"  TT9   g   EK,  TP                   ) Tn        EKA  	  W3#    \        R\        T4      ,          4      h; i   \        R\/        T4      ,           4      h; i)	Outlinez
Outline.%sNz2non-top level outline elt parent must be specifiedz-destinationtree must be list or tuple, got %s.z7destination tree elt tuple should have two elts, got %sz4destination tree elt should be dict or tuple, got %sz3bad outline leaf dictionary, should have one entry )r2   rz   r  r   r   rA  r>  rB  r  r3  r  r7  r  r*   rf  rG  r  ro  r8  r9  r6   r-  r  r   r5  r6  )rC   r:   rU  r  r;   	levelnamenelts	lastindexlasteltfirstreflastrefr>  rB  indexeltobjeltnameeltrefeltleafdictsubsectionsr5  r6  s   &&&&&                 r    ro  PDFOutlines.maketree  s   !I''(9(9:FJJ!OJ$tzz1I~ !UVV_%%LMMO$!G	'+++(#'#@#@ NN	5\E')F"M!*E2G''8F"%%!GGG!(C#d##C&&k.1+X{  %[)<.2mmHkSY.Z+v{ !WZ^_bZc!cdde"&x~~'7"8% 4E:FLFK#e$$): &}I "J ""k$%^adehai%ijje !VW^_bWc!cdds   =H H  H H=)rA  rB  r  rF  r>  r?  rY  rZ  r@  rT  r   rE  )r   NN)Nr   )r   r   r   r   r[   rT  r   rH  rF  r   rQ  rV  r3   rc  rf  r_  rI   ro  r   rU   rV   s   @r    rx   rx   @  sT     & "!NUGL#"J.#''
^6(5# 5#r   rx   c                   \        V \        4      '       d2   V w  r#\        VP                  4       4      w  w  rEV'       d	   WQ9   d   ^# \	        V 4      '       d1   . pV  F  pVP                  \        Wq4      4       K  	  \        V4      # ^# )zButility for outline: recursively count leaves in a tuple/list tree)r*   rG  r-  r  r   r0  r  sum)rL  rB  r  r  r5  r6  countsr  s   &&      r    r  r     sm    $u"&x~~/0%*T{{AMM%-. 6{r   z$ReportLab PDF Library - (opensource)c                   X   a  ] tR tRt o Rt]tRtRtRt	Rt
RtRtR tR	 tR
 tR tRtV tR# )r{   i  zPDF documents can have basic information embedded, viewable from
File | Document Info in Acrobat Reader.  If this is wrong, you get
Postscript errors while printing, even though it does not print.	anonymousuntitledunspecifiedr"  Nc                    R V n         R# )FalseNtrappedrR   s   &r    r   PDFInfo.__init__  s	    r   c                    V P                   V P                  V P                  V P                  3 F  pVP	                  \        V4      4       K  	  R # rG   )r  r  r  r#  ri   r   )rC   	md5objectr-   s   && r    r   PDFInfo.digest   s8    **dkk4<<GAWQZ( Hr   c                   / p\        V P                  4      VR &   \        V P                  4      VR&   \        VP                  V P
                  R7      ;VR&   VR&   \        V P                  4      VR&   \        V P                  4      VR&   \        V P                  4      VR&   \        V P                  4      VR&   \        V P                  4      VR	&   \        V4      pVP                  V4      # )
r5  Author)tsr(  ModDateCreationDateProducerCreatorSubjectKeywordsTrapped)ru   r  r  PDFDaterj   r'  r  r  r  r#  r  r  r}   r3   r[  s   &&  r    r3   PDFInfo.format%  s    tzz*'
,(+2h6I6IX\XkXk+ll)q(!$--0* .) .)!$--0*t||,)1yy""r   c                    V P                  4       pV P                  P                  4        F  w  r#\        WV4       K  	  V# )z'shallow copy - useful in pagecatchering)	__klass____dict__r  r  )rC   r   r   rS  s   &   r    r  PDFInfo.copy3  s6     MM'')DAEa  *r   r  )r   r   r   r   r[   r  r  r  r  r  r  r#  r'  r   r   r3   r  r   rU   rV   s   @r    r{   r{     sI     H !HGEFGHN)
# r   r{   c                   l   a  ] tR tRt o RtR]! R4      3.tRt]R,           tRR lt	R t
R tR tR	tV tR
# )
Annotationi;  zsuperclass for all annotations.r  Annotc                    VR,          p\        V4      '       g   \        V4      VR&   \        VR,          V4      VR&   V# )@transform dict args from python form to pdf string rep as neededRectr  )r   r3  ru   )rC   dr  r  s   &&& r    cvtdictAnnotation.cvtdictA  s:    yT{{ AfI!!J-7*r   c                   R V9   d   VR ,          pVR  M^p/ pV P                    F	  w  rEWSV&   K  	  VP                  V4       V P                   F  pWC9  g   K  \        RV R24      h	  V P	                  W2R7      pV P
                  pVP                  4        F/  pWF9  g   K  \        V P                  P                  : RV: 24      h	  \        V4      # )r  zkeyword argument z missing)r  z  bad annotation dictionary name )
r  ri   requiredr   r  	permittedr   r   r   r}   )rC   kwr  r  r   valr  s   &,     r    AnnotationDictAnnotation.AnnotationDictH  s    r>\F8F--JTdG (	MMD} #4TF(!CDD " LLL)NN	FFHD$ 4>>KbKbcg!hii  Qr   c                    \        R 4      h)zEDictString undefined for virtual superclass Annotation, must overloadr   rR   s   &r    DictAnnotation.Dict[  s    `aar   c                D    V P                  4       pVP                  V4      # rG   r  r3   rC   r:   rr  s   && r    r3   Annotation.format_  s    IIKxx!!r   r   N)r  r  r  r  )BorderCTMFHBSAAASPopupr  APr   )r   r   r   r   r[   r  r  r  r  r  r  r  r3   r   rU   rV   s   @r    r  r  ;  sJ     ))+,H6H O OI &b" "r   r  c                   R   a  ] tR tRt o ]P
                  R,           tR tR tRtV t	R# )FreeTextAnnotationic  c                6    Wn         W n        W0n        W@n        R # rG   )r  r  DAotherkw)rC   r  r  r  r  s   &&&&,r    r   FreeTextAnnotation.__init__e  s    	 r   c                    / pVP                  V P                  4       V P                  VR &   V P                  VR&   V P                  VR&   RVR&   V P
                  ! R/ VB # )r  r  r  z	/FreeTextr  r   )ri   r  r  r  r  r  rC   r  s   & r    r  FreeTextAnnotation.Dictj  s[    	II&	*''$")""'Q''r   )r  r  r  r  N)r  )
r   r   r   r   r  r  r   r  r   rU   rV   s   @r    r  r  c  s$     $$w.I
( (r   r  c                   \   a  ] tR tRt o ]P
                  R,           tRR ltR tR tRt	V t
R# )	LinkAnnotationis  c                B    W@n         Wn        W n        W0n        WPn        R # rG   )r  r  r  Destinationr  )rC   r  r  r  r  r  s   &&&&&,r    r   LinkAnnotation.__init__w  s    	 &r   c                    R # )z
          << /Type /Annot /Subtype /Link /Rect [71 717 190 734] /Border [16 16 1]
             /Dest [23 0 R /Fit] >>
             r   rR   s   &r    dummyDictStringLinkAnnotation.dummyDictString~  s    r   c                    / pVP                  V P                  4       V P                  VR &   V P                  VR&   V P                  VR&   RVR&   V P
                  VR&   V P                  ! R/ VB # )r  r  r  z/Linkr  r6  r   )ri   r  r  r  r  r  r  r  s   & r    r  LinkAnnotation.Dict  sj    	kk(II&	*)$$&	""'Q''r   )r  r  r  r  r  N)r6  r  PA)z[0 0 1])r   r   r   r   r  r  r   r  r  r   rU   rV   s   @r    r  r  s  s.     $$ ( I( (r   r  c                   j   a  ] tR tRt o Rt]P                  R,           t. R	O3R ltR
R ltR t	Rt
V tR# )HighlightAnnotationi  z
HighlightAnnotation is an annotation that highlights the selected area.

Rect is the mouseover area that will show the contents.

QuadPoints is a list of points to highlight, you can have many groups of
four QuadPoints to allow highlighting many lines.
c                B    Wn         W n        WPn        W0n        W@n        R # rG   )r  r  r  
QuadPointsColor)rC   r  r  r  r  r  s   &&&&&,r    r   HighlightAnnotation.__init__  s    	 $
r   c                   VR,          pVR,          pVR,          p\        V\        4      '       g    \        V4      P                  VRR7      VR&   \        V\        4      '       g    \        V4      P                  VRR7      VR&   \        V\        4      '       g    \        V4      P                  VRR7      VR&   \	        VR,          V4      VR&   V# )r  r  r  r  r  r  r  )r*   r+   r3  r3   ru   )rC   r  r  r  Quadr  s   &&&   r    r  HighlightAnnotation.cvtdict  s    y#$$$ --aT-:AfI$$$&tn33A43@AlO%%%e_++A4+8AcF!!J-8*r   c                    / pVP                  V P                  4       V P                  VR &   V P                  VR&   RVR&   V P                  VR&   V P
                  VR&   V P                  ! R/ VB # )r  r  z
/Highlightr  r  r  r   )ri   r  r  r  r  r  r  r  s   & r    r  HighlightAnnotation.Dict  sh    	II&	*#)//,#""'Q''r   )r  r  r  r  r  N)r  )g(\?g{Gz?gffffff?r  )r   r   r   r   r[   r  r  r   r  r  r   rU   rV   s   @r    r  r    s4      $$'77I9K ( (r   r  c                   R   a  ] tR tRt o ]P
                  R,           tR tR tRtV t	R# )TextAnnotationi  c           
         \         P                  ! V VV3R VP                  R R4      ;'       g    \        V4      RVP                  RR4      /VB  R# )r  Nr  )r   r   r   )r  r   r  rect_to_quad)rC   r  r  r  s   &&&,r    r   TextAnnotation.__init__  sY    $$T	 66,t4JJT8J	 ffWW-		
 	r   c                :    \         P                  V 4      pR VR&   V# )z/Textr  )r  r  r  s   & r    r  TextAnnotation.Dict  s     $$T*)r   r   N)OpenName)
r   r   r   r   r  r  r   r  r   rU   rV   s   @r    r  r    s)     #-- 1 I r   r  c           	         V ^ ,          V ^,          V ^,          V ^,          V ^ ,          V ^,          V ^,          V ^,          .# )z1
Utility method to convert a Rect to a QuadPoint
r   )r  s   &r    r  r    s@     GT!Wd1gtAwGT!Wd1gtAw0 0r   c                   ,   a  ] tR tRt o R tR tRtV tR# )PDFRectanglei  c                @    WW43w  V n         V n        V n        V n        R # rG   llxllyulxury)rC   r  r  urxr  s   &&&&&r    r   PDFRectangle.__init__  s    1431C.$(DHdhr   c                    \        V P                  V P                  V P                  V P                  .4      p\        W!4      # rG   )r3  r  r  r  r  r3   )rC   r:   r  s   && r    r3   PDFRectangle.format  s0    dhh$((DHH=>a""r   r  Nr]  rV   s   @r    r  r    s     D# #r   r  c                   6   a  ] tR tRt o RR ltR tR tRtV tR# )r  i  Nc                P    Vf   \        4       pV P                  V4       W n        R # rG   )r   _initr(  )rC   r  r(  s   &&&r    r   PDFDate.__init__  s    :B

2*r   c                l    VP                   V n        VP                  V n        VP                  V n        R # rG   )YMDhmsdatedhhdmm)rC   r  s   &&r    r  PDFDate._init  s#    II	6666r   c                ~   a  S P                   ;'       g    V 3R  lp\        \        V! S P                  !  4      V4      # )c           	      H   < R WW#WESP                   SP                  3,          # )z%D:%04d%02d%02d%02d%02d%02d%+03d'%02d')r  r  )yyyymmddhhmr  rC   s   &&&&&&r    <lambda> PDFDate.format.<locals>.<lambda>  s"    ;2TXXdhh?@r   )r(  r3   ru   r  )rC   r   dfmts   f& r    r3   PDFDate.format  s@    !! A A@ 	 idii 01377r   )r  r(  r  r  r  )	r   r   r   r   r   r  r3   r   rU   rV   s   @r    r  r    s     +
8 8r   r  c                   r   a  ] tR tRt o RtR;t;ttR tR tR t	R t
R tR	 tR
 tR tR tR tR tRtV tR# )r  i  a  

not a PDFObject!  This is a placeholder that can delegates
to a pdf object only after it has been defined by the methods
below.

EG a Destination can refer to Appendix A before it has been
defined, but only if Appendix A is explicitly noted as a destination
and resolved before the document is generated...

For example the following sequence causes resolution before doc generation.
    d = Destination()
    d.fit() # or other format defining method call
    d.setPage(p)
    (at present setPageRef is called on generation of the page).
Nc                .    Wn         R ;V n        V n        R # rG   )r   fmtr   rm  s   &&r    r   Destination.__init__   s    	##49r   c                    V P                   pVf   \        RV P                  ,          4      hV P                  pVf   \        RV P                  ,          4      hW2n        VP	                  V4      # )NzYformat not resolved, probably missing URL scheme or undefined destination target for '%s'zTPage not bound, probably missing URL scheme or undefined destination target for '%s')r  r   r   r   r3   )rC   r:   r<   ps   &&  r    r3   Destination.format  s    HH9J  (C  FJ  FO  FO  (O  P  PII9J'}  AE  AJ  AJ  (J  K  Kxx!!r   c                *    \        R WV4      V n        R # rG   )PDFDestinationXYZr  )rC   lefttopzooms   &&&&r    xyzDestination.xyz
  s    $T4d;r   c                &    \        R 4      V n        R # rG   )PDFDestinationFitr  rR   s   &r    fitDestination.fit  s    $T*r   c                &    \        R 4      V n        R # rG   )PDFDestinationFitBr  rR   s   &r    fitbDestination.fitb  s    %d+r   c                (    \        R V4      V n        R # rG   )PDFDestinationFitHr  rC   r  s   &&r    fithDestination.fith  s    %d3/r   c                (    \        R V4      V n        R # rG   )PDFDestinationFitVr  rC   r  s   &&r    fitvDestination.fitv  s    %dD1r   c                (    \        R V4      V n        R # rG   )PDFDestinationFitBHr  r(  s   &&r    fitbhDestination.fitbh  s    &tS1r   c                (    \        R V4      V n        R # rG   )PDFDestinationFitBVr  r-  s   &&r    fitbvDestination.fitbv  s    &tT2r   c                *    \        R WW44      V n        R # rG   )PDFDestinationFitRr  )rC   r  bottomrightr  s   &&&&&r    fitrDestination.fitr  s    %dD%Er   c                    Wn         R # rG   r   r  s   &&r    setPageDestination.setPage  rZ  r   )r  r   r   )r   r   r   r   r[   representationr3   r   r   r  r   r$  r)  r.  r2  r6  r<  r@  r   rU   rV   s   @r    r  r    sX       &*)N)Vd$"<+,0223F r   r  c                   0   a  ] tR tRt o RtR tR tRtV tR# )r  i  XYZc                6    Wn         W0n        W@n        W n        R # rG   )r   r  r  r  )rC   r   r  r  r  s   &&&&&r    r   PDFDestinationXYZ.__init__   s    			r   c                    VP                  V P                  4      p\        V\        V P                  4      V P
                  V P                  V P                  .4      p\        W14      # rG   )	r2   r   r3  r  typenamer  r  r  r3   rC   r:   pagerefr  s   &&  r    r3   PDFDestinationXYZ.format%  sK    $$TYY/!7DHHdiiY[a""r   )r  r   r  r  N	r   r   r   r   rH  r   r3   r   rU   rV   s   @r    r  r    s     H
# #r   r  c                   0   a  ] tR tRt o RtR tR tRtV tR# )r  i*  Fitc                    Wn         R # rG   r?  r  s   &&r    r   PDFDestinationFit.__init__,  rZ  r   c                    VP                  V P                  4      p\        V\        V P                  4      .4      p\        W14      # rG   )r2   r   r3  r  rH  r3   rI  s   &&  r    r3   PDFDestinationFit.format.  s9    $$TYY/!79;a""r   r?  NrL  rV   s   @r    r  r  *  s     H# #r   r  c                       ] tR tRtRtRtR# )r#  i3  FitBr   Nr   r   r   r   rH  r   r   r   r    r#  r#  3  s    Hr   r#  c                   0   a  ] tR tRt o RtR tR tRtV tR# )r'  i6  FitHc                    Wn         W n        R # rG   r   r  )rC   r   r  s   &&&r    r   PDFDestinationFitH.__init__8  s    	3(r   c                    VP                  V P                  4      p\        V\        V P                  4      V P
                  .4      p\        W14      # rG   )r2   r   r3  r  rH  r  r3   rI  s   &&  r    r3   PDFDestinationFitH.format:  s?    $$TYY/!7CEa""r   rY  NrL  rV   s   @r    r'  r'  6  s     H'# #r   r'  c                       ] tR tRtRtRtR# )r1  i?  FitBHr   NrU  r   r   r    r1  r1  ?      Hr   r1  c                   0   a  ] tR tRt o RtR tR tRtV tR# )r,  iB  FitVc                    Wn         W n        R # rG   )r   r  )rC   r   r  s   &&&r    r   PDFDestinationFitV.__init__D  s    	D)r   c                    VP                  V P                  4      p\        V\        V P                  4      V P
                  .4      p\        W14      # rG   )r2   r   r3  r  rH  r  r3   rI  s   &&  r    r3   PDFDestinationFitV.formatF  s?    $$TYY/!7DFa""r   )r  r   NrL  rV   s   @r    r,  r,  B  s     H)# #r   r,  c                       ] tR tRtRtRtR# )r5  iK  FitBVr   NrU  r   r   r    r5  r5  K  r_  r   r5  c                   0   a  ] tR tRt o RtR tR tRtV tR# )r9  iN  FitRc                B    Wn         W n        W0n        W@n        WPn        R # rG   )r   r  r:  r;  r  )rC   r   r  r:  r;  r  s   &&&&&&r    r   PDFDestinationFitR.__init__P  s    	D)f+jY\PXr   c                    VP                  V P                  4      p\        V\        V P                  4      V P
                  V P                  V P                  V P                  .4      p\        W14      # rG   )
r2   r   r3  r  rH  r  r:  r;  r  r3   rI  s   &&  r    r3   PDFDestinationFitR.formatR  sW    $$TYY/!7DKKQUQ[Q[]a]e]efha""r   )r:  r  r   r;  r  NrL  rV   s   @r    r9  r9  N  s     H]# #r   r9  c                      a ] tR tRt oRtR tRP                  4        U u. uF  p \        V 4      NK  	  up tRt	R t
R tR tR tR	 tR
 tRtVtR# u up i )r  i[  z7each element *could* be reset to a reference if desiredc           	         V P                    F  p\        WVP                  V/ 4      4       K!  	  V P                  4        R V9   d   VP                  R 4      V n        R# R# )ProcSetN)dict_attributesr  r  r  rp  )rC   kwdsr  s   &, r    r   PDFResourceDictionary.__init__]  sO    %%AD488Ab>* & 	((9-DL r   zPDF Text ImageB ImageC ImageIc                (    V P                   V n        R # rG   stdprocsrp  rR   s   &r    r  PDFResourceDictionary.allProcsg  s    }}r   c                6    V P                   R ,          V n        R# ):Nr  NNru  rR   s   &r    r   PDFResourceDictionary.basicProcsk  s    }}R(r   c                .    \        \        4      V n        R # rG   )r   r%   FontrR   s   &r    r   PDFResourceDictionary.basicFontsn  s    &z2	r   c                h    VP                  4        F  w  r#\        V4      V P                  V&   K  	  R # rG   )r  r   
ColorSpace)rC   
colorsUsedr  r  s   &&  r    r  #PDFResourceDictionary.setColorSpaceq  s*    ##%CA!3A!6DOOA &r   c                h    VP                  4        F  w  r#\        V4      V P                  V&   K  	  R # rG   )r  r   Shading)rC   shadingUsedr  r  s   &&  r    r   PDFResourceDictionary.setShadingu  s)    $$&CA03DLLO 'r   c                N   / pV P                    FC  p\        W4      p\        V\        4      '       d   V'       d   \	        V4      pWRV&   K=  K?  WBV&   KE  	  V P
                  pR p\        V4      '       d   V'       d   \        V4      pWRV&   MWBV&   \	        V4      p\        Wa4      # )rp  )	rq  r   r*   rf  r}   rp  r   r3  r3   )rC   r:   rr  dnamerS  dvr   s   &&     r    r3   PDFResourceDictionary.formaty  s    ))E$A!D!!&q)B!eH  % * LL88a[%eH1b##r   )r{  rp  N)r~  r  r  r{  Pattern
Propertiesr  )r   r   r   r   r[   r   r  r  rv  rq  r  r  r  r  r  r3   r   rU   )r  rW   s   0@r    r  r  [  sa     A. %D$I$I$KL$Kq
$KLHhO%)374$ $+ Ms   Ar  c                   v   a  ] tR tRt o Rt^tRP                  4       tRtRt	RP                  4       t
R tRtV tR	# )
PDFType1Fonti  z"no init: set attributes explicitlyzType Subtype BaseFont Namer{  Type1z;FirstChar LastChar Widths Encoding ToUnicode FontDescriptorc                $   / pV P                    F.  p\        W4      '       g   K  \        W4      p\        V4      W#&   K0  	  V P                   F%  p\        W4      '       g   K  \        W4      pWBV&   K'  	  \        V4      pVP                  V4      # rG   )name_attributesr1   r   r  local_attributesr}   r3   )rC   r:   rr  r   r  r:  s   &&    r    r3   PDFType1Font.format  s    ((Dt""+!%. ) ))Dt""+$ *
 1yy""r   r   N)r   r   r   r   r[   r#   r  r  r  r  r  r3   r   rU   rV   s   @r    r  r    s>     ,K288:ODGTZZ\# #r   r  c                       ] tR tRtRtRtR# )PDFTrueTypeFonti  TrueTyper   N)r   r   r   r   r  r   r   r   r    r  r    s    Gr   r  c                   \   a  ] tR tRt o R;t;t;t;t;t;t	t
^t^ tR tR tR tR tRtV tR# )rb  i  Nc                6    Wn         W n        W0n        W@n        R # rG   )lowerxloweryupperxuppery)rC   r  r  r  r  s   &&&&&r    r   PDFFormXObject.__init__  s    &kf+RXkr   c                j    \        V4      '       d   R P                  V4      p\        V4      V n        R# )r  N)r   r  r.   r  )rC   r   s   &&r    setStreamListPDFFormXObject.setStreamList  s#    ;;99T?Dor   c                    V P                   '       d    \        V P                   P                  4      # V P                  V P                  V P
                  V P                  .# )z4get the declared bounding box for the form as a list)BBoxr-  rg  r  r  r  r  rR   s   &r    rc  PDFFormXObject.BBoxList  s?    999		**++KKdkk4;;GGr   c                   V P                   ;'       g8    \        V P                  V P                  V P                  V P
                  .4      V n         V P                  ;'       g    \        . RO4      V n        V P                  '       g	   RV n        M\        R4      hV P                  '       gB   V P                  pV'       g   \        4       V n	        M\        4       pW#n        RVn        W0n	        V P                  '       gw   \!        4       pVP#                  4        V P$                  '       d   VP'                  4        MVP)                  4        V P*                  '       d   V P*                  Vn        W@n        V P.                  '       dC   \0        P2                  ;'       d    \4        \6        .;'       g    \6        .V P                  n        V P                  P:                  p\=        R4      VR&   \=        R4      VR&   ^VR&   V P                   VR	&   V P                  VR
&   V P                  VR&   V P                  P?                  V4      # )r   Nz-annotations don't work in PDFFormXObjects yetzxobject form streamr  r  Formr  FormTyper  Matrixr  )r   r   r   r   r   r   ) r  r3  r  r  r  r  r  r  r   r  r  rA  rd  r,  r$   r  r  r  r  r  r  r  r  r   r   r=  r>  r?  r-  re  r  r3   )rC   r:   r  r@  r  sdicts   &&    r    r3   PDFFormXObject.format  s   II__4;;T[[RVR]R]*^!_	kkAAX.@%A{{{DK LMM}}}[[F *K"	 5 !~~~-/I  "~~~""$$$&}}}$(MM	!$N$-$4$4$X$X/<9X$j$j]i\jDMM!((	*f"6?ij		f++h!^^k}}##H--r   )
r  r  r  r  r  r  r  r  r  r  )r   r   r   r   r  r  r  r  r  r  r  r  r   r   r  rc  r3   r   rU   rV   s   @r    rb  rb    sQ      IMLHLvLLvLL6IIKY&
H'. '.r   rb  c                   4   a  ] tR tRt o RtRR ltR tRtV tR# )PDFPostScriptXObjecti  z,For embedding PD (e.g. tray commands) in PDFNc                    Wn         R # rG   r,  )rC   r,  s   &&r    r   PDFPostScriptXObject.__init__  s    r   c                    \        4       pV P                  Vn        R Vn        VP                  p\	        R4      VR&   \	        R4      VR&   VP                  V4      # )zxobject postscript streamr  r  PSr  )rd  r,  r$   re  r  r3   )rC   r:   r@  r  s   &&  r    r3   PDFPostScriptXObject.format  sO    KLL	3	*f"4=ixx!!r   r  rG   )	r   r   r   r   r[   r   r3   r   rU   rV   s   @r    r  r    s     2" "r   r  RGB	DeviceRGBr  
DeviceGrayCMYK
DeviceCMYKc                   N   a  ] tR tRt o RR ltR tR tR tR tR t	R	 t
R
tV tR# )PDFImageXObjecti   Nc                   Wn         ^V n        ^V n        ^V n        RV n        \
        P                  ;'       d    R;'       g    RV n        RV n        W0n	        Vf   R# \        VR4      '       d   V P                  V4       R# ^ RIpVP                  P                  V4      ^,          P                  4       p\!        V4      p VR9   d   V P#                  V4      '       g:   \
        P                  '       d   V P%                  V4       MV P'                  V4       VP)                  4        R#   TP)                  4        i ; i)   r  z
            003B00 002700 002480 0E4940 114920 14B220 3CB650
            75FE88 17FF8C 175F14 1C07E2 3803C4 703182 F8EDFC
            B2BBC2 BB6F84 31BFC2 18EA3C 0E3E00 07FC00 03F800
            1E1800 1FF800>
            Njpeg_fh)r"  r   )z.jpgz.jpeg)r   widthheightbitsPerComponent
colorSpacer   r=  _filtersstreamContentmaskr1   loadImageFromSRCr   r  splitextlowerr   loadImageFromJPEGloadImageFromA85loadImageFromRawr   )rC   r   sourcer  r   extsrcs   &&&&   r    r   PDFImageXObject.__init__&  s    	
 !&!((??-?EE2 	>VI&&!!&) ''""6*1-335C'C//D4J4J34O4O '''--c2--c2				s   D- "D- 8#D- -D?c                B   . p\         P                  ! WR R7      pV'       g   V P                  V^ ,          4      # V Uu. uF  qDP                  4       NK  	  ppV^,          P	                  4       p\        V^,          4      \        V^,          4      uV n        V n        RRRRRR/V^,          ,          V n        ^V n	        RV n
        V'       d   V P                  V^ ,          4       MV P                  R8X  d   R	V n        R
P                  V^R 4      V n        R	# u upi )TIMG
detectJpeg/RGBr  /Gr  /CMYKr  r  Nr"  r"  r  rE  )r   makeA85Imager  r<  r  r8   r  r  r  r  r  _checkTransparencyr  r  r  )rC   r  r  	imagedatar  wordss   &&    r    r   PDFImageXObject.loadImageFromA85G  s    ))&DI	((Q00(12	1WWY		2!""$#&uQx=U1X
DK!+tL',WX]^_X`a !5''A/YYD	WWYq_5 3s   Dc                     \         P                  ! V4      pVP                  ^ 4       T^ ,          T^,          uT n        T n        ^T n        T^,          ^8X  d	   RT n        M$T^,          ^8X  d	   RT n        MRT n        ^T n        TP                  4       T n	        \        P                  '       d#   \        T P                  4      T n	        RT n        MRT n        RT n        R#   TP                  ^ 4       i ; i    R# ; i)	r   Fr  r  r  NT)r"  	DCTDecode)r  )r   readJPEGInfoseekr  r  r  r  _dotransr  r  r   r=  r   r  r  )rC   	imageFilerS   s   && r    r  !PDFImageXObject.loadImageFromJPEGV  s    	",,Y7q! #'q'47
DK !7a<*DO!W\)DO*DODM&^^-!243E3E!FD7DM(DM	' q!	s   C% C; %C88C; ;D c                   . p\         P                  ! WR R7      pV'       g   V P                  V^ ,          4      # V^,          P                  4       p\	        V^,          4      V n        \	        V^,          4      V n        RRRRRR/V^,          ,          V n        ^V n        RV n	        V'       d   V P                  V^ ,          4       MV P                  R8X  d   R	V n        R
P                  V^R 4      V n        R	# )Tr  r  r  r  r  r  r  r  Nr   r  rE  )r   makeRawImager  r  r8   r  r  r  r  r  r  r  r  r  )rC   r  r  r  r  s   &&   r    r   PDFImageXObject.loadImageFromRawp  s    ))&DI	((Q00!""$q]
%(m!+tL',WX]^_X`a !&''A/YYD	 XXi"o6r   c                   V P                   R 8X  d   VP                  '       d[   RV n         \        \        VP                  P	                  4       4      VP                  RR7      V n        ^ ^.V P
                  n        R# VP                  4       pV'       d:   V^ ,          V^ ,          V^,          V^,          V^,          V^,          3V n         R# RV n         R# \        V P                   R4      '       dT   V P                   P                  4       pV^ ,          V^ ,          V^,          V^,          V^,          V^,          3V n         R# R# )r  N)r  rgb)
r  _dataAr  r
   
getRGBData_smask_decodegetTransparentr1   r  )rC   imtcr  s   &&  r    r  "PDFImageXObject._checkTransparency  s    99fyyy 	-i		8L8L8N.OPRPYPY_cd'(e#&&(!#A1r!ubeRUBqE JDI $DITYYu%%		A!QqT!A$qtAaD15DI &r   c                   VP                  4       pV'       d   V P                  V4       R# VP                  4       w  V n        V n        VP                  4       p\        P                  ! V4      V n        \        P                  '       d#   \        V P                  4      V n        RV n        MRV n        \        VP                  ,          V n        ^V n        V P#                  V4       R# )z%Extracts the stream, width and heightNr  r  )r  r  getSizer  r  r  r  r  r  r   r=  r   r  _mode2CSr  r  r  r  )rC   r  fpr   s   &&  r    r   PDFImageXObject.loadImageFromSRC  s    ZZ\""2&&(jjl#DJ--/C!%s!3D%6t7I7I%J" = .%bgg.DO$%D!##B'r   c                   \        V P                  R 7      pVP                  p\        R4      VR&   \        R4      VR&   V P                  VR&   V P
                  VR&   V P                  VR&   \        V P                  4      VR&   V P                  R	8X  d%   \        V R
^ 4      '       d   \        . RO4      VR&   M+\        V RR4      '       d   \        V P                  4      VR&   \        \        \        V P                  4      4      VR&   \        V P                  4      VR&   V P                  '       d   \        V P                  4      VR&   \        V RR4      '       d   V P                  VR&   VP!                  V4      # )r  r  r  Imager  WidthHeightBitsPerComponentr~  r  r  Decoder  Nr0  r1  MasksmaskSMask)r   r   r   r   r   r   r   r   )rd  r  re  r  r  r  r  r  r   r3  r  r  r  rA  r  r  r3   )rC   r:   r@  rf  s   &&  r    r3   PDFImageXObject.format  s0    2 23||y)V!'*Y

WX#'#8#8 $T__5\??L(WT*Q-G-G%&78DNT)D))%dll3DN!#gdmm"<=XT//0X999Xdii%8d6l4%%tzztG}xx!!r   )
r  r  r  r  r  r  r  r   r  r  r  )r   r   r   r   r   r  r  r  r  r  r3   r   rU   rV   s   @r    r  r     s.     B6476 (&" "r   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )r  i  c                    ^ RI Hp \        W4      '       g'   \        RV P                  P
                  ,          4      hVP                  '       g'   \        RV P                  P
                  ,          4      hWn        R# )r   )	CMYKColorz%s needs a CMYKColor argumentz-%s needs a CMYKColor argument with a spotNameN)reportlab.lib.colorsr  r*   r   r   r   r   r  )rC   r  r  s   && r    r   PDFSeparationCMYKColor.__init__  sT    2$))<t~~?V?VVWWLt~~OfOffgg	r   c                   . P                   p\        V P                  P                  4       4       F  w  r#\        V4      pV^8X  d5   VR8X  d   V! R4       V! R4       K0  V! \	        V4      4       V! R4       KK  V^ 8X  d
   V! R4       M!V! R4       V! \	        V4      4       V! R4       V! R4       K  	  RRP                  VP                  4      ,          # )	zhcreate the postscript code for the tint transfer function
effectively this is tint*c, tint*y, ... tint*k        r  z0.0muldupexchz{%s}r  )r0  r  r  r7   r+   r  __self__)rC   rw  r  rS  s   &   r    _makeFuncPS"PDFSeparationCMYKColor._makeFuncPS  s     IITYY^^-.CAAhA!tc6eHeHc!fIeHa4eHeHc!fIeH&	! /" !**-..r   c                    \        \        R 4      \        V P                  P                  4      \        R4      \	        \        \        ^\        R4      \        R4      R7      4      V P                  4       RR7      34      # )
Separationr  )FunctionTypeDomainRangeN)re  r,  r-  )r   r   )r   r   r   r   r   r   r   r   )rK  r  r  r   rd  r}   rf  r  rR   s   &r    r  PDFSeparationCMYKColor.value  sr    L)DII../L)#0)*#25#9"12C"D2 $
 !% 0 0 2 $	   	r   )r  N)	r   r   r   r   r   r  r  r   rU   rV   s   @r    r  r    s     /. r   r  c                   P   a  ] tR tRt o Rt. tRt]R	,           tR tR t	R t
RtV tR# )
PDFFunctioni  z"superclass for all function types.c                <   / pV P                    F	  w  r4WBV&   K  	  VP                  V4       V P                   F  pW29  g   K  \        R V,          4      h	  V P                  pVP                  4        F  pW59  g   K  \        RV,          4      h	  \        V4      # zkeyword argument %s missingz!bad annotation dictionary name %s)r  ri   r  r   r  r   r}   )rC   r  r  r   r  r  s   &,    r    FunctionDictPDFFunction.FunctionDict  s    --JTdG (	MMD} !>!EFF " NN	FFHD$ !Dt!KLL  Qr   c                    \        R 4      hz?Dict undefined for virtual superclass PDFShading, must overloadr  rH   s   &&r    r  PDFFunction.Dict      Z[[r   c                F    V P                  V4      pVP                  V4      # rG   r  r  s   && r    r3   PDFFunction.format      IIhxx!!r   r   N)r  r  )r  )r   r   r   r   r[   r  r  r  r  r  r3   r   rU   rV   s   @r    r  r    s1     ,H)H#I \
" "r   r  c                      a  ] tR tRt o ]P
                  R]! R4      3.,           t]P                  R,           t]P                  R	,           tR t	R t
RtV tR# )
PDFExponentialFunctioni	  r  c                6    Wn         W n        W0n        W@n        R # rG   C0C1Nr  )rC   r   r!  r"  r  s   &&&&,r    r   PDFExponentialFunction.__init__	  s    r   c                    / pVP                  V P                  4       ^VR&   \        V P                  4      VR&   \        V P                  4      VR&   V P
                  VR&   V P                  ! R/ VB # )r  r  r   r!  r"  r   )ri   r  rK  r   r!  r"  r  rC   r:   r  s   && r    r  PDFExponentialFunction.Dict
	  sf    	.!$''*$!$''*$#  %1%%r   r  N)r  g      ?)r"  )r   r!  r"  )r   r   r   r   r  r  rK  r  r  r   r  r   rU   rV   s   @r    r  r  	  sR     ##/*2M'N&OOH##f,H%%(99I
& &r   r  c                   x   a  ] tR tRt o ]P
                  R,           t]P                  R,           tR tR tRt	V t
R# )PDFStitchingFunctioni	  c                6    Wn         W n        W0n        W@n        R # rG   )	FunctionsBoundsEncoder  )rC   r*  r+  r,  r  s   &&&&,r    r   PDFStitchingFunction.__init__	  s    "r   c                @   / pVP                  V P                  4       ^VR&   \        V P                   Uu. uF  q1P	                  V4      NK  	  up4      VR&   \        V P
                  4      VR&   \        V P                  4      VR&   V P                  ! R/ VB # u upi )   r  r*  r+  r,  r   )ri   r  r3  r*  r2   r+  r,  r  )rC   r:   r  r-   s   &&  r    r  PDFStitchingFunction.Dict	  s    	.!$.."Q.Q#5#5a#8."QR+t{{+(t{{+(  %1%% #Rs   B)r+  r,  r*  r  N)r*  r+  r,  )r   r   r   r   r  r  r  r   r  r   rU   rV   s   @r    r(  r(  	  s6     ##&GGH%%(III
& &r   r(  c                   L   a  ] tR tRt o RtRt]R	,           tR tR tR t	Rt
V tR# )

PDFShadingi$	  z!superclass for all shading types.c                
   / pVP                  V4       V P                   F  pW29  g   K  \        R V,          4      h	  V P                  pVP	                  4        F  pW49  g   K  \        RV,          4      h	  \        V4      # r  )ri   r  r   r  r   r}   )rC   r  r  r   r  s   &,   r    ShadingDictPDFShading.ShadingDict(	  su    	MMD} !>!EFF " NN	FFHD$ !Dt!KLL  Qr   c                    \        R 4      hr  r  rH   s   &&r    r  PDFShading.Dict4	  r  r   c                F    V P                  V4      pVP                  V4      # rG   r  r  s   && r    r3   PDFShading.format9	  r  r   r   N)ShadingTyper~  )
Backgroundr  	AntiAlias)r   r   r   r   r[   r  r  r4  r  r3   r   rU   rV   s   @r    r2  r2  $	  s-     +,H<<I
 \
" "r   r2  c                   x   a  ] tR tRt o ]P
                  R,           t]P                  R,           tR tR tRt	V t
R# )PDFFunctionShadingi=	  c                *    Wn         W n        W0n        R # rG   )Functionr~  r  )rC   r@  r~  r  s   &&&,r    r   PDFFunctionShading.__init__@	  s     $r   c                    / pVP                  V P                  4       ^VR&   \        V P                  4      VR&   VP	                  V P
                  4      VR&   V P                  ! R/ VB # )r   r:  r~  r@  r   )ri   r  r  r~  r2   r@  r4  r%  s   && r    r  PDFFunctionShading.DictD	  s_    	-!$//2, **4==9*$!$$r   )r~  r@  r  N)r@  )r  r  r@  r   r   r   r   r2  r  r  r   r  r   rU   rV   s   @r    r>  r>  =	  s5     ""]2H$$'GGI% %r   r>  c                   x   a  ] tR tRt o ]P
                  R,           t]P                  R,           tR tR tRt	V t
R# )PDFAxialShadingiL	  c                <    WW43V n         WPn        W`n        Wpn        R # rG   Coordsr@  r~  r  )rC   x0y0x1y1r@  r~  r  s   &&&&&&&,r    r   PDFAxialShading.__init__P	  s    r& $r   c                   / pVP                  V P                  4       ^VR&   \        V P                  4      VR&   \	        V P
                  4      VR&   VP                  V P                  4      VR&   V P                  ! R/ VB # )r  r:  r~  rI  r@  r   	ri   r  r  r~  rK  rI  r2   r@  r4  r%  s   && r    r  PDFAxialShading.DictU	  q    	-!$//2,%dkk2( **4==9*$!$$r   r~  rI  r@  r  NrI  r@  rI  r  r@  ExtendrD  rV   s   @r    rF  rF  L	  :     ""%;;H$$ (6 6I
% %r   rF  c                   x   a  ] tR tRt o ]P
                  R,           t]P                  R,           tR tR tRt	V t
R# )PDFRadialShadingi^	  c	                >    WW4WV3V n         Wpn        Wn        Wn        R # rG   rH  )
rC   rJ  rK  r0rL  rM  r1r@  r~  r  s
   &&&&&&&&&,r    r   PDFRadialShading.__init__b	  s    rr. $r   c                   / pVP                  V P                  4       ^VR&   \        V P                  4      VR&   \	        V P
                  4      VR&   VP                  V P                  4      VR&   V P                  ! R/ VB # )r/  r:  r~  rI  r@  r   rP  r%  s   && r    r  PDFRadialShading.Dictg	  rR  r   rS  NrT  rU  rD  rV   s   @r    rY  rY  ^	  rW  r   rY  __main__z-There is no script interpretation for pdfdoc.)r   r/  )r      )r   rG   )__version__r[   r  r  r  collectionsr   r.  r   	reportlabr   r   r   r   r   r   r	   r
   r   r   r   r   reportlab.lib.rl_accelr   r   r   r   r   hashlibr   sysr   	Exceptionr   r"   r#   r$   r%   r&   r  rf  r   r.   r3   r?   formNamerA   r0   rZ   r^   PDFtruePDFfalsePDFnullr   r  recompiler  r  r  ru   chrr  r}   r  r  r  r  r  r?  r!  r>  rd  rA  r;  r3  rK  r?  r   r=  rj  rB  rD  r  rp   rs   r  r  r  r  r-  r1  rw   r3  rx   r  r  r{   r  r  r  r  r  r  r  r  r  r  r  r#  r'  r1  r,  r5  r9  r  r  r  rb  r  r  r  r  r  r  r(  r2  r>  rF  rY  r   r   r   r   r    <module>rp     s]   	   # &  P  P  P Z Z (  	y 	 &    
 	   ='4'  	 	y 
`() `(F 
%i % 


7#	G*	 G*R IT + I + Z /4= 4%9 (( ( ()	' 	' ./(2	 (2T	 
!y !.h 	 k k&i &<#-) #-J&Y &  6') ':3 3j z  0T4j T4n	Y 	&1J &1PH: HV
$9 $# #~#) ~#@  ; 'i 'T&" &"P( ( (Z (6((* ((T( 0#9 #8i 8(-) -`
#	 
##	 #* # #, # #, # #1$I 1$r#9 #4l F>.Y >.@"9 " Svl	CS"i S"j. .`") "8&[ &$&; &"" "2% %%j %$%z %$ Z	
9: r   