PDF

class PDF

Classes

AttributeList

DocumentStructureType

Members:

Metadata

Optional metadata to be passed into the PDF factory function.

StructureElementNode

A node in a PDF structure tree, giving a semantic representation of the content.

Methods

MakeDocument

Overloaded function.

SetNodeId

Associate a node ID with subsequent drawing commands in an Canvas.

__init__

Attributes

kAnnot

kArt

kBibEntry

kBlockQuote

kCaption

kCode

kDiv

kDocument

kFigure

kForm

kFormula

kH

kH1

kH2

kH3

kH4

kH5

kH6

kIndex

kL

kLBody

kLI

kLbl

kLink

kNonStruct

kNote

kP

kPart

kPrivate

kQuote

kRB

kRP

kRT

kReference

kRuby

kSect

kSpan

kTBody

kTD

kTFoot

kTH

kTHead

kTOC

kTOCI

kTR

kTable

kWP

kWT

kWarichu

Methods

static PDF.MakeDocument(*args, **kwargs)

Overloaded function.

  1. MakeDocument(stream: skia.WStream, metadata: skia.PDF.Metadata) -> skia.Document

    Create a PDF-backed document, writing the results into a WStream.

    PDF pages are sized in point units. 1 pt == 1/72 inch == 127/360 mm.

    stream

    A PDF document will be written to this stream. The document may write to the stream at anytime during its lifetime, until either close() is called or the document is deleted.

    metadata

    a PDFmetadata object. Any fields may be left empty.

    return

    NULL if there is an error, otherwise a newly created PDF-backed Document.

  2. MakeDocument(stream: skia.WStream) -> skia.Document

  3. MakeDocument(stream: skia.WStream, **kwargs) -> skia.Document

static PDF.SetNodeId(canvas: SkCanvas, nodeId: int) None

Associate a node ID with subsequent drawing commands in an Canvas.

The same node ID can appear in a StructureElementNode in order to associate a document’s structure element tree with its content.

A node ID of zero indicates no node ID.

Parameters
  • canvas – The canvas used to draw to the PDF.

  • nodeId – The node ID for subsequent drawing commands.

PDF.__init__(*args, **kwargs)

Attributes

PDF.kAnnot = <DocumentStructureType.kAnnot: 38>
PDF.kArt = <DocumentStructureType.kArt: 2>
PDF.kBibEntry = <DocumentStructureType.kBibEntry: 35>
PDF.kBlockQuote = <DocumentStructureType.kBlockQuote: 5>
PDF.kCaption = <DocumentStructureType.kCaption: 6>
PDF.kCode = <DocumentStructureType.kCode: 36>
PDF.kDiv = <DocumentStructureType.kDiv: 4>
PDF.kDocument = <DocumentStructureType.kDocument: 0>
PDF.kFigure = <DocumentStructureType.kFigure: 46>
PDF.kForm = <DocumentStructureType.kForm: 48>
PDF.kFormula = <DocumentStructureType.kFormula: 47>
PDF.kH = <DocumentStructureType.kH: 12>
PDF.kH1 = <DocumentStructureType.kH1: 13>
PDF.kH2 = <DocumentStructureType.kH2: 14>
PDF.kH3 = <DocumentStructureType.kH3: 15>
PDF.kH4 = <DocumentStructureType.kH4: 16>
PDF.kH5 = <DocumentStructureType.kH5: 17>
PDF.kH6 = <DocumentStructureType.kH6: 18>
PDF.kIndex = <DocumentStructureType.kIndex: 9>
PDF.kL = <DocumentStructureType.kL: 20>
PDF.kLBody = <DocumentStructureType.kLBody: 23>
PDF.kLI = <DocumentStructureType.kLI: 21>
PDF.kLbl = <DocumentStructureType.kLbl: 22>
PDF.kNonStruct = <DocumentStructureType.kNonStruct: 10>
PDF.kNote = <DocumentStructureType.kNote: 33>
PDF.kP = <DocumentStructureType.kP: 19>
PDF.kPart = <DocumentStructureType.kPart: 1>
PDF.kPrivate = <DocumentStructureType.kPrivate: 11>
PDF.kQuote = <DocumentStructureType.kQuote: 32>
PDF.kRB = <DocumentStructureType.kRB: 40>
PDF.kRP = <DocumentStructureType.kRP: 42>
PDF.kRT = <DocumentStructureType.kRT: 41>
PDF.kReference = <DocumentStructureType.kReference: 34>
PDF.kRuby = <DocumentStructureType.kRuby: 39>
PDF.kSect = <DocumentStructureType.kSect: 3>
PDF.kSpan = <DocumentStructureType.kSpan: 31>
PDF.kTBody = <DocumentStructureType.kTBody: 29>
PDF.kTD = <DocumentStructureType.kTD: 27>
PDF.kTFoot = <DocumentStructureType.kTFoot: 30>
PDF.kTH = <DocumentStructureType.kTH: 26>
PDF.kTHead = <DocumentStructureType.kTHead: 28>
PDF.kTOC = <DocumentStructureType.kTOC: 7>
PDF.kTOCI = <DocumentStructureType.kTOCI: 8>
PDF.kTR = <DocumentStructureType.kTR: 25>
PDF.kTable = <DocumentStructureType.kTable: 24>
PDF.kWP = <DocumentStructureType.kWP: 45>
PDF.kWT = <DocumentStructureType.kWT: 44>
PDF.kWarichu = <DocumentStructureType.kWarichu: 43>