Flutter Engine
The Flutter Engine
Classes | Functions
SkPDF Namespace Reference

Classes

class  AttributeList
 
struct  DateTime
 
struct  Metadata
 
struct  StructureElementNode
 

Functions

SK_API void SetNodeId (SkCanvas *dst, int nodeID)
 
SK_API sk_sp< SkDocumentMakeDocument (SkWStream *stream, const Metadata &metadata)
 
static sk_sp< SkDocumentMakeDocument (SkWStream *stream)
 

Function Documentation

◆ MakeDocument() [1/2]

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

Definition at line 216 of file SkPDFDocument.h.

216 {
217 return MakeDocument(stream, Metadata());
218}
static sk_sp< SkDocument > MakeDocument(SkWStream *stream)

◆ MakeDocument() [2/2]

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.

Definition at line 14 of file SkDocument_PDF_None.cpp.

14{ return nullptr; }

◆ SetNodeId()

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.

Definition at line 16 of file SkDocument_PDF_None.cpp.

16 {
17 c->drawAnnotation({0, 0, 0, 0}, "PDF_Node_Key", SkData::MakeWithCopy(&n, sizeof(n)).get());
18}
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
Definition: SkData.cpp:111
T * get() const
Definition: SkRefCnt.h:303