Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 CøªjÁ=ã@s”dZddlZddlZddlmZdZZdd„ZGdd„dƒZGd d „d ee ƒZ Gd d „d eƒZ Gd d„deƒZ Gdd„dee ƒZGdd„dƒZdS)z A low-level PDF generator. éN)Ú BOM_UTF16_BEz0.1.2cCsxt|tƒr|St|tƒr|jSt|tƒrR|jƒrBt|ƒd›jdƒS|d›jdƒSnt|tƒrj|d›jdƒSt|ƒjdƒS)zConvert item to bytes.ÚdÚasciiÚf) Ú isinstanceÚbytesÚObjectÚdataÚfloatÚ is_integerÚintÚencodeÚstr)Úitem©rú//tmp/pip-build-_d5lkt3n/pydyf/pydyf/__init__.pyÚ _to_bytes s    rc@s<eZdZdZdd„Zedd„ƒZedd„ƒZedd „ƒZd S) rzBase class for PDF objects.cCsd|_d|_d|_d|_dS)NrÚn)ÚnumberÚoffsetÚ generationÚfree)ÚselfrrrÚ__init__szObject.__init__cCs2djt|jƒjƒdt|jƒjƒd|jdfƒS)z%Indirect representation of an object.ó ó s objsendobj)Újoinrrr rr )rrrrÚindirect*s"zObject.indirectcCs$t|jƒjƒdt|jƒjƒdS)zObject identifier.rs R)rrr r)rrrrÚ reference4szObject.referencecCs tƒ‚dS)z@Data contained in the object. Shall be defined in each subclass.N)ÚNotImplementedError)rrrrr ;sz Object.dataN) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚpropertyrrr rrrrrs  rc@s&eZdZdZddd„Zedd„ƒZdS)Ú DictionaryzWPDF Dictionary object. Inherits from :class:`Object` and Python :obj:`dict`. NcCstj|ƒtj||piƒdS)N)rrÚdict)rÚvaluesrrrrGs zDictionary.__init__cCsNdg}x2|jƒD]&\}}|jdt|ƒdt|ƒƒqW|jdƒdj|ƒS)Ns<<ó/rs>>r)ÚitemsÚappendrr)rÚresultÚkeyÚvaluerrrr Ks " zDictionary.data)N)r r!r"r#rr$r rrrrr%As r%csLeZdZdZdL‡fdd„ Zdd„ZdMdd „Zd d „ZdNd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„ZdOdd„ZdPdd„ZdQdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„ZdRd,d-„ZdSd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Zd:d;„Zdd?„Z!d@dA„Z"dBdC„Z#dDdE„Z$dFdG„Z%dHdI„Z&e'dJdK„ƒZ(‡Z)S)TÚStreamzr?rBrCrrrÚ curve_end_to›s  zStream.curve_end_tocCs|jjdt|ƒdƒdS)zDraw object given by reference.r(s DoN)r0r*r)rrrrrÚ draw_x_object¦szStream.draw_x_objectcCs|jjdƒdS)z%End path without filling or stroking.ónN)r0r*)rrrrÚendªsz Stream.endcCs|jjdƒdS)zEnd text object.sETN)r0r*)rrrrÚend_text®szStream.end_textcCs|jj|rdndƒdS)znFill path using nonzero winding rule. Use even-odd rule if ``even_odd`` is set to ``True``. sf*ófN)r0r*)rr6rrrÚfill²sz Stream.fillcCs|jj|rdndƒdS)zyFill and stroke path usign nonzero winding rule. Use even-odd rule if ``even_odd`` is set to ``True``. sB*óBN)r0r*)rr6rrrÚfill_and_strokeºszStream.fill_and_strokecCs|jj|rdndƒdS)z€Fill, stroke and close path using nonzero winding rule. Use even-odd rule if ``even_odd`` is set to ``True``. sb*óbN)r0r*)rr6rrrÚfill_stroke_and_closeÂszStream.fill_stroke_and_closecCs$|jjdjt|ƒt|ƒdfƒƒdS)z0Add line from current point to point ``(x, y)``.rólN)r0r*rr)rÚxÚyrrrÚline_toÊszStream.line_tocCs$|jjdjt|ƒt|ƒdfƒƒdS)z8Begin new subpath by moving current point to ``(x, y)``.rómN)r0r*rr)rrTrUrrrÚmove_toÎszStream.move_tocCs|jjdt|ƒdƒdS)z@Paint shape and color shading using shading dictionary ``name``.r(s shN)r0r*r)rÚnamerrrÚshadingÒszStream.shadingcCs|jjdƒdS)zRestore graphic state.óQN)r0r*)rrrrÚ pop_stateÖszStream.pop_statecCs|jjdƒdS)zSave graphic state.óqN)r0r*)rrrrÚ push_stateÚszStream.push_statecCs0|jjdjt|ƒt|ƒt|ƒt|ƒdfƒƒdS)z–Add rectangle to current path as complete subpath. ``(x, y)`` is the lower-left corner and width and height the dimensions. rsreN)r0r*rr)rrTrUÚwidthÚheightrrrÚ rectangleÞs  zStream.rectanglecCs2|jjdjt|ƒt|ƒt|ƒ|r$dndfƒƒdS)z”Set RGB color for nonstroking operations. Set RGB color for stroking operations instead if ``stroke`` is set to ``True``. rsRGsrgN)r0r*rr)rÚrÚgÚbr;rrrÚ set_color_rgbés zStream.set_color_rgbcCs(|jjdt|ƒd|rdndƒdS)z{Set color for nonstroking operations. Set color for stroking operation if ``stroke`` is set to ``True``. r(rsSCNsscnN)r0r*r)rrYr;rrrÚset_color_specialôszStream.set_color_specialcCs&|jjdjt|ƒjt|ƒdfƒƒdS)zÊSet dash line pattern. :param dash_array: Dash pattern. :type dash_array: :term:`iterable` :param dash_phase: Start of dash phase. :type dash_phase: :obj:`int` ródN)r0r*rÚArrayr r)rZ dash_arrayZ dash_phaserrrÚset_dashýs zStream.set_dashcCs(|jjdt|ƒdt|ƒdƒdS)zSet font name and size.r(rs TfN)r0r*r)rÚfontÚsizerrrÚ set_font_size szStream.set_font_sizecCs|jjt|ƒdƒdS)zSet text rendering mode.s TrN)r0r*r)rÚmoderrrÚset_text_renderingszStream.set_text_renderingcCs|jjt|ƒdƒdS)zSet line cap style.s JN)r0r*r)rZline_caprrrÚ set_line_capszStream.set_line_capcCs|jjt|ƒdƒdS)zSet line join style.s jN)r0r*r)rZ line_joinrrrÚ set_line_joinszStream.set_line_joincCs|jjt|ƒdƒdS)zSet line width.s wN)r0r*r)rr_rrrÚset_line_widthszStream.set_line_widthcCs|jjt|ƒdƒdS)zSet miter limit.s MN)r0r*r)rZ miter_limitrrrÚset_miter_limitszStream.set_miter_limitcCs|jjdt|ƒdƒdS)zkSet specified parameters in graphic state. :param state_name: Name of the graphic state. r(s gsN)r0r*r)rZ state_namerrrÚ set_state"szStream.set_statecCs|jjdt|ƒdƒdS)z Show text.ó[s] TJN)r0r*r)rÚtextrrrÚ show_text*szStream.show_textcCs|jjdƒdS)z Stroke path.óSN)r0r*)rrrrr;.sz Stream.strokecCs|jjdƒdS)zStroke and close path.ósN)r0r*)rrrrÚstroke_and_close2szStream.stroke_and_closec Cs<|jjdjt|ƒt|ƒt|ƒt|ƒt|ƒt|ƒdfƒƒdS)apSet text matrix and text line matrix. :param a: Top left number in the matrix. :type a: :obj:`int` or :obj:`float` :param b: Top middle number in the matrix. :type b: :obj:`int` or :obj:`float` :param c: Middle left number in the matrix. :type c: :obj:`int` or :obj:`float` :param d: Middle middle number in the matrix. :type d: :obj:`int` or :obj:`float` :param e: Bottom left number in the matrix. :type e: :obj:`int` or :obj:`float` :param f: Bottom middle number in the matrix. :type f: :obj:`int` or :obj:`float` rsTmN)r0r*rr)rÚardÚcrÚerrrrÚ text_matrix6s zStream.text_matrixc Cs<|jjdjt|ƒt|ƒt|ƒt|ƒt|ƒt|ƒdfƒƒdS)apModify current transformation matrix. :param a: Top left number in the matrix. :type a: :obj:`int` or :obj:`float` :param b: Top middle number in the matrix. :type b: :obj:`int` or :obj:`float` :param c: Middle left number in the matrix. :type c: :obj:`int` or :obj:`float` :param d: Middle middle number in the matrix. :type d: :obj:`int` or :obj:`float` :param e: Bottom left number in the matrix. :type e: :obj:`int` or :obj:`float` :param f: Bottom middle number in the matrix. :type f: :obj:`int` or :obj:`float` rscmN)r0r*rr)rrzrdr{rr|rrrrÚ transformKs zStream.transformcCspdjdd„|jDƒƒ}t|jjƒƒ}|jrPd|d<tjƒ}|j|ƒ}||jƒ7}t |ƒ|d<dj|j d|dfƒS) Nrcss|]}t|ƒVqdS)N)r)Ú.0rrrrú bszStream.data..z /FlateDecodeÚFilterZLengthsstreams endstream) rr0r%r1Úcopyr2ÚzlibÚ compressobjÚflushÚlenr )rr0r1r„rrrr `s   z Stream.data)NNF)F)F)F)F)F)F)F)*r r!r"r#rr4r7r9r<rDrFrHrIrKrLrNrPrRrVrXrZr\r^rarerfrirlrnrorprqrrrsrvr;ryr}r~r$r Ú __classcell__rr)r3rr.TsJ           r.cs.eZdZdZd‡fdd„ Zedd„ƒZ‡ZS)ÚStringz) ÚreÚsubrrŠÚUnicodeEncodeErrorrrr Úhex)rÚescapedÚencodedrrrr xs  z String.data)r‰)r r!r"r#rr$r r‡rr)r3rrˆmsrˆc@s&eZdZdZddd„Zedd„ƒZdS)rhzRPDF Array object. Inherits from :class:`Object` and Python :obj:`list`. NcCstj|ƒtj||pgƒdS)N)rrÚlist)rÚarrayrrrrŒs zArray.__init__cCs6dg}x|D]}|jt|ƒƒq W|jdƒdj|ƒS)Nrtó]r)r*rr)rr+Úchildrrrr �s   z Array.data)N)r r!r"r#rr$r rrrrrh†s rhc@s8eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd S) ÚPDFz PDF document.cCsŠg|_tƒ}d|_d|_|j|ƒtdtgƒddœƒ|_|j|jƒtiƒ|_|j|jƒtd|jj dœƒ|_ |j|j ƒd|_ d|_ dS)Niÿÿrz/Pagesr)ÚTypeÚKidsÚCountz/Catalog)ršZPages) ÚobjectsrrrÚ add_objectr%rhÚpagesÚinforÚcatalogÚcurrent_positionÚ xref_position)rZ zero_objectrrrr›s$      z PDF.__init__cCs8|jdd7<|j|ƒ|jdj|jddgƒdS)zfAdd page to the PDF. :param page: New page. :type page: :class:`Dictionary` rœér›rÚRN)rŸržÚextendr)rÚpagerrrÚadd_page¼s z PDF.add_pagecCst|jƒ|_|jj|ƒdS)zAdd object to the PDF.N)r†r�rr*)rÚobject_rrrržÇs zPDF.add_objectcCs(|jt|ƒd7_|j|dƒdS)zÅWrite line to output. :param content: Content to write. :type content: :obj:`bytes` :param output: Output stream. :type output: binary :term:`file object` r¤rN)r¢r†Úwrite)rÚcontentÚoutputrrrÚ write_lineÌs zPDF.write_linecCsN|jd|ƒ|jd|ƒx0|jD]&}|jdkr0q |j|_|j|j|ƒq W|j|_|jd|ƒ|jdt|jƒ›�jƒ|ƒx:|jD]0}|j|jd›d|j d›d|j›d�jƒ|ƒq‚W|jd |ƒ|jd |ƒ|jd t|jƒ›�jƒ|ƒ|jd |j j |ƒ|jd |j j |ƒ|jd|ƒ|jd|ƒ|j|j›jƒ|ƒ|jd|ƒdS)zvWrite PDF to output. :param output: Output stream. :type output: binary :term:`file object` s%PDF-1.7s%🖤rsxrefz0 Z010ú Z05strailers<>s startxrefs%%EOFN) r­r�rr¢rrr£r†r rr¡rr )rr¬r©rrrrªØs.      "     z PDF.writeN) r r!r"r#rr¨ržr­rªrrrrr™™s !  r™)r#r�rƒÚcodecsrÚVERSIONÚ __version__rrr&r%r.rˆr•rhr™rrrrÚs $