� J�gy_���dZdZdZdZddlZddlZddlZddlZddlZddl m Z ddl m Z dd l mZd �Zd �ZGd �d ��ZGd�de��ZdS)z PDF Template Helpers for fpdf.pyz%Mariano Reingart <reingart@gmail.com>z#Copyright (C) 2010 Mariano ReingartzLGPL 3.0�N�)�get_stack_level)� FPDFException)�FPDFc�$�|dz|dzdz|dzfS)Ni��)�cols �]/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fpdf/template.py�_rgbr s �� �5�L�C�3�J��,��c� � :�:�c��t|��\}}}|dkr |dkr|dks|dkr |dz d�d�S|dz d�d|dz d�d|dz d�d�S)Nr�������z.3fz g� z rg)r )r �r�g�bs r � _rgb_as_strrs~���3�i�i�G�A�q�!� �Q���1��6�6�a�1�f�f��b����c�'�!�!�!�!�!��#�g� :� :� :�A��G� :� :� :�!�c�'� :� :� :� :�:r c��eZdZdZd/d�Zd�Zed���Zed���Zd0de j d e fd �Z d1de j d e de d e fd�Z d�ZeZd�Zd�Zd�Zddddddddddddddddd�d�Zdddddddd�d�Zddddddddd�d �Zddddddddd�d!�Zdddddd"�d#�Zdddddd$d%ddd&� d'�Zddddd(ddddddd)� d*�Zdddddddddddddd+� d,�Zd2d.�ZdS)3� FlexTemplatez� A flexible templating class. Allows to apply one or several template definitions to any page of a document in any combination. Nc ��t|t��std���||_d|_|r|�|��|j|j|j|j |j |j |j |j d�|_i|_dS)a= Arguments: pdf (fpdf.FPDF() instance): All content will be added to this object. elements (list of dicts): A template definition in a list of dicts. If you omit this, then you need to call either load_elements() or parse_csv() before doing anything else. z('pdf' must be an instance of fpdf.FPDF()N)�T�L�I�B�E�BC�C39�W)� isinstancer� TypeError�pdf� splitting_pdf� load_elements�_text�_line�_image�_rect�_ellipse�_barcode�_code39�_write�handlers�texts)�selfr#�elementss r �__init__zFlexTemplate.__init__!s����#�t�$�$� H��F�G�G� G����!��� � )� � � �x� (� (� (������������-��<���  �  �� ��� � � r c ��idttd��f�dttd��f�dttf�dttf�dttf�dttf�dttd��f�d ttf�d t�d t�d t�d t�dt�dttd��f�dttd��f�dt�dt td��f�ttfttd��fd��}||_g|_|D�]�}d|vrd|d<dD]p}||vrj|ddkrK|dkrd|vr |d|d<�(|dkrd|vr |d|d<�>|dkrd|vr|d|dz|d<�]td|�d�����qd|vr|ddvrd|d<ntd���d |vr|ddkrd|vr |d|d <|� ��D]�\}}||vr�t|||��slt|t��r|j nd� d �|D����}td!|�d"|�d#t||��j �d$������|j�|d��������dS)%z� Load a template definition. Arguments: elements (list of dicts): A template definition in a list of dicts �nameN�type�x1�y1�x2�y2�font�size�bold�italic� underline� foreground� background�align�text�priority� multiline)�rotate�wrapmoder)r4r5r6r7r9r�x�y�hzMandatory key 'z' missing in input data�rrz(Mandatory key 'x2' missing in input data�wz or c�$�g|] }d|j�d���S)�')�__name__)�.0rGs r � <listcomp>z.FlexTemplate.load_elements.<locals>.<listcomp>~s&��)G�)G�)G��*;�a�j�*;�*;�*;�)G�)G�)Gr zValue of element item 'z ' must be z, not '�'.)�strr5�int�float�object�boolr1�keys�KeyError�itemsr!rN�joinr"�append�lower)r0r1� key_config�e�k�t�ttypes r r%zFlexTemplate.load_elements;s��� � �S�$�t�*�*�%� � �S�$�t�*�*�%� � �3��,�  � �3��,�  � �3��,�  � �3��,� � �S�$�t�*�*�%� � �S�%�L� � �F� � �f� � �� � �#� � �#� � �c�4��:�:�&� � �S�$�t�*�*�%�! �" ��# �$ �$��T� � �+�% �&�E�l��d�4�j�j�)�) � � � �.!�� ��� ��' 0�' 0�A���?�?� !��*� �7� Q� Q���A�:�:���y�E�)�)���9�9�����&'��f�A�d�G�$���9�9�����&'��f�A�d�G�$���9�9�����&'��g��#��&6�A�d�G�$�"�#O�Q�#O�#O�#O�P�P�P�� �1�}�}��V�9� �-�-��A�d�G�G�"�#M�N�N�N��Q�;�;�1�V�9��#5�#5��!�8�8� !�#��A�f�I�"�(�(�*�*� � ���1���6�6�*�Q�q�T�1�"5�"5�6�&�a��.�.�I�� � �#�[�[�)G�)G�Q�)G�)G�)G�H�H�� $�d�!�d�d�u�d�d�T�RS�TU�RV�Z�Z�M`�d�d�d����� �I� � �Q�v�Y�_�_�.�.� /� /� /� /�O' 0�' 0r c��|dd�dvrt|d��S|ddkrt|d��St|��S)z#Allow hex and oct values for colorsN�)�0x�0X�r�0��rS)�ss r �_parse_colorcodezFlexTemplate._parse_colorcode�sK�� �R�a�R�5�L� � ��q�"�:�:� � �Q�4�3�;�;��q�!�9�9� ��1�v�v� r c�D�t|��}|dkrdS|dkrdSdS)NrTFri)rj�is r �_parse_multilinezFlexTemplate._parse_multiline�s.�� ��F�F�� �q�5�5��4� �q�5�5��5��tr �utf-8�infile�encodingc��t||���5}tj|��}|D]�}|�d��}|rgt |t ��rR|����d��rt|dd�d��|d<ntd���|�d��}|rgt |t ��rR|����d��rt|dd�d��|d<��td �����|� |��ddd��dS#1swxYwYdS) a� Load the template definition from a JSON file. The data must be structured as an array of objects, with names and values exactly equivalent to what would get supplied to load_elements(), Arguments: infile (string or path-like object): The filepath of the JSON file. encoding (string): The character encoding of the file. Default is UTF-8. �rqr?�#rNrfz;If foreground is a string, it must have the form '#rrggbb'.r@z;If background is a string, it must have the form '#rrggbb'.) �open�json�load�getr!rRr\� startswithrS� ValueErrorr%)r0rprq�f�data�d�fgval�bgvals r � parse_jsonzFlexTemplate.parse_json�s����&�8� ,� ,� ,� %���9�Q�<�<�D�� � �����l�+�+����Z��s�3�3���{�{�}�}�/�/��4�4��*-�e�A�B�B�i��*<�*<��,���(�Y�������l�+�+����Z��s�3�3���{�{�}�}�/�/��4�4��*-�e�A�B�B�i��*<�*<��,���(�Y����� � � �t� $� $� $�' %� %� %� %� %� %� %� %� %� %� %� %���� %� %� %� %� %� %s�D+E � E�E�,�.� delimiter� decimal_sepc����d#�fd� }dtdfdtdfd|dfd|dfd|dfd |dfd td fd |d fd td fdtd fdtd fd|jd fd|jd fdtd fdtd fdtd fd|jd fd|d fdtd ff}g|_|�t j��}t||���5}tj ||���D]�}|� dgt|��t|��z z��i} t||��D]\} } | � ��} | sJ| dr0| ddkr |ddvr�:td | d�d!����| ddkrd| d<�e| d| ��| | d<��|j�| ���� ddd��n #1swxYwYd"�|jD��|_dS)$a? Load the template definition from a CSV file. Arguments: infile (string or path-like object): The filepath of the CSV file. delimiter (single character): The character that seperates the fields in the CSV file: Usually a comma, semicolon, or tab. decimal_sep (single character): The decimal separator used in the file. Usually either a point or a comma. encoding (string): The character encoding of the file. Default is the system default encoding. rgc�r��t|���p|��d����S)z-Convert to float with given decimal seperatorr�)rT�strip�replace)rj�defaultr�s �r � _varsep_floatz-FlexTemplate.parse_csv.<locals>._varsep_float�s0����!�'�'�)�)�.�w�7�7� �S�I�I�J�J� Jr r4Tr5r6r7r8r9r:Fr;r<r=r>r?r@rArBrCrDrErFNrs)r��rcrrrJzMandatory value 'z' missing in csv datac�B�g|]}|d�����S)r4�r\)rO�vals r rPz*FlexTemplate.parse_csv.<locals>.<listcomp>s(��B�B�B�S�S��[�&�&�(�(�B�B�Br )rg)rRrSrkrnr1�locale�getpreferredencodingru�csv�reader�extend�len�zipr�rr[rW) r0rpr�r�rqr�r]r{�row�kargsr��cfg�vss ` r � parse_csvzFlexTemplate.parse_csv�s����0 K� K� K� K� K� K��S�$� � �S�$� � �=�$� '� �=�$� '� �=�$� '� �=�$� '� �S�%� � �]�E� *� �S�%� � �s�E� "� �#�u� %� �4�0�%� 8� �4�0�%� 8� �c�5� !� �S�%� � ��e� $� �$�/�� 7� �}�e� ,� ��e� $�) � �,�� � � ��2�4�4�H� �&�8� ,� ,� ,� ,���z�!�y�9�9�9� ,� ,��� � �B�4�3�z�?�?�S��X�X�#=�>�?�?�?��� #�C�� 4� 4�3�3�H�C�������B��3��q�6� 2�"�1�v��~�~�#�a�&�M�2I�2I� $�&3�$U��A��$U�$U�$U�'"�'"�!"�!��V�z�1�1�01�E�*�-��)/��A��r� � ��c�!�f� � �� �$�$�U�+�+�+�+�+ ,� ,� ,� ,� ,� ,� ,� ,� ,� ,� ,� ,���� ,� ,� ,� ,�.C�B�D�M�B�B�B�� � � s�C<G � G�Gc��t|t��s Jdt|��j�d����|���|jvrt d|�����||j|���<dS)N�!name must be of type 'str', not 'rQz%Element not loaded, cannot set item: )r!rRr5rNr\rWrr/)r0r4�values r � __setitem__zFlexTemplate.__setitem__s���� �#� � � G� G� F�t�D�z�z�/B� F� F� F� G� G� � �:�:�<�<�t�y� (� (�� N�� N� N�O�O� O�#(�� �4�:�:�<�<� � � r c��t|t��s Jdt|��j�d����|���|jvS)Nr�rQ)r!rRr5rNr\rW)r0r4s r � __contains__zFlexTemplate.__contains__s_��� �#� � � G� G� F�t�D�z�z�/B� F� F� F� G� G� ��z�z�|�|�t�y�(�(r c�4��t|t��s Jdt|��j�d����||jvrt |���|�����|jvr |j�St�fd�|j D��d��S)Nr�rQc3�d�K�|]*}|d����k� |dV��+dS)r4rBNr�)rOrG�keys �r � <genexpr>z+FlexTemplate.__getitem__.<locals>.<genexpr>%s?����� J� J�1��6����1B�1B�c�1I�1I�Q�v�Y�1I�1I�1I�1I� J� Jr ) r!rRr5rNrWrXr\r/�nextr1)r0r4r�s @r � __getitem__zFlexTemplate.__getitem__s����� �#� � � G� G� F�t�D�z�z�/B� F� F� F� G� G� � �t�y� � ��4�.�.� ��j�j�l�l�� �$�*� � ��:�c�?� "�� J� J� J� J�� � J� J� J�D� � � r c ���t�fd�|jD����}|js,t��|_|j���d}|�d��r|dz }|�d��r|dz }|�d��r|dz }|j�|d ||d ��|j�|d |d z |d |dz t|��|�dd��dd|�dd�����S)a� Split a string between words, for the parts to fit into a given element width. Additional splits will be made replacing any '\n' characters. Arguments: text (string): The input text string. element_name (string): The name of the template element to fit the text inside. Returns: A list of substrings, each of which will fit into the element width when rendered in the element font style and size. c3�|�K�|]6}|d�������k�2|V��7dS)r4Nr�)rO�element� element_names �r r�z/FlexTemplate.split_multicell.<locals>.<genexpr>7sV����� � ���v��$�$�&�&�,�*<�*<�*>�*>�>�>� �>�>�>�>� � r r�r<rr=rr>�Ur:r;r8r6r9r7rAT�LINESrF�WORD)rKrIrBrA�dry_run�outputrF) r�r1r$r�add_pagerx�set_font� multi_cellrR)r0rBr�r��styles ` r �split_multicellzFlexTemplate.split_multicell(sZ���� � � � ��=� � � � � �� �!� *�!%���D� � � � '� '� )� )� )��� �;�;�v� � � � �S�L�E� �;�;�x� � � � �S�L�E� �;�;�{� #� #� � �S�L�E� ��#�#�G�F�O�U�G�F�O�L�L�L��!�,�,��d�m�g�d�m�+��d�m�g�d�m�+��T����+�+�g�r�*�*����[�[��V�4�4�-� � � r rr�� helvetica� ��?Fr�)r6r7r8r9rBr:r;�scaler<r=r>rAr?r@rDrFc �X�|sdS|j}|jt| ��kr|jt | ���|�d}n1d}|jt|��kr|jt |���|������}d}dD]C}|� d|�d���r(|� d|�d���r|dd �}||z }�D| r|d z }| r|d z }| r|d z }|� ||||z��|� ||��||z ||z }}|�|� |||d | |���dS|r|�|||d | ||���dS|�|||| |dd���d }|� |||d | |���dS)NFTr��rrr��<�>�</������rrr�r)rKrIrB�borderrA�fill)rKrIrBr�rAr�rFr�)rKrIrBrArFr�r�)r#� text_colorr�set_text_colorr � fill_color�set_fill_colorr�r\ry�endswithr��set_xy�cellr�)r0r6r7r8r9rBr:r;r�r<r=r>rAr?r@rDrF�_�__r#r�r��tag�width�heights r r&zFlexTemplate._textQs=��*� � �F��h�� �>�[��4�4� 4� 4� �C� ��Z� 0� 0� 1� 1� � ��D�D��D��~��Z�!8�!8�8�8�"��"�D��$4�$4�5�5��z�z�|�|�!�!�#�#���� � � �C����z�3�z�z�z�*�*� �t�}�}�[�#�[�[�[�/I�/I� ��A�b�D�z���� ��� � � �S�L�E� � � �S�L�E� � � �S�L�E� � � �T�5�$��,�/�/�/� � � �2�r�����R���b��v�� � � �H�H�u��T�!�5�t�H� T� T� T� T� T� � U� �N�N�������!� � � � � � ��>�>�����!���"�����D� �H�H�u��T�!�5�t�H� T� T� T� T� Tr )r6r7r8r9r;r�r?c�4�|jj������t |��kr|jjt |���|j�||z��|j�||||��dS�N) r#� draw_color� serializer\r�set_draw_colorr �set_line_width�line) r0r6r7r8r9r;r�r?r�r�s r r'zFlexTemplate._line�s��� �8� � (� (� *� *� 0� 0� 2� 2�k�*�6M�6M� M� M� #�D�H� #�T�*�%5�%5� 6� 6� �����u� �-�-�-� �� � �b�"�b�"�%�%�%�%�%r )r6r7r8r9r;r�r?r@c��|j} | j������t |��kr| jt |���|�d} n1d} | jt |��kr| jt |���| � ||z��| � ||||z ||z | ���dS�N�D�FD)r�) r#r�r�r\rr�r r�r�r��rect� r0r6r7r8r9r;r�r?r@r�r�r#r�s r r)zFlexTemplate._rect�s����h�� �>� #� #� %� %� +� +� -� -��Z�1H�1H� H� H� �C� ��Z� 0� 0� 1� 1� � ��E�E��E��~��Z�!8�!8�8�8�"��"�D��$4�$4�5�5� ���4�%�<�(�(�(� ����R��b��"�r�'���7�7�7�7�7r c��|j} | j������t |��kr| jt |���|�d} n1d} | jt |��kr| jt |���| � ||z��| � ||||z ||z | ���dSr�) r#r�r�r\rr�r r�r�r��ellipser�s r r*zFlexTemplate._ellipse�s����h�� �>� #� #� %� %� +� +� -� -��Z�1H�1H� H� H� �C� ��Z� 0� 0� 1� 1� � ��E�E��E��~��Z�!8�!8�8�8�"��"�D��$4�$4�5�5� ���4�%�<�(�(�(� � � �B��B��G�R�"�W�E� �:�:�:�:�:r )r6r7r8r9rBc�Z�|r(|j�|||||z ||z d���dSdS)Nr�)rKrI�link)r#�image)r0r6r7r8r9rBr�r�s r r(zFlexTemplate._image�sE�� � H� �H�N�N�4��R�2��7�b�2�g�B�N� G� G� G� G� G� H� Hr �interleaved 2of5 ntr) r6r7r8r9rBr:r;r�r?c �V�|j} | j������t | ��kr| jt | ���|������}|dkr"| �|||||z||z ���dSdS)Nr�)rKrI) r#r�r�r\rr�r r��interleaved2of5) r0r6r7r8r9rBr:r;r�r?r�r�r#s r r+zFlexTemplate._barcode�s����h�� �>� #� #� %� %� +� +� -� -��Z�1H�1H� H� H� �C� ��Z� 0� 0� 1� 1��z�z�|�|�!�!�#�#�� �(� (� (� � � ��b�"��u� ��R�� � H� H� H� H� H� )� (r g�?) r6r7r9rBr;r�r?rGrHrKrIc �l�|�| �| �| �(tjdtt�����|j}|j������t|��kr|j t|���||z } | dkrd} |� |||||z| ��dS)NzVcode39 arguments x/y/w/h are deprecated since v2.4.4, please use x1/y1/y2/size instead�� stacklevelr�) �warnings�warn�DeprecationWarningrr#r�r�r\rr�r �code39)r0r6r7r9rBr;r�r?rGrHrKrIr�r�r#s r r,zFlexTemplate._code39�s��� �=�A�M�Q�]�a�m� �M�8�#�*�,�,�  � � � ��h�� �>� #� #� %� %� +� +� -� -��Z�1H�1H� H� H� �C� ��Z� 0� 0� 1� 1� ��G�� ��6�6��A� � � �4��R����q�1�1�1�1�1r ) r6r7r8r9rBr:r;r�r<r=r>r�r?c ��|sdS|j}|jt| ��kr|jt | ���|������}d}dD]C}|�d|�d���r(|�d|�d���r|dd�}||z }�D| r|dz }| r|d z }| r|d z }|� ||||z��|� ||��|� d || ��dS) Nr�r�r�r�r�r�r�rrr�r�) r#r�rr�r r�r\ryr�r�r��write)r0r6r7r8r9rBr:r;r�r<r=r>r�r?r�r�r#r�r�s r r-zFlexTemplate._writes=��&� � �F��h�� �>�[��4�4� 4� 4� �C� ��Z� 0� 0� 1� 1��z�z�|�|�!�!�#�#���� � � �C����z�3�z�z�z�*�*� �t�}�}�[�#�[�[�[�/I�/I� ��A�b�D�z���� ��� � � �S�L�E� � � �S�L�E� � � �S�L�E� � � �T�5�$��,�/�/�/� � � �2�r���� � � �!�T�4� � � � � r �c �@�t|jd����}|j���5|D�]I}|���}|j�|d���|�dd����|d<|dkr\|d|z|d<|d|z|d<|d|d |dz |zz|d <|d|d |dz |zz|d <|r|d|z|d<|d |z|d <|r|d|z|d<|d |z|d <||d <|d ���}|r�|j� |||��5d |vrb|d rZ|j� |d |d|d��5|j |di|��ddd��n #1swxYwYn|j |di|��ddd��n #1swxYwY���d |vrc|d r[|j� |d |d|d��5|j |di|��ddd��n #1swxYwY��6|j |di|����K ddd��n #1swxYwYi|_dS)a` Add the contents of the template to the PDF document. Arguments: offsetx, offsety (float): Place the template to move its origin to the given coordinates. rotate (float): Rotate the inserted template around its (offset) origin. scale (float): Scale the inserted template by this factor. c��|dS)NrCr )rGs r �<lambda>z%FlexTemplate.render.<locals>.<lambda>Ms ��a� �m�r )r�r4rBr�r�r6r7r8r9r�r5rENr ) �sortedr1r#� local_context�copyr/rxr\�upper�rotationr.) r0�offsetx�offsetyrEr��sorted_elementsr��ele� handler_names r �renderzFlexTemplate.renderAs���!���4K�4K�L�L�L�� �X� #� #� %� %� ;� ;�*� ;� ;���l�l�n�n��"�j�n�n�S��[�->�->�-@�-@�#�'�'�&�RT�BU�BU�V�V��F� ��C�<�<� #�D� �E� 1�C��I� #�D� �E� 1�C��I� #�D� �c�$�i�'�$�-�.G�5�-P� Q�C��I� #�D� �c�$�i�'�$�-�.G�5�-P� Q�C��I��4� #�D� �G� 3�C��I� #�D� �G� 3�C��I��4� #�D� �G� 3�C��I� #�D� �G� 3�C��I�$��G� �"�6�{�0�0�2�2� �� ;���*�*�6�7�G�D�D�?�?�#�s�?�?�s�8�}�?�!%��!2�!2�3�x�=�#�d�)�S�QU�Y�!W�!W�C�C� ;�� �l� ;� B� B�c� B� B� B�C�C�C�C�C�C�C�C�C�C�C����C�C�C�C��8�D�M�,�7�>�>�#�>�>�>� ?�?�?�?�?�?�?�?�?�?�?����?�?�?�?�� �3���3�x�=��!�X�.�.�s�8�}�c�$�i��T��S�S�?�?�7�D�M�,�7�>�>�#�>�>�>�?�?�?�?�?�?�?�?�?�?�?����?�?�?�?��4�� �l�3�:�:�c�:�:�:�:�9 ;� ;� ;� ;� ;� ;� ;� ;� ;� ;� ;� ;���� ;� ;� ;� ;�<�� � � s~�D?J �0;G6�+G �? G6� G �G6�G �G6�* J �6G: �:J �=G: �>?J �=I� J �I! �!J �$I! �%J � J�Jr�)ro)r�r�N)r�r�r�r�)rN� __module__� __qualname__�__doc__r2r%� staticmethodrkrn�os�PathLikerRr�r�r��setr�r�r�r&r'r)r*r(r+r,r-r�r r r rrs.������������4H0�H0�H0�T����\������\��%�%���%��%�%�%�%�H��� MC�MC�� �MC��MC�� MC� � MC�MC�MC�MC�^)�)�)� �C�)�)�)�  �  �  �' �' �' �X � � � � � � �� ��������%FU�FU�FU�FU�FU�V � � � � ���&�&�&�&�&�( � � � � ����8�8�8�8�8�8 � � � � ����;�;�;�;�;�2�!��a�b�H�H�H�H�H� � � � � � "� ���I�I�I�I�I�2 � � � � ��� � � � �2�2�2�2�2�L � � � � � � �� ��� ��&!�&!�&!�&!�&!�P+�+�+�+�+�+r rc�J��eZdZdZ d �fd� Zd�Zd �fd � Z�xZS) �Templatezr A simple templating class. Allows to apply a single template definition to all pages of a document. N�A4�portrait�mmr�c ���|r(tjdtt�����dD]<} t t ��| t ��std| �d�����=t|||���} | � |��| � |��| � | ��| � |��| � | ��t���| |���dS) a� Arguments: infile (str): [**DEPRECATED since 2.2.0**] unused, will be removed in a later version elements (list of dicts): A template definition in a list of dicts. If you omit this, then you need to call either load_elements() or parse_csv() before doing anything else. format (str): The page format of the document (eg. "A4" or "letter"). orientation (str): The orientation of the document. Possible values are "portrait"/"P" or "landscape"/"L" unit (str): The units used in the template definition. One of "mm", "cm", "in", "pt", or a number for points per unit. title (str): The title of the document. author (str): The author of the document. subject (str): The subject matter of the document. creator (str): The creator of the document. zD"infile" is deprecated since v2.2.0, unused and will soon be removedr�)�format� orientation�unit�title�author�subject�creator�keywordsz Argument "z" must be of type str.)r r r )r#r1N)r�r�r�rr!�localsrRr"r� set_title� set_author� set_creator� set_subject� set_keywords�superr2)r0rpr1r r r r r rrr�argr#� __class__s �r r2zTemplate.__init__xs���L � � �M�V�"�*�,�,� � � � �  � J� J�C��f�h�h�s�m�S�1�1� J�� H�S� H� H� H�I�I�I� J��&�k��E�E�E�� � � �e���� ���v���� ���� � � � ���� � � � ����"�"�"� �����S�8��4�4�4�4�4r c�x�|jjr|���|j���dS)z5Finish the current page, and proceed to the next one.N)r#�pager�r�)r0s r r�zTemplate.add_page�s5�� �8�=� � �K�K�M�M�M� ��������r c�J��|r(tjdtt�����|j�ddd���|j�dd� ��t�����|r|j� |��d Sd S) aa Finish the document and process all pending data. Arguments: outfile (str): If given, the PDF file will be written to this file name. Alternatively, the `.pdf.output()` method can be manually called. dest (str): [**DEPRECATED since 2.2.0**] unused, will be removed in a later version. zB"dest" is deprecated since v2.2.0, unused and will soon be removedr�r�rrf)r�r;Fr)�marginN) r�r�r�rr#r��set_auto_page_breakrr�r�)r0�outfile�destrs �r r�zTemplate.render�s���� � � �M�T�"�*�,�,� � � � � ����+�S�r��:�:�:� ��$�$�U�1�$�5�5�5� �������� � %� �H�O�O�G� $� $� $� $� $� %� %r ) NNrrrr�r�r�r�r�)NN)rNr�r�r�r2r�r�� __classcell__)rs@r rros�������������� ������?5�?5�?5�?5�?5�?5�B���%�%�%�%�%�%�%�%�%�%r r)r�� __author__� __copyright__� __license__rr�rvr�r�� deprecationr�errorsr�fpdfrr rrrr r r �<module>r(s��&�&� 4� �5� �� �&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�(�(�(�(�(�(�!�!�!�!�!�!�������;�;�;�;�;�;�S �S �S �S �S �S �S �S �lf%�f%�f%�f%�f%�|�f%�f%�f%�f%�f%r
Memory