@@ -23,6 +23,7 @@ from .enums import (
2323 EncryptionMethod ,
2424 FileAttachmentAnnotationName ,
2525 MethodReturnValue ,
26+ OutputIntentSubType ,
2627 PageLabelStyle ,
2728 PageLayout ,
2829 PageMode ,
@@ -53,7 +54,7 @@ from .image_datastructures import (
5354 VectorImageInfo as VectorImageInfo ,
5455 _TextAlign ,
5556)
56- from .output import OutputProducer , PDFPage
57+ from .output import OutputProducer , PDFICCProfile , PDFPage
5758from .recorder import FPDFRecorder
5859from .structure_tree import StructureTreeBuilder
5960from .syntax import DestinationXYZ
@@ -77,7 +78,35 @@ __all__ = [
7778_Orientation : TypeAlias = Literal ["" , "portrait" , "p" , "P" , "landscape" , "l" , "L" ]
7879_Format : TypeAlias = Literal ["" , "a3" , "A3" , "a4" , "A4" , "a5" , "A5" , "letter" , "Letter" , "legal" , "Legal" ]
7980_FontStyle : TypeAlias = Literal ["" , "B" , "I" , "BI" ]
80- _FontStyles : TypeAlias = Literal ["" , "B" , "I" , "U" , "BU" , "UB" , "BI" , "IB" , "IU" , "UI" , "BIU" , "BUI" , "IBU" , "IUB" , "UBI" , "UIB" ]
81+ _FontStyles : TypeAlias = Literal [
82+ "" ,
83+ "B" ,
84+ "I" ,
85+ "U" ,
86+ "S" ,
87+ "BU" ,
88+ "UB" ,
89+ "BI" ,
90+ "IB" ,
91+ "IU" ,
92+ "UI" ,
93+ "BS" ,
94+ "SB" ,
95+ "IS" ,
96+ "SI" ,
97+ "BIU" ,
98+ "BUI" ,
99+ "IBU" ,
100+ "IUB" ,
101+ "UBI" ,
102+ "UIB" ,
103+ "BIS" ,
104+ "BSI" ,
105+ "IBS" ,
106+ "ISB" ,
107+ "SBI" ,
108+ "SIB" ,
109+ ]
81110
82111FPDF_VERSION : Final [str ]
83112PAGE_FORMATS : dict [_Format , tuple [float , float ]]
@@ -88,12 +117,14 @@ class ToCPlaceholder(NamedTuple):
88117 y : int
89118 page_orientation : str
90119 pages : int = 1
120+ reset_page_indices : bool = True
91121
92122def get_page_format (format : _Format | tuple [float , float ], k : float | None = None ) -> tuple [float , float ]: ...
93123
94124class FPDF (GraphicsStateMixin ):
95125 MARKDOWN_BOLD_MARKER : ClassVar [str ]
96126 MARKDOWN_ITALICS_MARKER : ClassVar [str ]
127+ MARKDOWN_STRIKETHROUGH_MARKER : ClassVar [str ]
97128 MARKDOWN_UNDERLINE_MARKER : ClassVar [str ]
98129 MARKDOWN_ESCAPE_CHARACTER : ClassVar [str ]
99130 MARKDOWN_LINK_REGEX : ClassVar [Pattern [str ]]
@@ -145,7 +176,6 @@ class FPDF(GraphicsStateMixin):
145176 compress : bool
146177 pdf_version : str
147178 creation_date : datetime .datetime
148- graphics_style_names_per_page_number : dict [int , set [str ]]
149179
150180 buffer : bytearray | None
151181
@@ -179,6 +209,19 @@ class FPDF(GraphicsStateMixin):
179209 def is_ttf_font (self ) -> bool : ...
180210 @property
181211 def page_mode (self ) -> PageMode : ...
212+ @page_mode .setter
213+ def page_mode (self , page_mode : PageMode ) -> None : ...
214+ @property
215+ def output_intents (self ): ...
216+ def add_output_intent (
217+ self ,
218+ subtype : OutputIntentSubType ,
219+ output_condition_identifier : str | None = None ,
220+ output_condition : str | None = None ,
221+ registry_name : str | None = None ,
222+ dest_output_profile : PDFICCProfile | None = None ,
223+ info : str | None = None ,
224+ ) -> None : ...
182225 @property
183226 def epw (self ) -> float : ...
184227 @property
@@ -336,14 +379,15 @@ class FPDF(GraphicsStateMixin):
336379 closed : bool = False ,
337380 style : RenderStyle | Literal ["D" , "F" , "DF" , "FD" ] | None = None ,
338381 ) -> None : ...
382+ def use_pattern (self , shading ) -> _GeneratorContextManager [None ]: ...
339383 def add_font (
340384 self ,
341385 family : str | None = None ,
342386 style : _FontStyle = "" ,
343387 fname : str | PurePath | None = None ,
344388 uni : bool | Literal ["DEPRECATED" ] = "DEPRECATED" ,
345389 ) -> None : ...
346- def set_font (self , family : str | None = None , style : _FontStyles = "" , size : int = 0 ) -> None : ...
390+ def set_font (self , family : str | None = None , style : _FontStyles | TextEmphasis = "" , size : int = 0 ) -> None : ...
347391 def set_font_size (self , size : float ) -> None : ...
348392 def set_char_spacing (self , spacing : float ) -> None : ...
349393 def set_stretching (self , stretching : float ) -> None : ...
@@ -618,7 +662,11 @@ class FPDF(GraphicsStateMixin):
618662 def unbreakable (self ) -> _GeneratorContextManager [FPDFRecorder ]: ...
619663 def offset_rendering (self ) -> _GeneratorContextManager [FPDFRecorder ]: ...
620664 def insert_toc_placeholder (
621- self , render_toc_function : Callable [[FPDF , list [OutlineSection ]], object ], pages : int = 1 , allow_extra_pages : bool = False
665+ self ,
666+ render_toc_function : Callable [[FPDF , list [OutlineSection ]], object ],
667+ pages : int = 1 ,
668+ allow_extra_pages : bool = False ,
669+ reset_page_indices : bool = True ,
622670 ) -> None : ...
623671 def set_section_title_styles (
624672 self ,
0 commit comments