)EjxUddlZddlmZddlmZmZmZmZddlm Z ddl m Z m Z m Z mZmZmZmZmZmZddlmZddlmZmZe rdd lmZmZmZmZdd lmZGd d eZed dZ eddZ!eddZ"GddeZ#GddeZ$GddeZ%Gdde#Z&Gdde#Z'Gdde#Z(Gdde#Z)Gdd e%Z*Gd!d"e%Z+Gd#d$e%Z,eGd%d&Z-eGd'd(Z.Gd)d*ej/Z0Gd+d,e0Z1e1e0_2Gd-d.e0Z3e3e0_4Gd/d0e0Z5e5e0_6Gd1d2e0Z7e7e0_8Gd3d4e0Z9e9e0_:Gd5d6e0Z;e;e0_<Gd7d8e0Z=e=e0_>Gd9d:eZ?d;Z@eeAd<<Gd=d>e#ZBGd?d@e#ZCGdAdBe$ZDGdCdDe#ZEGdEdFe$ZFGdGdHe#ZGGdIdJe#ZHGdKdLe$ZIGdMdNe#ZJGdOdPe#ZKGdQdRe#ZLGdSdTe#ZMGdUdVe#ZNGdWdXe$ZOGdYdZe#ZPGd[d\e#ZQGd]d^e#ZRGd_d`e#ZSGdadbe#ZTGdcdde$ZUGdedfe$ZVGdgdheZWGdidje#ZXGdkdleZYGdmdneZZGdodpeZ[Gdqdre#Z\Gdsdte#Z]Gdudve#Z^Gdwdxe#Z_Gdydze#Z`Gd{d|e#ZaGd}d~eZbGdde#ZcGdde#ZdGddeZeGdde#ZfdS)N) dataclass)EnumFlagIntEnumIntFlag)intern) TYPE_CHECKINGClassVarOptionalProtocolType TypeAliasTypeVarUnioncast)convert_to_device_color)Namewrap_in_local_context)Color DeviceCMYK DeviceGray DeviceRGB)FPDFceZdZdZ dZdS) SignatureFlagrN)__name__ __module__ __qualname__SIGNATURES_EXIST APPEND_ONLY>D 6&>>Dr$rIceZdZdZedZ edZ edZ edZ edZ dS)CharVPosz;Defines the vertical position of text relative to the line.SUPSUBNOMDENOMLINEN) rrr r<rrNrOrPrQrRr#r$r%rMrMscAA &--C &--C &--C F7OOE 6&>>Dr$rMceZdZdZedZ edZ edZ edZ edZ e d de de fd e d dffd ZxZS) Alignz$Defines how to render text in a cellCENTERX_CENTERLEFTRIGHTJUSTIFYFr/r0r1c|dkr|jSt|tr|}t ||||SN)Lr4r5r7superr:r.r/r0 __class__s r%r:z Align.coercesY B;;5L eS ! ! "KKMMES#%% >   r$r;)rrr r<rCXr]RJr=rr5r>r: __classcell__r`s@r%rTrTs**xAzA8vAwAyA@E   '3,'  9=        [      r$rTceZdZdZedZ edZ edZ e d de de fde ddffd Z xZ S) VAlignzLDefines how to vertically render text in a cell. Default value is MIDDLEMIDDLETOPBOTTOMFr/r0r1cf|dkr|jSt||||Sr[)Mr^r:r_s r%r:z VAlign.coerces: B;;5LS#%% >   r$r;)rrr r<rrmTBr=rr5r>r:rerfs@r%rhrhs xAu ACxAFAF  (C-( :>      [     r$rhceZdZdZdZ dZ dZ dZ dZ e de fdZ d d Z d d Z ed ede efddffd ZxZS) TextEmphasisz Indicates use of bold / italics / underline. This enum values can be combined with & and | operators: style = B | I rrrr1c~dfdjjDS)Nr\c3,K|]\}}|z |VdSNr#).0namer/selfs r% z%TextEmphasis.style..sE   T5%RV,       r$)joinr` __members__itemsrys`r%stylezTextEmphasis.stylesPww    $(N$>$D$D$F$F      r$r/c ||zSrvr#ryr/s r%addzTextEmphasis.adds e|r$ctdfd|jDS)Nr\c3.K|]}|jv |VdSrv)r)rwsr/s r%rzz&TextEmphasis.remove..#s/BB!Qek-A-AA-A-A-A-ABBr$)rqr:r{rrs `r%removezTextEmphasis.remove!sA"" GGBBBBtzBBB B B   r$ct|tr|dkr|jS|dkr|jS|dkr|jS|dkr|jS|dkr|jSt|| |S)Nr\BOLDITALICS UNDERLINE STRIKETHROUGH) r4r5NONEr7roIUSr^r:r.r/r`s r%r:zTextEmphasis.coerce&s eS ! ! {{x{{}}&&u {{}} ))u {{}} ++u {{}}//u S#%%e,,,r$)r/rqr1rq)rrr r<rrorrrpropertyr5rrrr=rrCr:rerfs@r%rqrqs D A  A  A A  s   X      -5c!9: -~ - - - - -[ - - - - -r$rqc"eZdZdZdZ dZ dZdS)MethodReturnValuez Defines the return value(s) of a FPDF content-rendering method. This enum values can be combined with & and | operators: PAGE_BREAK | LINES rrrrN)rrr r< PAGE_BREAKLINESHEIGHTr#r$r%rr6s1JJ E[ F==r$rceZdZdZdZ dZ dZ dZ dZ eezezezZ dZ e de de efd dffd Zded dffd Zded dffd Zd e fd ZxZS)CellBordersLayoutaDefines how to render cell borders in table The integer value of `border` determines which borders are applied. Below are some common examples: - border=1 (LEFT): Only the left border is enabled. - border=3 (LEFT | RIGHT): Both the left and right borders are enabled. - border=5 (LEFT | TOP): The left and top borders are enabled. - border=12 (TOP | BOTTOM): The top and bottom borders are enabled. - border=15 (ALL): All borders (left, right, top, bottom) are enabled. - border=16 (INHERIT): Inherit the border settings from the parent element. Using `border=3` will combine LEFT and RIGHT borders, as it represents the bitwise OR of `LEFT (1)` and `RIGHT (2)`. rrrrrrsr/r1ct|tr|dkrtdt|SNrz,INHERIT cannot be combined with other values)r4rCr6r^r:rs r%r:zCellBordersLayout.coercemsC eS ! ! MebjjKLL Lww~~e$$$r$ctt|}|dkrtd|Sr)r^__and__r6ryr/r`s r%rzCellBordersLayout.__and__ss5&& 2::KLL L r$ctt|}|dkrtd|Sr)r^__or__r6rs r%rzCellBordersLayout.__or__ys5u%% 2::KLL L r$cXg}|tjzr|d|tjzr|d|tjzr|d|tjzr|d|rd|ndS)Nr]rcrnror\r)rrWappendrXrjrkr{)ry border_strs r%__str__zCellBordersLayout.__str__s " #( ( #   c " " " #) ) #   c " " " #' ' #   c " " " #* * #   c " " "&0%5!4c3!>?%DW%%%%%[% S%8 C$7 = = = = = = = = =r$rc ZeZdZUdZdZeeed<dZe e e e e e fddddfed<dZ eeed<d Z eed <d Zeed <ed e edfd dfdZddd efdZddd efdZed eeeeffdZddd efdZddd efdZd efdZ d"dededd eefdZd"dedd eefdZ d"dededd eefdZded eefdZededededed eef d Z dddedededed eef d!Z!dS)#TableBorderStylezA helper class for drawing one border of a table Attributes: thickness: The thickness of the border. If None use default. If <= 0 don't draw the border. color: The color of the border. If None use default. N thicknessrrrcolordashgapphase should_drawr1cpt|tr|S|rtStdS)zk From boolean or TableBorderStyle input, convert to definite TableBorderStyle class object rrr4r)rs r% from_boolzTableBorderStyle.from_boolsB k#3 4 4    &#%% %#....r$pdfrcJ|jduo|jdko|j|jkS)zTReturn True if this style changes the thickness of the draw command, False otherwiseNrr line_widthryrs r%_changes_thicknessz#TableBorderStyle._changes_thicknesss3 N$ & 1$ 1#.0 r$c4|jduo|j|jkS)zPReturn True if this style changes the color of the draw command, False otherwiseN)r draw_colorrs r%_changes_colorzTableBorderStyle._changes_colorsz%F$**FFr$c,|j|j|jdS)zGReturn dict object specifying dash in the same format as the pdf objectrrrrr~s r% dash_dictzTableBorderStyle.dash_dicts $(TZHHHr$c4|jduo|j|jkS)zOReturn True if this style changes the dash of the draw command, False otherwiseN)rr dash_patternrs r% _changes_dashzTableBorderStyle._changes_dashsy$K3;K)KKr$c|o>||p)||p||S)zUReturn True if this style changes the any aspect of the draw command, False otherwise) should_renderrrrrs r%changes_strokezTableBorderStyle.changes_strokesX!!##    $ $ '&&s++ '!!#&& r$c*|jdup |jdkS)zDReturn True if this style produces a visible stroke, False otherwiseNrrr~s r%rzTableBorderStyle.should_renders~%=#)==r$scalec>||jn|j}|gn ||zddgS)zUReturn list with string for the draw command to change thickness (empty if no change)N.2fz wr)ryrrrs r%_get_change_thickness_commandz.TableBorderStyle._get_change_thickness_commands8'*kDNNs~ &rr E0A-I-I-I-I,JJr$c||j}n|j}|gn3t|gS)zQReturn list with string for the draw command to change color (empty if no change))rrr serializer7)ryrrs r%_get_change_line_color_commandz/TableBorderStyle._get_change_line_color_commandsP ;JEENE} B)%00::<<BBDDE r$c||jn|j}|d|d|d}}}|gS|dkrdgS|J||dkrd||zdd ||zdd gSd||zdd ||zdd ||zdd gS) zPReturn list with string for the draw command to change dash (empty if no change)Nrrrrz[] 0 d[z.3fz] z d )rr)ryrrrrrrs r%_get_change_dash_commandz)TableBorderStyle._get_change_dash_commands'*kDNNs7G $V,i.> '@R5c <I 199:    ;#((Au AAAEEMAAAAB BOD5LOOOsU{OOO%%-OOOOPPr$c|||z||zS)zQReturn list of strings for the draw command to change stroke (empty if no change))rrr)ryrs r%get_change_stroke_commandsz+TableBorderStyle.get_change_stroke_commandssD  ) )% 0 01133 40077 8 r$x1y1x2y2c(|dd|dd|dd|ddgS)zQReturn list with string for the command to draw a line at the specified endpointsrrz m z l Sr#)rrrrs r%get_line_commandz!TableBorderStyle.get_line_commands:<<rrrrdictr5rrrrlistrrrrrrr#r$r%rrs<"&Ix%%%  5 U3S= !; lDP    !D(5/   CE5/uT+=%=>/CU///\/ f     G&GTGGGGI4Xe_ 45IIIXILLDLLLL & T    >t>>>> 59KKK!)&!1K cKKKK   (62B  dSVi     59 Q Q Q!)&!1 Q c Q Q Q Q  $s)    >U>>5>e>S >>>\>55$5*/55:5@E5 c555555r$rceZdZUdZdZeezed<dZeezed<dZ eezed<dZ eezed<de eezfdZ e d ed efdeefd Z dd ddedededede ed efdeefdZdedededed dde ed efdeeeeffdZdedededed dde ed efdeeeeffdZdedededed dde ed efdede eezdeeeeffdZdeddfdZ dd ddedededede ed efdd fdZd S)TableCellStyleaA helper class for drawing all the borders of one cell in a table Attributes: left: bool or TableBorderStyle specifying the style of the cell's left border bottom: bool or TableBorderStyle specifying the style of the cell's bottom border right: bool or TableBorderStyle specifying the style of the cell's right border top: bool or TableBorderStyle specifying the style of the cell's top border Fleftbottomrighttopr1ctd|j|j|j|jfDrgtd|j|j|j|jfDrdStd|j|j|j|jfDrdSngtd|j|j|j|jfDr6|jtfd|j|j|jfDrSdS) zRReturn bool or TableBorderStyle if all borders have the same style, otherwise Nonec3@K|]}t|tVdSrv)r4r>rwborders r%rzz:TableCellStyle._get_common_border_style..s@   vt $ $      r$c3K|]}|VdSrvr#rs r%rzz:TableCellStyle._get_common_border_style..!s"WWf6WWWWWWr$Tc3K|]}| VdSrvr#rs r%rzz:TableCellStyle._get_common_border_style..#s5%F r$Fc3@K|]}t|tVdSrvrrs r%rzz:TableCellStyle._get_common_border_style..'sA   v/ 0 0      r$c3$K|] }|kV dSrvr#)rwrcommons r%rzz:TableCellStyle._get_common_border_style..,s(VV6V#VVVVVVr$N)allrrrr)ryrs @r%_get_common_border_stylez'TableCellStyle._get_common_border_stylesJ   9dk4:txH      WWDKTX(VWWWWW t*.)T[$*dh)W u   9dk4:txH      YFVVVV4; DH2UVVVVV  tr$rrcr|gn3t|gS)zSReturn list with string for command to change device color (empty list if no color))rrlower)rs r%get_change_fill_color_commandz,TableCellStyle.get_change_fill_color_command0s; } B)%00::<<BBDDE r$Nrrrrrr fill_colorc `|j|z }|j|z }|j}||z}||z}||z}||z}|}||||||||n9|dur|||||||n|||||||||\} } | rt | } | S)z Get list of primitive commands to draw the cell border for this cell, and fill it with the given fill color. NF)hrr_draw_when_no_common_style_draw_with_no_border_draw_all_borders_the_samer) ryrrrrrrrcommon_border_styler needs_wraps r%rz TableCellStyle.get_draw_commands9sURZ URZ e  e  e  e ";;==#*  + +BBC L L L'%//))"b"b#zJJJ44BCUrWrkrXrj)ryrs r%override_cell_borderz#TableCellStyle.override_cell_borders/777 D+(9(>>??K*;*BBCC;):)@@AA'8'<<==  r$c |d|||||||dS)z\ Draw the cell border for this cell, and fill it with the given fill color. r)rN)_outr{r)ryrrrrrrs r%draw_cell_borderzTableCellStyle.draw_cell_bordersN  HHT++CRRJ+WW X X     r$rv)rrr r<rr>rrrrrr rrrr5rrrrrrrrrr r r#r$r%rr s^%*D$! !)))&+FD# #+++%*E4" "***#(C ((((4:J3J*K* U7C<-@ T#Y   \ 59'' ' '  '  '  'U7C<01' c''''R) ) )  )  )  )U7C<01) tCy$ ))))B) ) )  )  )  )U7C<01) tCy$ ))))() ) )  )  )  )U7C<01))&&6&=>) tCy$ ))))@  0A  FV     (59            U7C<01        r$rc eZdZUdZeded<eded<eded<eded<eded<eded<eded<ejd ed ed ed ed ededede fdZ e de de fddfdZdS)TableBordersLayoutah Customizable class for setting the drawing style of cell borders for the whole table. cell_style_getter is an abstract method that derived classes must implement. All current classes do not use self, but it is available in case a very complicated derived class needs to refer to stored internal data. Standard TableBordersLayouts are available as static members of this class Attributes: cell_style_getter: a callable that takes row_num, column_num, num_heading_rows, num_rows, num_columns; and returns the drawing style of the cell border (as a TableCellStyle object) ALL: static TableBordersLayout that draws all table cells borders NONE: static TableBordersLayout that draws no table cells borders INTERNAL: static TableBordersLayout that draws only internal horizontal & vertical borders MINIMAL: static TableBordersLayout that draws only the top horizontal border, below the headings, and internal vertical borders HORIZONTAL_LINES: static TableBordersLayout that draws only horizontal lines NO_HORIZONTAL_LINES: static TableBordersLayout that draws all cells border except interior horizontal lines after the headings SINGLE_TOP_LINE: static TableBordersLayout that draws only the top horizontal border, below the headings rrINTERNALMINIMALHORIZONTAL_LINESNO_HORIZONTAL_LINESSINGLE_TOP_LINErow_idxcol_idxcol_posnum_heading_rowsnum_rows num_col_idx num_col_posr1ct)arSpecify the desired TableCellStyle for the given position in the table Args: row_idx: the 0-based index of the row in the table col_idx: the 0-based logical index of the cell in the row. If colspan > 1, this indexes into non-null cells. e.g. if there are two cells with colspan = 3, then col_idx will be 0 or 1 col_pos: the 0-based physical position of the cell in the row. If colspan > 1, this indexes into all cells including null ones. e.g. e.g. if there are two cells with colspan = 3, then col_pos will be 0 or 3 num_heading_rows: the number of rows in the table heading num_rows: the total number of rows in the table num_col_idx: the number of non-null cells. e.g. if there are two cells with colspan = 3, then num_col_idx = 2 num_col_pos: the full width of the table in physical cells. e.g. if there are two cells with colspan = 3, then num_col_pos = 6 Returns: TableCellStyle for the given position in the table )NotImplementedErrorryrrrrrrrs r%cell_style_getterz$TableBordersLayout.cell_style_getters <"!r$r/ct||r|St|trF t||}t||r|Sn#t$rYnwxYwt |d|j)a Attempt to coerce `value` into a member of this class. If value is already a member of this enumeration it is returned unchanged. Otherwise, if it is a string, attempt to convert it as an enumeration value. If that fails, attempt to convert it (case insensitively, by upcasing) as an enumeration name. If all different conversion attempts fail, an exception is raised. Args: value (Enum, str): the value to be coerced. Raises: ValueError: if `value` is a string but neither a member by name nor value. TypeError: if `value`'s type is neither a member of the enumeration nor a string. r3)r4r5getattrr7r6r)r.r/ coerced_values r%r:zTableBordersLayout.coerces* eS ! ! L eS ! !   'U[[]] ; ; mS11)(()    EAA3<AABBBs3A A+*A+N)rrr r<r rabcabstractmethodrCrrr=rr5r:r#r$r%rrsR0 & '''' ' ((((+,,,, * ++++34444!"6777723333""" "  "  """ """">C5!5s!:;C@TCCC[CCCr$rc:eZdZdZdededededededed efd Zd S) TableBordersLayoutAllz"Class for drawing all cell bordersrrrrrrrr1c(tddddS)NTrrrs r%rz'TableBordersLayoutAll.cell_style_getter<s4DdKKKKr$Nrrr r<rCrrr#r$r%r%r%9s,, L L L L  L  L L L  L L L L L Lr$r%c:eZdZdZdededededededed efd Zd S) TableBordersLayoutNonez#Class for drawing zero cell bordersrrrrrrrr1c(tddddS)NFrr'rs r%rz(TableBordersLayoutNone.cell_style_getterPs5eOOOOr$Nr(r#r$r%r*r*Ms-- P P P P  P  P P P  P P P P P Pr$r*c:eZdZdZdededededededed efd Zd S) TableBordersLayoutInternalz9Class to draw only internal horizontal & vertical bordersrrrrrrrr1cTt|dk||dz k||dz k|dkSNrrrr'rs r%rz,TableBordersLayoutInternal.cell_style_getterdsA1X\)K!O+!     r$Nr(r#r$r%r-r-as|CC                  r$r-c:eZdZdZdededededededed efd Zd S) TableBordersLayoutMinimalzi Class to draw only the top horizontal border, below the headings, and internal vertical borders rrrrrrrr1cbt|dk||k||dz kd|cxko|kncSr/r'rs r%rz+TableBordersLayoutMinimal.cell_style_gettersW1--K!O+G/////////     r$Nr(r#r$r%r1r1zs                  r$r1c:eZdZdZdededededededed efd Zd S) !TableBordersLayoutHorizontalLinesz#Class to draw only horizontal linesrrrrrrrr1c>td||dz kd|dkS)NFrrrr'rs r%rz3TableBordersLayoutHorizontalLines.cell_style_getters4X\)!     r$Nr(r#r$r%r4r4s|--                  r$r4c:eZdZdZdededededededed efd Zd S) #TableBordersLayoutNoHorizontalLineszRClass to draw all cells border except interior horizontal lines after the headingsrrrrrrrr1c>td||dz kd||kS)NTrrr'rs r%rz5TableBordersLayoutNoHorizontalLines.cell_style_getters6hl*++     r$Nr(r#r$r%r7r7s|\\                  r$r7c:eZdZdZdededededededed efd Zd S) TableBordersLayoutSingleTopLinezClass to draw a single top linerrrrrrrr1c6td||dz kddS)NFrrr'rs r%rz1TableBordersLayoutSingleTopLine.cell_style_getters0w*:Q*>>eQV    r$Nr(r#r$r%r:r:s|))                        r$r:c&eZdZdZdededefdZdS)CellFillProtocolz0Protocol for custom table cell fill mode classesijr1cdSrvr#ryr>r?s r%should_fill_cellz!CellFillProtocol.should_fill_cellsr$N)rrr r<rCr>rBr#r$r%r=r=s1::;#;#;$;;;;;;r$r=z$TableCellFillMode | CellFillProtocolTableCellFillModeTypeceZdZdZedZ edZ edZ edZ edZ edZ e dd e e efd ed e ffd Zd eded efdZxZS)TableCellFillModez!Defines which table cells to fillrrROWSCOLUMNS EVEN_ROWS EVEN_COLUMNSFr/r0r1ctt|ddrtt|St ||S)NrB)callabler rr=r^r:r_s r%r:zTableCellFillMode.coercesK GE#5t<< = = 1(%00 0ww~~e^444r$r>r?c|tjurdS|tjurdS|tjur |dzdkS|tjur |dzdkS|tjur |dzdkS|tjur |dzdkSt)NFTrrr)rErrrFrGrHrIrrAs r%rBz"TableCellFillMode.should_fill_cells $) ) )5 $( ( (4 $) ) )q5A:  $, , ,q5A:  $. . .q5A:  $1 1 1q5A: !!r$r;)rrr r<rrrrFrGrHrIr=rrCr5r>r:rCrBrerfs@r%rErEs '' 6&>>D &--C 6&>>D'fYG*{##I(6.))L+ %55*C/055  55555[5 "# "# "$ " " " " " " " "r$rEc<eZdZedZ edZdS) TableSpanROWCOLN)rrr rrOrPr#r$r%rNrNs- &--C: &--C==r$rNceZdZdZdZ dZdS)TableHeadingsDisplayz2Defines how the table headings should be displayedrrN)rrr r<rON_TOP_OF_EVERY_PAGEr#r$r%rRrRs$88 DE__r$rRceZdZdZedZ edZ edZ ede fdZ ede fdZ ede fdZ e d d ede fd e ddffd ZxZS) RenderStylezDefines how to render shapesDRAWFILL DRAW_FILLr1cZtjdtjdtjdi|S)Nrfro)rUDFDFr~s r%operatorzRenderStyle.operator:s  sKM3 LTRRr$c6|tjtjfvSrv)rUr[r]r~s r%is_drawzRenderStyle.is_draw> {~666r$c6|tjtjfvSrv)rUr\r]r~s r%is_fillzRenderStyle.is_fillBrar$Fr/r0cn|s|jS|dkrd}t||||S)NFDr])r[r^r:r_s r%r:zRenderStyle.coerceFsG 5L D==ES#%% >   r$r;)rrr r<rr[r\r]rr5r^r>r`rcr=rr:rerfs@r%rUrU's+""vA vA   B S#SSSXS7777X77777X7FK   -,-  ?C        [      r$rUc2eZdZdZdZdZdZdZdZdZ dZ d Z d S) TextModez:Values described in PDF spec section 'Text Rendering Mode'rrrrrN) rrr r<rWSTROKE FILL_STROKE INVISIBLE FILL_CLIP STROKE_CLIPFILL_STROKE_CLIPCLIPr#r$r%rgrgSs=@@ D FKIIK DDDr$rgceZdZdZedZ edZ edZ edZ edZ edZ edZ ed Z d S) XPoszFPositional values in horizontal direction for use after printing text.rWrXSTARTENDWCONTrULMARGINRMARGINN) rrr r<rrWrXrurvrwrUrxryr#r$r%rtrt`sLL 6&>>D F7OOE% F7OOE &--C F7OOE9 VH  FfYG0fYG//r$rtceZdZdZedZ edZ edZ edZ edZ dS)YPoszCPositional values in vertical direction for use after printing textrjLASTNEXTTMARGINBMARGINN) rrr r<rrjr|r}r~rr#r$r%r{r{|sgII &--C% 6&>>D= 6&>>D/fYG/fYG00r$r{c2eZdZdZdZdZdZdZdZdZ dZ d Z d S) AnglezTDirection values used for mirror transformations specifying the angle of mirror lineZri-i;N) rrr r<NORTHEASTSOUTHWEST NORTHEAST SOUTHEAST SOUTHWEST NORTHWESTr#r$r%rrs<ZZ E D E DIIIIIIr$rceZdZdZedZ edZ edZ edZ edZ edZ dS) PageLayoutzASpecify the page layout shall be used when the document is opened SinglePage OneColumn TwoColumnLeftTwoColumnRight TwoPageLeft TwoPageRightN) rrr r<r SINGLE_PAGE ONE_COLUMNTWO_COLUMN_LEFTTWO_COLUMN_RIGHT TWO_PAGE_LEFTTWO_PAGE_RIGHTr#r$r%rrsGG$|$$K k""J%d?++OKt,--LD''MJT.))NKKr$rceZdZdZedZ edZ edZ edZ edZ edZ dS) PageModezBSpecifying how to display the document on exiting full-screen modeUseNone UseOutlines UseThumbs FullScreenUseOCUseAttachmentsN) rrr r<rUSE_NONE USE_OUTLINES USE_THUMBS FULL_SCREENUSE_OCUSE_ATTACHMENTSr#r$r%rrs|HHtIH;4 &&Lk""J$|$$KV T']]F*d+,,Or$rcjeZdZdZedZedZedZedZdS)TextMarkupTypez#Subtype of a text markup annotation Highlight UnderlineSquiggly StrikeOutN) rrr r<r HIGHLIGHTrSQUIGGLY STRIKE_OUTr#r$r%rrsP))[!!I[!!ItJHk""JJJr$rceZdZdZedZ edZ edZ edZ edZ edZ edZ ed Z ed Z ed Z ed Z ed Z edZ edZ edZ edZdS) BlendModezLAn enumeration of the named standard named blend functions supported by PDF.NormalMultiplyScreenOverlayDarkenLighten ColorDodge ColorBurn HardLight SoftLight Difference ExclusionHue Saturationr LuminosityN)rrr r<rNORMALMULTIPLYSCREENOVERLAYDARKENLIGHTEN COLOR_DODGE COLOR_BURN HARD_LIGHT SOFT_LIGHT DIFFERENCE EXCLUSIONHUE SATURATIONCOLOR LUMINOSITYr#r$r%rrsQRR T(^^F<tJH< T(^^Fd9ooG T(^^FAd9ooGB$|$$Kk""Jk""Jk""Jl##JV[!!I $u++Cl##J DMME l##Jr$rc0eZdZdZedZ edZ edZ edZ edZ edZ edZ ed Z ed Z ed Z ed Z ed ZdS)CompositingOperationz5An enumeration of Porter-Duff compositing operations.ClearSource Destination SourceOverDestinationOverSourceIn DestinationIn SourceOutDestinationOut SourceAtopDestinationAtopXORN)rrr r<rCLEARSOURCE DESTINATION SOURCE_OVERDESTINATION_OVER SOURCE_INDESTINATION_IN SOURCE_OUTDESTINATION_OUT SOURCE_ATOPDESTINATION_ATOPrr#r$r%rrs;; DMME T(^^F $}%%K%$|$$K>t-..>Z  IiT/**Nik""JUd+,,OU$|$$KCt-..C $u++CUUr$rcHeZdZdZ dZ dZ dZ dZ dZ dZ dZ d Z d Z d S) AnnotationFlagrrrrrsr @N) rrr rnHIDDENPRINTNO_ZOOM NO_ROTATENO_VIEW READ_ONLYLOCKEDTOGGLE_NO_VIEWLOCKED_CONTENTSr#r$r%rrGsiIFZ E<G`I\G_IFNNOUUr$rceZdZdZedZedZedZedZedZ edZ dS) AnnotationNameCThe name of an icon that shall be used in displaying the annotationNoteCommentHelp Paragraph NewParagraphInsertN) rrr r<rNOTECOMMENTHELP PARAGRAPH NEW_PARAGRAPHINSERTr#r$r%rrgsfII 4<6#;;L> DJr$rxcXeZdZdZedZ edZ edZdS)DuplexzZThe paper handling option that shall be used when printing the file from the print dialog.SimplexDuplexFlipShortEdgeDuplexFlipLongEdgeN)rrr r<rSIMPLEXDUPLEX_FLIP_SHORT_EDGEDUPLEX_FLIP_LONG_EDGEr#r$r%rrsK``d9ooG!T"7884 D!56633r$rc|eZdZedZedZedZedZedZdS)PageBoundariesArtBoxBleedBoxCropBoxMediaBoxTrimBoxN) rrr rART_BOX BLEED_BOXCROP_BOX MEDIA_BOXTRIM_BOXr#r$r%rrsSd8nnGZ  ItIHZ  ItIHHHr$rc|eZdZedZedZe ddedefde ddffd Z xZ S) PageOrientationPr]Fr/r0r1ct|tr|}t||||Srv)r4r5r7r^r:r_s r%r:zPageOrientation.coercesI eS ! ! "KKMMES#%% >   r$r;) rrr rPORTRAIT LANDSCAPEr=rr5r>r:rerfs@r%rrsvc{{Hs IJO  +S01 CG      [     r$rceZdZedZedZedZedZedZedZ edZ edZ d S) PDFResourceType ExtGState ColorSpacePatternShadingXObjectFontProcSet PropertiesN) rrr r EXT_G_STATE COLOR_SPACEPATTERNSHADINGX_OBJECTFONTPROC_SET PROPERTIESr#r$r%rrs&%%K&&&KfYGfYGvi  H 6&>>Dvi  H %%JJJr$rceZdZdZdZ dZdS) GradientUnitsz.Specifies the coordinate system for gradients.objectBoundingBoxuserSpaceOnUseN)rrr r<OBJECT_BOUNDING_BOXUSER_SPACE_ON_USEr#r$r%rrs%44-g(11r$rc"eZdZdZdZ dZ dZdS)GradientSpreadMethodzKSpecifies how to fill the area outside the gradient's start and end points.padreflectrepeatN)rrr r<PADREFLECTREPEATr#r$r%rrs+QQ CoGr Fhhr$rceZdZdZdZdZdZdZdZdZ dZ d Z e d e fd Ze d efd Ze d ee fd Ze d e fdZd e fdZedede fd dfdZdS)DocumentCompliancea Type of compliance enforcement that can be applied to a document. Limited to PDF/A at the moment, but extendable to other standards like: - PDF/E (Engineering PDFs) - PDF/UA (PDF Universal Accessibility) - PDF/X (Graphics Exchange PDFs) )rurro)rurro)rurr)rurhro)rurhr)rurrN)rurrr&)rurrr\r1c6t|jdS)Nr)r5r/r~s r%profilezDocumentCompliance.profile 4:a=!!!r$c6t|jdS)Nr)rCr/r~s r%partzDocumentCompliance.partrr$cT|jdt|jdndS)Nr)r/r5r~s r% conformancezDocumentCompliance.conformances&%)Z]%>s4:a=!!!DHr$cb|jdkrdn|j}|d|j|jr|jndS)NruzPDF/A-r\rrr)ryrs r%labelzDocumentCompliance.labelsE!\V33''UUDIU4;K'St'7'7QSUUUr$cD|jd|j|jr|jndS)N_r\rr~s r%rzDocumentCompliance.__str__s2| W Wdi WT=M)U)9)9SU W W r$r/c:t||r|St|tr[|}|D]D}|j|kr|cS|j|kr|cSEt d|d|j)NzCannot coerce z to )r4r5r7rxrr6r)r.r/keyms r%r:zDocumentCompliance.coerce!s eS ! ! L eS ! ! ++--C  6<<>>S((HHH7==??c))HHH*E%EEs|EEFFFr$N)rrr r<PDFA_1BPDFA_2BPDFA_2UPDFA_3BPDFA_3UPDFA_4PDFA_4EPDFA_4Frr5rrCrr rrrr=rr:r#r$r%rrsMGGGGG FGG """"X""c"""X"IXc]IIIXIVsVVVXV      G5!5s!:; G@T G G G[ G G Gr$rceZdZdZedZ edZ edZ edZ edZ edZ edZ ed Z d S) AssociatedFileRelationshipzNRepresents the association between an embedded file and the content on the PDFrData Alternative SupplementEncryptedPayloadFormDataSchema UnspecifiedN) rrr r<rrDATA ALTERNATIVE SUPPLEMENTENCRYPTED_PAYLOAD FORM_DATASCHEMA UNSPECIFIEDr#r$r%rr/sXX VH  F= 6&>>D &''K? %%J 122 z""IQ VH  F?&''Kr$r)gr" dataclassesrenumrrrrsysrtypingr r r r r rrrrdrawing_primitivesrsyntaxrrrrrrfpdfrrr&r)r+r'r*r,rIrMrTrhrqrrrrABCrr%rr*rr-rr1rr4rr7rr:rr=rCrrErNrRrUrgrtr{rrrrrrrrrrrr'r*r/r3rHrNrTrdrjrprxrrrrrrrrr#r$r%rs  !!!!!!------------                      877777////////LLLLLLLLLLLLG GC~&&& WT*+++ WT*+++'L'L'L'L'L4'L'L'LT'G'G'G'G'Gg'G'G'GT-G-G-G-G-Gg-G-G-G`||&     L   >     \   02-2-2-2-2-?2-2-2-j>>>>>>>>$A=A=A=A=A=A=A=A=H {5{5{5{5{5{5{5 {5| F F F F F F F  F RaCaCaCaCaCaCaCaCH L L L L L. L L L"/.00 P P P P P/ P P P"1022     !3   ,98::     2   07688     (:   ,'H&G&I&I#     *<   ,*M)L)N)N&     &8   &&E%D%F%F"<<<<>>>> >>>`````?```) ) ) ) ) ,) ) ) X          00000<000811111<111&     O   LLLLLLLL,     |   , # # # # #\ # # #HHHHH HHHV%V%V%V%V%V<%V%V%VPVVVVV_VVV@\)))))<)))|>33333L333l<0_0o4     4        \   $<'''''w'''Tt     L    7 7 7 7 7, 7 7 7\, 4 4 4 4 4\ 4 4 4\      l    &&&&&d&&&22222L222 i i i i i< i i i3G3G3G3G3G3G3G3Gl&&&&&&&&&&r$