Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions fpdf/fpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from datetime import datetime, timezone
from functools import wraps
from os.path import splitext
from pathlib import Path
from pathlib import Path, PurePath
from typing import (
TYPE_CHECKING,
Any,
Expand All @@ -41,6 +41,7 @@
Union,
ValuesView,
cast,
overload,
)

try:
Expand Down Expand Up @@ -382,7 +383,7 @@ def __init__(
self._output_intents: dict[Name, OutputIntentDictionary] = {}

self._sign_key = None
self.title = None
self.title: str | None = None
Comment thread
srittau marked this conversation as resolved.
Outdated
self.section_title_styles: dict[int, TextStyle] = {} # level -> TextStyle

self.core_fonts_encoding = "latin-1"
Expand Down Expand Up @@ -2487,7 +2488,7 @@ def add_font(
self,
family: Optional[str] = None,
style: str = "",
fname: Optional[str] = None,
fname: Optional[str | PurePath] = None,
*,
unicode_range: Optional[str | Sequence[str | int | tuple[int, int]]] = None,
variations: Optional[dict[str, dict[str, float]] | dict[str, float]] = None,
Expand Down Expand Up @@ -6450,10 +6451,26 @@ def table(self, *args: Any, **kwargs: Any) -> Iterator[Table]:
yield table
table.render()

@overload
def output( # type: ignore[overload-overlap]
self,
name: Optional[Literal[""]] = "",
*,
linearize: bool = False,
output_producer_class: Type[OutputProducer] = OutputProducer,
) -> bytearray: ...
@overload
def output(
self,
name: str | os.PathLike[str] | BinaryIO,
*,
linearize: bool = False,
output_producer_class: Type[OutputProducer] = OutputProducer,
) -> None: ...
@deprecated_parameter([("dest", "2.2.0")])
def output(
self,
name: str | os.PathLike[str] | BinaryIO = "",
name: Optional[str | os.PathLike[str] | BinaryIO] = "",
*,
linearize: bool = False,
output_producer_class: Type[OutputProducer] = OutputProducer,
Expand Down