#ifndef SkPDFDocument_DEFINED
#define SkPDFDocument_DEFINED
#include "SkDocument.h"
#include "SkScalar.h"
#include "SkString.h"
#include "SkTime.h"
namespace SkPDF {
enum class DocumentStructureType {
kDocument,
kPart,
kArt, kSect, kDiv,
kBlockQuote,
kCaption,
kTOC, kTOCI, kIndex,
kNonStruct,
kPrivate,
kH, kH1, kH2,
kH3,
kH4,
kH5,
kH6, kP, kL, kLI, kLbl, kLBody, kTable,
kTR,
kTH,
kTD,
kTHead,
kTBody,
kTFoot,
kSpan,
kQuote,
kNote,
kReference,
kBibEntry,
kCode,
kLink,
kAnnot,
kRuby,
kWarichu,
kFigure,
kFormula,
kForm, };
struct StructureElementNode {
const StructureElementNode* fChildren = nullptr;
size_t fChildCount;
int fNodeId;
DocumentStructureType fType;
};
struct Metadata {
SkString fTitle;
SkString fAuthor;
SkString fSubject;
SkString fKeywords;
SkString fCreator;
SkString fProducer;
SkTime::DateTime fCreation = {0, 0, 0, 0, 0, 0, 0, 0};
SkTime::DateTime fModified = {0, 0, 0, 0, 0, 0, 0, 0};
SkScalar fRasterDPI = SK_ScalarDefaultRasterDPI;
bool fPDFA = false;
int fEncodingQuality = 101;
const StructureElementNode* fStructureElementTreeRoot = nullptr;
};
SK_API void SetNodeId(SkCanvas* dst, int nodeID);
SK_API sk_sp<SkDocument> MakeDocument(SkWStream* stream, const Metadata& metadata);
static inline sk_sp<SkDocument> MakeDocument(SkWStream* stream) {
return MakeDocument(stream, Metadata());
}
} #endif