fpdf2 の API リファレンス
fpdf2 (py-pdf/fpdf2) の公開 API 250 件 —— クラス 84、関数 30、メソッド 136。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。
リポジトリ: py-pdf/fpdf2
| 種別 | 件数 |
|---|---|
| クラス | 84 |
| 関数 | 30 |
| メソッド | 136 |
API 一覧
class
fpdf.annotations.AnnotationDictA PDF annotation that get serialized as an inline <<dictionary>>
class
fpdf.annotations.PDFAnnotationA PDF annotation that get serialized as an obj<</>>endobj block
func
fpdf.deprecation.get_stack_level() -> intGet the first place in the call stack that is not inside fpdf2
func
fpdf.deprecation.support_deprecated_txt_arg(fn:Callable[P, R]) -> Callable[P, R]Decorator converting `txt=` arguments into `text=` arguments
class
fpdf.drawing.ArcAn elliptical arc path element.
method
fpdf.drawing.Arc.end_point() -> PointThe end point of this path element.
class
fpdf.drawing.BezierCurveA cubic Bézier curve path element.
method
fpdf.drawing.BezierCurve.bounding_box(start:Point) -> tuple[BoundingBox, Point]Compute the bounding box of this cubic Bézier curve.
method
fpdf.drawing.BezierCurve.end_point() -> PointThe end point of this path element.
method
fpdf.drawing.BoundingBox.from_points(points:list[Point]) -> 'BoundingBox'Given a list of points, create a bounding box that encloses them all.
method
fpdf.drawing.BoundingBox.height() -> floatReturn the height of the bounding box.
method
fpdf.drawing.BoundingBox.is_valid() -> boolReturn True if the bounding box is not empty.
method
fpdf.drawing.BoundingBox.max_distance_to_point(cx:float, cy:float) -> floatMax Euclidean distance from (cx,cy) to any bbox corner.
method
fpdf.drawing.BoundingBox.merge(other:'BoundingBox') -> 'BoundingBox'Expand this bounding box to include another one.
method
fpdf.drawing.BoundingBox.to_pdf_array() -> strConvert bounding box to a PDF array string.
method
fpdf.drawing.BoundingBox.to_tuple() -> tuple[float, float, float, float]Convert bounding box to a 4-tuple.
method
fpdf.drawing.BoundingBox.width() -> floatReturn the width of the bounding box.
class
fpdf.drawing.ClippingPathThe PaintedPath API but to be used to create clipping paths.
class
fpdf.drawing.CloseA path close element.
method
fpdf.drawing.Close.bounding_box(start:Point) -> tuple[BoundingBox, Point]Return an empty bounding box; Close does not affect the geometry.
method
fpdf.drawing.Close.end_point() -> PointThe end point of a Close is undefined; return (0, 0).
class
fpdf.drawing.EllipseAn ellipse.
class
fpdf.drawing.GlyphPathPenA pen that can be used to draw glyphs into a `PaintedPath`.
class
fpdf.drawing.GradientPaintFill/stroke paint using a gradient
class
fpdf.drawing.ImageSoftMaskSoft mask backed by a grayscale image XObject.
class
fpdf.drawing.LineA path line element.
method
fpdf.drawing.Line.end_point() -> PointThe end point of this path element.
class
fpdf.drawing.MoveA path move element.
method
fpdf.drawing.Move.end_point() -> PointThe end point of this path element.
class
fpdf.drawing.PaintedPathA path to be drawn by the PDF renderer.
method
fpdf.drawing.PaintedPath.add_path_element(item:Renderable, clone:bool=True) -> NoneAdd the given element as a path item of this path.
method
fpdf.drawing.PaintedPath.circle(cx:Number, cy:Number, r:Number) -> 'PaintedPath'Append a circle as a closed subpath to the current path.
method
fpdf.drawing.PaintedPath.clipping_path() -> Optional['ClippingPath']Set the clipping path for this path.
method
fpdf.drawing.PaintedPath.close() -> NoneExplicitly close the current (sub)path.
method
fpdf.drawing.PaintedPath.curve_to(x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number) -> 'PaintedPath'Append a cubic Bézier curve to this path.
method
fpdf.drawing.PaintedPath.ellipse(cx:Number, cy:Number, rx:Number, ry:Number) -> 'PaintedPath'Append an ellipse as a closed subpath to the current path.
method
fpdf.drawing.PaintedPath.horizontal_line_to(x:Number) -> 'PaintedPath'Append a straight horizontal line to the given abscissa.
method
fpdf.drawing.PaintedPath.line_to(x:Number, y:Number) -> 'PaintedPath'Append a straight line to this path.
method
fpdf.drawing.PaintedPath.move_to(x:Number, y:Number) -> 'PaintedPath'Start a new subpath or move the path starting point.
method
fpdf.drawing.PaintedPath.style() -> GraphicsStyleThe `GraphicsStyle` applied to all elements of this path.
method
fpdf.drawing.PaintedPath.text(x:float, y:float, content:str, font_family:str='helvetica', font_style:str='', font_size:float=12.0, text_anchor:str='start') -> 'PaintedPath'Append a text run at (x, y) to this path.
method
fpdf.drawing.PaintedPath.vertical_line_to(y:Number) -> 'PaintedPath'Append a straight vertical line to the given ordinate.
class
fpdf.drawing.QuadraticBezierCurveA quadratic Bézier curve path element.
method
fpdf.drawing.QuadraticBezierCurve.end_point() -> PointThe end point of this path element.
class
fpdf.drawing.RectangleA pdf primitive rectangle.
method
fpdf.drawing.Rectangle.bounding_box(start:Point) -> tuple[BoundingBox, Point]Compute the bounding box of this rectangle.
method
fpdf.drawing.Rectangle.end_point() -> PointThe end point of a rectangle is the origin.
class
fpdf.drawing.RelativeArcAn elliptical arc path element.
class
fpdf.drawing.RoundedRectangleA rectangle with rounded corners.
class
fpdf.drawing.TextSVG-like text renderable.
method
fpdf.drawing.Text.bounding_box(start:Point) -> tuple['BoundingBox', Point]Compute a conservative bbox for the text.
method
fpdf.drawing.VerticalLine.bounding_box(start:Point) -> tuple[BoundingBox, Point]Compute the bounding box of this vertical line.
class
fpdf.drawing_primitives.DeviceCMYKA class representing a PDF DeviceCMYK color.
class
fpdf.drawing_primitives.DeviceGrayA class representing a PDF DeviceGray color.
class
fpdf.drawing_primitives.DeviceRGBA class representing a PDF DeviceRGB color.
class
fpdf.drawing_primitives.PointAn x-y coordinate pair within the two-dimensional coordinate frame.
method
fpdf.drawing_primitives.Point.dot(other:'Point') -> floatCompute the dot product of two points.
class
fpdf.drawing_primitives.TransformA representation of an affine transformation matrix for 2D shapes.
method
fpdf.drawing_primitives.Transform.identity() -> 'Transform'Create a transform representing the identity transform.
method
fpdf.drawing_primitives.Transform.inverse() -> 'Transform'Produce a transform that is the inverse of this transform.
method
fpdf.drawing_primitives.Transform.render(last_item:'Renderable') -> tuple[str, 'Renderable']Render the transform to its PDF output representation.
method
fpdf.drawing_primitives.Transform.rotation(theta:Number) -> 'Transform'Create a transform that performs rotation.
method
fpdf.drawing_primitives.Transform.rotation_d(theta_d:Number) -> 'Transform'Create a transform that performs rotation **in degrees**.
method
fpdf.drawing_primitives.Transform.row_norms() -> tuple[float, float]Returns (sqrt(a² + c²), sqrt(b² + d²)), i.e.
method
fpdf.drawing_primitives.Transform.scaling(x:Number, y:Optional[Number]=None) -> 'Transform'Create a transform that performs scaling.
method
fpdf.drawing_primitives.Transform.shearing(x:Number, y:Optional[Number]=None) -> 'Transform'Create a transform that performs shearing (not of sheep).
method
fpdf.drawing_primitives.Transform.skew(ax:Number=0, ay:Optional[Number]=None) -> 'Transform'Compose with a skew (radians).
method
fpdf.drawing_primitives.Transform.skew_d(ax_d:Number=0, ay_d:Optional[Number]=None) -> 'Transform'Compose with a skew (degrees).
method
fpdf.drawing_primitives.Transform.skewing(ax:Number=0, ay:Optional[Number]=None) -> 'Transform'Create a skew (shear) transform using angles **in radians**.
method
fpdf.drawing_primitives.Transform.skewing_d(ax_d:Number=0, ay_d:Optional[Number]=None) -> 'Transform'Create a skew (shear) transform using angles **in degrees**.
method
fpdf.drawing_primitives.Transform.translation(x:Number, y:Number) -> 'Transform'Create a transform that performs translation.
func
fpdf.drawing_primitives.cmyk8(c:Number, m:Number, y:Number, k:Number, a:Optional[Number]=None) -> DeviceCMYKProduce a DeviceCMYK color from the given 8-bit CMYK values.
func
fpdf.drawing_primitives.gray8(g:Number, a:Optional[Number]=None) -> DeviceGrayProduce a DeviceGray color from the given 8-bit gray value.
func
fpdf.drawing_primitives.rgb8(r:Number, g:Number, b:Number, a:Optional[Number]=None) -> DeviceGray | DeviceRGBProduce a DeviceRGB color from the given 8-bit RGB values.
func
fpdf.encryption.int32(n:int) -> intconvert long to signed 32 bit integer
class
fpdf.enums.AlignDefines how to render text in a cell
class
fpdf.enums.CellFillProtocolProtocol for custom table cell fill mode classes
class
fpdf.enums.CharVPosDefines the vertical position of text relative to the line.
class
fpdf.enums.CoerciveEnumAn enumeration that provides a helper to coerce strings into enumeration members.
method
fpdf.enums.CoerciveEnum.coerce(value:E | str, case_sensitive:bool=False) -> EAttempt to coerce `value` into a member of this enumeration.
class
fpdf.enums.CompositingOperationAn enumeration of Porter-Duff compositing operations.
class
fpdf.enums.EncryptionMethodAlgorithm to be used to encrypt the document
class
fpdf.enums.GradientUnitsSpecifies the coordinate system for gradients.
class
fpdf.enums.MethodReturnValueDefines the return value(s) of a FPDF content-rendering method.
class
fpdf.enums.OutputIntentSubTypeDefinition for Output Intent Subtypes
class
fpdf.enums.PDFStyleKeysAn enumeration of the graphics state parameter dictionary keys.
class
fpdf.enums.PageLabelStyleStyle of the page label
class
fpdf.enums.PageLayoutSpecify the page layout shall be used when the document is opened
class
fpdf.enums.PageModeSpecifying how to display the document on exiting full-screen mode
class
fpdf.enums.RenderStyleDefines how to render shapes
class
fpdf.enums.TableBordersLayoutAllClass for drawing all cell borders
class
fpdf.enums.TableBordersLayoutHorizontalLinesClass to draw only horizontal lines
class
fpdf.enums.TableBordersLayoutInternalClass to draw only internal horizontal & vertical borders
class
fpdf.enums.TableBordersLayoutNoneClass for drawing zero cell borders
class
fpdf.enums.TableBordersLayoutSingleTopLineClass to draw a single top line
class
fpdf.enums.TableCellFillModeDefines which table cells to fill
class
fpdf.enums.TableHeadingsDisplayDefines how the table headings should be displayed
class
fpdf.enums.TextDirectionText rendering direction for text shaping
class
fpdf.enums.TextEmphasisIndicates use of bold / italics / underline.
class
fpdf.enums.TextMarkupTypeSubtype of a text markup annotation
class
fpdf.enums.TextModeValues described in PDF spec section 'Text Rendering Mode'
class
fpdf.enums.VAlignDefines how to vertically render text in a cell.
class
fpdf.enums.WrapModeDefines how to break and wrap lines in multi-line text.
class
fpdf.enums.YPosPositional values in vertical direction for use after printing text
class
fpdf.errors.FPDFPageFormatExceptionError is thrown when a bad page format is given
class
fpdf.font_type_3.CBDTColorFontSupport for CBDT+CBLC bitmap color fonts.
class
fpdf.font_type_3.COLRFontSupport for COLRv0 and COLRv1 OpenType color vector fonts.
class
fpdf.font_type_3.EBDTBitmapFontSupport for EBLC+EBDT bitmap fonts.
class
fpdf.font_type_3.SBIXColorFontSupport for SBIX bitmap color fonts.
class
fpdf.font_type_3.SVGColorFontSupport for SVG OpenType vector color fonts.
class
fpdf.fonts.FontFaceRepresent basic font styling properties.
class
fpdf.fonts.HarfBuzzFontuharfbuzz.Font than can be deepcopied
class
fpdf.fpdf.FPDFPDF Generation class
method
fpdf.fpdf.FPDF.add_action(action:Action, x:float, y:float, w:float, h:float, **kwargs:Any) -> AnnotationDictPuts an Action annotation on a rectangular area of the page.
method
fpdf.fpdf.FPDF.add_link(y:float=0, x:float=0, page:int=-1, zoom:str | float='null', name:Optional[str]=None) -> intCreates a new internal link and returns its identifier.
method
fpdf.fpdf.FPDF.alias_nb_pages(alias:str='{nb}') -> NoneDefines an alias for the total number of pages.
method
fpdf.fpdf.FPDF.arc(x:float, y:float, a:float, start_angle:float, end_angle:float, b:Optional[float]=None, inclination:float=0, clockwise:bool=False, start_from_center:bool=False, end_at_center:bool=False, style:Optional[RenderStyle | str]=None) -> NoneOutputs an arc.
method
fpdf.fpdf.FPDF.circle(x:float, y:float, radius:float, style:Optional[RenderStyle | str]=None) -> NoneOutputs a circle.
method
fpdf.fpdf.FPDF.code39(text:str, x:float, y:float, w:float=1.5, h:float=5) -> NoneBarcode 3of9
method
fpdf.fpdf.FPDF.dashed_line(x1:float, y1:float, x2:float, y2:float, dash_length:float=1, space_length:float=1) -> NoneDraw a dashed line between two points.
method
fpdf.fpdf.FPDF.draw_path(path:GraphicsContext, debug_stream:Optional[bool]=None, copy:bool=True) -> NoneAdd a pre-constructed path to the document.
method
fpdf.fpdf.FPDF.draw_vector_glyph(path:Union[PaintedPath, GraphicsContext], font:'Type3Font') -> strAdd a pre-constructed path to the document.
method
fpdf.fpdf.FPDF.drawing_context(debug_stream:Optional[bool]=None) -> Generator[DrawingContext, None, None]Create a context for drawing paths on the current page.
method
fpdf.fpdf.FPDF.ellipse(x:float, y:float, w:float, h:float, style:Optional[RenderStyle | str]=None) -> NoneOutputs an ellipse.
method
fpdf.fpdf.FPDF.eph() -> floatEffective page height: the page height minus its vertical margins.
method
fpdf.fpdf.FPDF.epw() -> floatEffective page width: the page width minus its horizontal margins.
method
fpdf.fpdf.FPDF.footer() -> NoneFooter to be implemented in your own inherited class.
method
fpdf.fpdf.FPDF.get_fallback_font(char:str, style:str='') -> Optional[str]Returns which fallback font has the requested glyph.
method
fpdf.fpdf.FPDF.get_named_destination(name:str) -> strRetrieves a named destination by its name and creates a link to it.
method
fpdf.fpdf.FPDF.get_page_label() -> strReturn the current page `fpdf.output.PDFPageLabel`.
method
fpdf.fpdf.FPDF.get_string_width(s:str, normalized:bool=False, markdown:bool=False) -> floatReturns the length of a string in user unit.
method
fpdf.fpdf.FPDF.get_x() -> floatReturns the abscissa of the current position.
method
fpdf.fpdf.FPDF.get_y() -> floatReturns the ordinate of the current position.
method
fpdf.fpdf.FPDF.ink_annotation(coords:Sequence[tuple[float, float]], text:str='', color:tuple[float, float, float]=(1, 1, 0), border_width:float=1, **kwargs:Any) -> AnnotationDictAdds add an ink annotation on the page.
method
fpdf.fpdf.FPDF.interleaved2of5(text:str, x:float, y:float, w:float=1, h:float=10) -> NoneBarcode I2of5 (numeric), adds a 0 if odd length
method
fpdf.fpdf.FPDF.line(x1:float, y1:float, x2:float, y2:float) -> NoneDraw a line between two points.
method
fpdf.fpdf.FPDF.ln(h:Optional[float]=None) -> NoneLine Feed.
method
fpdf.fpdf.FPDF.local_context(**kwargs:Any) -> Generator[None, None, None]Creates a local graphics state, which won't affect the surrounding code.
method
fpdf.fpdf.FPDF.normalize_text(text:str) -> strCheck that text input is in the correct format/encoding
method
fpdf.fpdf.FPDF.page_no() -> intGet the current page number
method
fpdf.fpdf.FPDF.polygon(point_list:Sequence[tuple[float, float]], fill:bool=False, style:Optional[RenderStyle | str]=None) -> NoneOutputs a polygon defined by three or more points.
method
fpdf.fpdf.FPDF.polyline(point_list:Sequence[tuple[float, float]], fill:bool=False, polygon:bool=False, style:Optional[RenderStyle | str]=None) -> NoneDraws lines between two or more points.
method
fpdf.fpdf.FPDF.rect(x:float, y:float, w:float, h:float, style:Optional[RenderStyle | str]=None, round_corners:bool=False, corner_radius:float=0) -> NoneOutputs a rectangle.
method
fpdf.fpdf.FPDF.rotate(angle:float, x:Optional[float]=None, y:Optional[float]=None) -> None..
method
fpdf.fpdf.FPDF.rotation(angle:float, x:Optional[float]=None, y:Optional[float]=None) -> Generator[None, None, None]Method to perform a rotation around a given center.
method
fpdf.fpdf.FPDF.set_author(author:str | Sequence[str]) -> NoneDefines the author of the document.
method
fpdf.fpdf.FPDF.set_char_spacing(spacing:float) -> NoneSets horizontal character spacing.
method
fpdf.fpdf.FPDF.set_compression(compress:bool) -> NoneActivates or deactivates page compression.
method
fpdf.fpdf.FPDF.set_creation_date(date:Optional[datetime]=None) -> NoneSets Creation of Date time, or current time if None given.
method
fpdf.fpdf.FPDF.set_creator(creator:str) -> NoneDefines the creator of the document.
method
fpdf.fpdf.FPDF.set_dash_pattern(dash:float=0, gap:float=0, phase:float=0) -> NoneSet the current dash pattern for lines and curves.
method
fpdf.fpdf.FPDF.set_display_mode(zoom:str | float, layout:str='continuous') -> NoneDefines the way the document is to be displayed by the viewer.
method
fpdf.fpdf.FPDF.set_doc_option(opt:Literal['core_fonts_encoding'], value:str) -> NoneDefines a document option.
method
fpdf.fpdf.FPDF.set_font(family:Optional[str]=None, style:Union[str, TextEmphasis]='', size:float=0) -> NoneSets the font used to print character strings.
method
fpdf.fpdf.FPDF.set_font_size(size:float) -> NoneConfigure the font size in points Args: size (float): font size in points
method
fpdf.fpdf.FPDF.set_left_margin(margin:float) -> NoneSets the document left margin.
method
fpdf.fpdf.FPDF.set_link(link:Optional[int]=None, y:float=0, x:float=0, page:int=-1, zoom:float | str='null', name:Optional[str]=None) -> DestinationXYZ | strDefines the page and position a link points to.
method
fpdf.fpdf.FPDF.set_margin(margin:float) -> NoneSets the document right, left, top & bottom margins to the same value.
method
fpdf.fpdf.FPDF.set_producer(producer:str) -> NoneProducer of document
method
fpdf.fpdf.FPDF.set_right_margin(margin:float) -> NoneSets the document right margin.
method
fpdf.fpdf.FPDF.set_stretching(stretching:float) -> NoneSets horizontal font stretching.
method
fpdf.fpdf.FPDF.set_subject(subject:str) -> NoneDefines the subject of the document.
method
fpdf.fpdf.FPDF.set_text_color(r:Number | Color | str | Sequence[Number] | DeviceCMYK | DeviceGray | DeviceRGB, g:Number=-1, b:Number=-1) -> NoneDefines the color used for text.
method
fpdf.fpdf.FPDF.set_title(title:str) -> NoneDefines the title of the document.
method
fpdf.fpdf.FPDF.set_top_margin(margin:float) -> NoneSets the document top margin.
method
fpdf.fpdf.FPDF.set_x(x:float) -> NoneDefines the abscissa of the current position.
method
fpdf.fpdf.FPDF.set_xy(x:float, y:float) -> NoneDefines the abscissa and ordinate of the current position.
method
fpdf.fpdf.FPDF.set_y(y:float) -> NoneMoves the current abscissa back to the left margin and sets the ordinate.
method
fpdf.fpdf.FPDF.solid_arc(x:float, y:float, a:float, start_angle:float, end_angle:float, b:Optional[float]=None, inclination:float=0, clockwise:bool=False, style:Optional[RenderStyle | str]=None) -> NoneOutputs a solid arc.
method
fpdf.fpdf.FPDF.star(x:float, y:float, r_in:float, r_out:float, corners:int, rotate_degrees:float=0, style:Optional[RenderStyle | str]=None) -> NoneOutputs a regular star with n corners.
method
fpdf.fpdf.FPDF.start_section(name:str, level:int=0, strict:bool=True) -> NoneStart a section in the document outline.
method
fpdf.fpdf.FPDF.text(x:float, y:float, text:str='') -> NonePrints a character string.
method
fpdf.fpdf.FPDF.transform(transform:Transform) -> Generator[None, None, None]Apply a transformation matrix to the current graphics state.
method
fpdf.fpdf.FPDF.use_pattern(shading:Gradient) -> Generator[None, None, None]Create a context for using a shading pattern on the current page.
method
fpdf.fpdf.FPDF.write(h:Optional[float]=None, text:str='', link:Optional[str | int]='', print_sh:bool=False, wrapmode:WrapMode=WrapMode.WORD) -> boolPrints text from the current position.
method
fpdf.fpdf.FPDF.write_html(text:str, *args:Any, **kwargs:Any) -> NoneParse HTML and convert it to PDF.
func
fpdf.fpdf.check_page(fn:Callable[P, R]) -> Callable[P, R]Decorator to protect drawing methods
func
fpdf.fpdf.get_page_format(format:str | tuple[float, float], k:Optional[float]=None) -> tuple[float, float]Return page width and height size in points.
class
fpdf.graphics_state.GraphicsStateMixinMixin class for managing a stack of graphics state variables.
method
fpdf.graphics_state.GraphicsStateMixin.char_vpos() -> CharVPosReturn vertical character position relative to line.
method
fpdf.graphics_state.GraphicsStateMixin.denom_lift() -> floatReturn lift factor for denominator text.
method
fpdf.graphics_state.GraphicsStateMixin.denom_scale() -> floatReturn scale factor for denominator text.
method
fpdf.graphics_state.GraphicsStateMixin.nom_lift() -> floatReturn lift factor for nominator text.
method
fpdf.graphics_state.GraphicsStateMixin.nom_scale() -> floatReturn scale factor for nominator text.
method
fpdf.graphics_state.GraphicsStateMixin.sub_lift() -> floatReturn lift factor for subscript text.
method
fpdf.graphics_state.GraphicsStateMixin.sub_scale() -> floatReturn scale factor for subscript text.
method
fpdf.graphics_state.GraphicsStateMixin.sup_lift() -> floatReturn lift factor for superscript text.
method
fpdf.graphics_state.GraphicsStateMixin.sup_scale() -> floatReturn scale factor for superscript text.
class
fpdf.html.HTML2FPDFRender basic HTML to FPDF
method
fpdf.html.HTML2FPDF.put_link(text:str) -> NoneInsert a hyperlink
func
fpdf.html.color_as_decimal(color:Optional[str]='#000000') -> Optional[DeviceRGB | DeviceGray]Convert a web color name to a (R, G, B) color tuple.
func
fpdf.html.parse_css_style(style_attr:str) -> dict[str, str]Parse `style="..."` HTML attributes, and return a dict of key-value
class
fpdf.image_datastructures.ImageInfoInformation about an image used in the PDF document (base class).
method
fpdf.image_datastructures.ImageInfo.height() -> floatIntrinsic image height
method
fpdf.image_datastructures.ImageInfo.width() -> floatIntrinsic image width
class
fpdf.image_datastructures.RasterImageInfoInformation about a raster image used in the PDF document
class
fpdf.image_datastructures.VectorImageInfoInformation about a vector image used in the PDF document
func
fpdf.image_parsing.is_iccp_valid(iccp:bytes, filename:str | Path) -> boolChecks the validity of an ICC profile
class
fpdf.image_parsing.temp_attrtemporary change the attribute of an object using a context manager
func
fpdf.image_parsing.transcode_monochrome(img:'PILImage') -> bytesConvert the open PIL.Image imgdata to compressed CCITT Group4 data.
func
fpdf.output.OutputProducer.esc(s:str) -> strReturn XML-escaped text suitable for XMP (attributes or text nodes).
class
fpdf.output.PDFPageLabelThis will be displayed by some PDF readers to identify pages.
class
fpdf.output.PDFXrefAndTrailerCross-reference table & file trailer
method
fpdf.pattern.Gradient.has_alpha() -> boolTrue if any stop carries alpha != 1.0.
class
fpdf.pattern.PatternRepresents a PDF Pattern object.
class
fpdf.pattern.Type2FunctionTransition between 2 colors
class
fpdf.pattern.Type2FunctionGray1‑channel exponential interpolation for alpha/luminance ramps.
func
fpdf.pattern.extract_alpha_stops(stops01:list[tuple[float, Color]]) -> list[tuple[float, float]]Return [(u, a)] with a∈[0,1]; missing alpha => 1.0.
func
fpdf.pattern.sample_stops(stops01:list[tuple[float, Color]], u:float) -> tuple[float, ...]Piecewise-linear sampling in [0,1].
func
fpdf.pattern.spread_map(u:float, method:GradientSpreadMethod) -> floatMap u∈R -> [0,1] via PAD/REPEAT/REFLECT.
class
fpdf.prefs.ViewerPreferencesSpecifies the way the document shall be displayed on the screen
class
fpdf.svg.Percentclass to represent percentage values
class
fpdf.svg.SVGLimitsConfigurable limits for SVG processing.
class
fpdf.svg.SymbolInfoReusable SVG <symbol> sizing metadata.
func
fpdf.svg.convert_transforms(tfstr:str) -> TransformConvert SVG/CSS transform functions into PDF transforms.
func
fpdf.svg.parse_viewbox(viewbox:str) -> tuple[float, float, float, float]Parse an SVG viewBox into min-x, min-y, width, and height values.
func
fpdf.svg.resolve_angle(angle_str:str, default_unit:str='deg') -> floatConvert an angle value to our canonical angle unit, radians
func
fpdf.svg.resolve_length(length_str:str, default_unit:str='pt') -> floatConvert a length unit to our canonical length unit, pt.
func
fpdf.svg.without_ns(qualified_tag:str) -> strRemove the xmlns namespace from a qualified XML tag name
func
fpdf.svg.xmlns(space:str, name:str) -> strCreate an XML namespace string representation for the given tag name.
func
fpdf.svg.xmlns_lookup(space:str, *names:str) -> dict[str, str]Create a lookup for the given name in the given XML namespace.
func
fpdf.syntax.create_list_string(list_:list[str]) -> strformat list of strings as PDF array
func
fpdf.syntax.iobj_ref(n:int) -> strformat an indirect PDF Object reference from its id number
func
fpdf.syntax.render_pdf_primitive(primitive:PDFPrimitive) -> RawRender a Python value as a PDF primitive type.
class
fpdf.table.CellInternal representation of a table cell
class
fpdf.table.RowObject that `Table.row()` yields, used to build a row in a table
method
fpdf.table.Table.row(cells:Sequence[str]=(), style:Optional[FontFace]=None, v_align:Optional[str | VAlign]=None, min_height:Optional[float]=None) -> 'Row'Adds a row to the table.
class
fpdf.template.FlexTemplateA flexible templating class.
method
fpdf.template.FlexTemplate.load_elements(elements:Sequence[dict[str, Any]]) -> NoneLoad a template definition.
method
fpdf.template.FlexTemplate.parse_csv(infile:os.PathLike[str], delimiter:str=',', decimal_sep:str='.', encoding:Optional[str]=None) -> NoneLoad the template definition from a CSV file.
method
fpdf.template.FlexTemplate.parse_json(infile:os.PathLike[str], encoding:str='utf-8') -> NoneLoad the template definition from a JSON file.
method
fpdf.template.FlexTemplate.render(offsetx:float=0.0, offsety:float=0.0, rotate:float=0.0, scale:float=1.0) -> NoneAdd the contents of the template to the PDF document.
class
fpdf.template.TemplateA simple templating class.
method
fpdf.template.Template.add_page() -> NoneFinish the current page, and proceed to the next one.
method
fpdf.template.Template.render(outfile:Optional[str]=None, dest:Optional[str]=None) -> NoneFinish the document and process all pending data.
class
fpdf.text_region.LineWrapperConnects each TextLine with the Paragraph it was written to.
class
fpdf.text_region.TextColumnarMixinEnable a TextRegion to perform page breaks
class
fpdf.text_region.TextRegionAbstract base class for all text region subclasses.
method
fpdf.text_region.TextRegion.current_x_extents(y:float, height:float) -> tuple[float, float]Return the horizontal extents of the current line.
class
fpdf.text_region.TextRegionMixinMix-in to be added to FPDF() in order to support text regions.
class
fpdf.util.FloatToleranceUtility class for floating point math with a defined tolerance.
method
fpdf.util.FloatTolerance.equal(a:float, b:float) -> boolCheck if two floats are almost equal within the defined tolerance.
method
fpdf.util.FloatTolerance.greater_than(a:float, b:float) -> boolCheck if a is greater than b considering the defined tolerance.
method
fpdf.util.FloatTolerance.is_zero(a:float) -> boolCheck if a float is almost zero within the defined tolerance.
method
fpdf.util.FloatTolerance.less_than(a:float, b:float) -> boolCheck if a is less than b considering the defined tolerance.
method
fpdf.util.FloatTolerance.not_equal(a:float, b:float) -> boolCheck if two floats are not almost equal within the defined tolerance.
func
fpdf.util.get_parsed_unicode_range(unicode_range:str | Sequence[str | int | tuple[int, int]]) -> set[int]Parse unicode_range parameter into a set of codepoints.
func
fpdf.util.get_scale_factor(unit:Union[str, Number]) -> floatGet how many pts are in a unit.
func
fpdf.util.int2roman(n:int) -> strConvert an integer to Roman numeral
func
fpdf.util.number_to_str(number:Number) -> strConvert a decimal number to a minimal string representation (no trailing 0 or .).
この情報について
掲載しているシグネチャは py-pdf/fpdf2 の公開ソースコードを
Python の ast モジュールで静的解析し、引数名・デフォルト値・
型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。
詳しくは仕組みの解説をご覧ください。