Skia
2D Graphics Library
SkPDF Namespace Reference

Classes

class  AttributeList
 Attributes for nodes in the PDF tree. More...
 
struct  StructureElementNode
 A node in a PDF structure tree, giving a semantic representation of the content. More...
 
struct  DateTime
 
struct  Metadata
 Optional metadata to be passed into the PDF factory function. More...
 

Functions

SK_API void SetNodeId (SkCanvas *dst, int nodeID)
 Associate a node ID with subsequent drawing commands in an SkCanvas. More...
 
SK_API sk_sp< SkDocumentMakeDocument (SkWStream *stream, const Metadata &metadata)
 Create a PDF-backed document, writing the results into a SkWStream. More...
 
static sk_sp< SkDocumentMakeDocument (SkWStream *stream)
 

Function Documentation

◆ MakeDocument() [1/2]

static sk_sp<SkDocument> SkPDF::MakeDocument ( SkWStream stream)
inlinestatic

◆ MakeDocument() [2/2]

SK_API sk_sp<SkDocument> SkPDF::MakeDocument ( SkWStream stream,
const Metadata metadata 
)

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

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

Parameters
streamA 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.
metadataa PDFmetadata object. Any fields may be left empty.
Returns
NULL if there is an error, otherwise a newly created PDF-backed SkDocument.

◆ SetNodeId()

SK_API void SkPDF::SetNodeId ( SkCanvas dst,
int  nodeID 
)

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

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
canvasThe canvas used to draw to the PDF.
nodeIdThe node ID for subsequent drawing commands.