Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

PDFDocument

class PDFDocument extends Document {
constructor();
constructor(data: Buffer | ArrayBuffer | Uint8Array);
constructor(pointer: Pointer<"any_document">);
_fromPDFObjectKeep(ptr: Pointer<"pdf_obj">): PDFObject;
_fromPDFObjectNew(ptr: Pointer<"pdf_obj">): PDFObject;
_PDFOBJ(obj: any): Pointer<"pdf_obj">;
_toPDFObject(obj: any): PDFObject;
abandonOperation(): void;
addCJKFont(
font: Font,
lang: FontCJKOrdering | FontCJKLanguage,
wmode?: number,
serif?: boolean,
): PDFObject;
addEmbeddedFile(
filename: string,
mimetype: string,
contents: AnyBuffer,
created: Date,
modified: Date,
checksum?: boolean,
): PDFObject;
addFont(font: Font): PDFObject;
addImage(image: Image): PDFObject;
addObject(obj: any): PDFObject;
addPage(
mediabox: Rect,
rotate: Rotate,
resources: any,
contents: AnyBuffer,
): PDFObject;
addRawStream(buf: AnyBuffer, obj: any): PDFObject;
addSimpleFont(font: Font, encoding?: FontSimpleEncoding): PDFObject;
addStream(buf: AnyBuffer, obj: any): PDFObject;
bake(bakeAnnots?: boolean, bakeWidgets?: boolean): void;
beginImplicitOperation(): void;
beginOperation(op: string): void;
canBeSavedIncrementally(): boolean;
canRedo(): boolean;
canUndo(): boolean;
countObjects(): number;
countUnsavedVersions(): number;
countVersions(): number;
createObject(): PDFObject;
deleteObject(num: number | PDFObject): void;
deletePage(at: number): void;
deletePageLabels(index: number): void;
disableJS(): void;
enableJournal(): void;
enableJS(): void;
endOperation(): void;
findPage(index: number): PDFObject;
getEmbeddedFileContents(ref: PDFObject): Buffer | null;
getEmbeddedFileParams(ref: PDFObject): {
filename: string;
mimetype: string;
size: Pointer<"char">;
creationDate: Date;
modificationDate: Date;
}
;
getEmbeddedFiles(): any;
getJournal(): {
position: number;
steps: string[];
}
;
getLanguage(): string;
getTrailer(): PDFObject;
getVersion(): number;
graftObject(obj: PDFObject): PDFObject;
graftPage(
to: number,
srcDoc: PDFDocument,
srcPage: number,
): void;
hasUnsavedChanges(): boolean;
insertPage(at: number, obj: PDFObject): void;
isEmbeddedFile(ref: PDFObject): number;
isJSSupported(): boolean;
loadImage(ref: PDFObject): Image;
loadPage(index: number): PDFPage;
newArray(cap?: number): PDFObject;
newBoolean(v: boolean): PDFObject;
newByteString(v: Uint8Array): PDFObject;
newDictionary(cap?: number): PDFObject;
newGraftMap(): PDFGraftMap;
newIndirect(v: number): PDFObject;
newInteger(v: number): PDFObject;
newName(v: string): PDFObject;
newNull(): PDFObject;
newReal(v: number): PDFObject;
newString(v: string): PDFObject;
rearrangePages(pages: number[]): void;
redo(): void;
saveToBuffer(options?: string): Buffer;
setJSEventListener(_listener: any): void;
setLanguage(lang: string): void;
setPageLabels(
index: number,
style?: string,
prefix?: string,
start?: number,
): void;
undo(): void;
validateChangeHistory(): number;
wasRepaired(): boolean;
 
static readonly PAGE_LABEL_ALPHA_LC: string;
static readonly PAGE_LABEL_ALPHA_UC: string;
static readonly PAGE_LABEL_DECIMAL: string;
static readonly PAGE_LABEL_NONE: string;
static readonly PAGE_LABEL_ROMAN_LC: string;
static readonly PAGE_LABEL_ROMAN_UC: string;
}

§Extends

§
Document
[src]

§Constructors

§
new PDFDocument()
[src]
§
new PDFDocument(data: Buffer | ArrayBuffer | Uint8Array)
[src]
§
new PDFDocument(pointer: Pointer<"any_document">)
[src]

§Methods

§
_fromPDFObjectKeep(ptr: Pointer<"pdf_obj">): PDFObject
[src]
§
_fromPDFObjectNew(ptr: Pointer<"pdf_obj">): PDFObject
[src]
§
_PDFOBJ(obj: any): Pointer<"pdf_obj">
[src]
§
_toPDFObject(obj: any): PDFObject
[src]
§
abandonOperation(): void
[src]
§
addCJKFont(font: Font, lang: FontCJKOrdering | FontCJKLanguage, wmode?: number, serif?: boolean): PDFObject
[src]
§
addEmbeddedFile(filename: string, mimetype: string, contents: AnyBuffer, created: Date, modified: Date, checksum?: boolean): PDFObject
[src]
§
addFont(font: Font): PDFObject
[src]
§
addImage(image: Image): PDFObject
[src]
§
addObject(obj: any): PDFObject
[src]
§
addPage(mediabox: Rect, rotate: Rotate, resources: any, contents: AnyBuffer): PDFObject
[src]
§
addRawStream(buf: AnyBuffer, obj: any): PDFObject
[src]
§
addSimpleFont(font: Font, encoding?: FontSimpleEncoding): PDFObject
[src]
§
addStream(buf: AnyBuffer, obj: any): PDFObject
[src]
§
bake(bakeAnnots?: boolean, bakeWidgets?: boolean): void
[src]
§
beginImplicitOperation(): void
[src]
§
beginOperation(op: string): void
[src]
§
canBeSavedIncrementally(): boolean
[src]
§
canRedo(): boolean
[src]
§
canUndo(): boolean
[src]
§
countObjects(): number
[src]
§
countUnsavedVersions(): number
[src]
§
countVersions(): number
[src]
§
createObject(): PDFObject
[src]
§
deleteObject(num: number | PDFObject): void
[src]
§
deletePage(at: number): void
[src]
§
deletePageLabels(index: number): void
[src]
§
disableJS(): void
[src]
§
enableJournal(): void
[src]
§
enableJS(): void
[src]
§
endOperation(): void
[src]
§
findPage(index: number): PDFObject
[src]
§
getEmbeddedFileContents(ref: PDFObject): Buffer | null
[src]
§
getEmbeddedFileParams(ref: PDFObject): {
filename: string;
mimetype: string;
size: Pointer<"char">;
creationDate: Date;
modificationDate: Date;
}
[src]
§
getEmbeddedFiles(): any
[src]
§
getJournal(): {
position: number;
steps: string[];
}
[src]
§
getLanguage(): string
[src]
§
getTrailer(): PDFObject
[src]
§
getVersion(): number
[src]
§
graftObject(obj: PDFObject): PDFObject
[src]
§
graftPage(to: number, srcDoc: PDFDocument, srcPage: number): void
[src]
§
hasUnsavedChanges(): boolean
[src]
§
insertPage(at: number, obj: PDFObject): void
[src]
§
isEmbeddedFile(ref: PDFObject): number
[src]
§
isJSSupported(): boolean
[src]
§
loadImage(ref: PDFObject): Image
[src]
§
loadPage(index: number): PDFPage
[src]
§
newArray(cap?: number): PDFObject
[src]
§
newBoolean(v: boolean): PDFObject
[src]
§
newByteString(v: Uint8Array): PDFObject
[src]
§
newDictionary(cap?: number): PDFObject
[src]
§
newGraftMap(): PDFGraftMap
[src]
§
newIndirect(v: number): PDFObject
[src]
§
newInteger(v: number): PDFObject
[src]
§
newName(v: string): PDFObject
[src]
§
newNull(): PDFObject
[src]
§
newReal(v: number): PDFObject
[src]
§
newString(v: string): PDFObject
[src]
§
rearrangePages(pages: number[]): void
[src]
§
redo(): void
[src]
§
saveToBuffer(options?: string): Buffer
[src]
§
setJSEventListener(_listener: any): void
[src]
§
setLanguage(lang: string): void
[src]
§
setPageLabels(index: number, style?: string, prefix?: string, start?: number): void
[src]
§
undo(): void
[src]
§
validateChangeHistory(): number
[src]
§
wasRepaired(): boolean
[src]

§Static Properties

§
PAGE_LABEL_ALPHA_LC: string
[src]
§
PAGE_LABEL_ALPHA_UC: string
[src]
§
PAGE_LABEL_DECIMAL: string
[src]
§
PAGE_LABEL_NONE: string
[src]
§
PAGE_LABEL_ROMAN_LC: string
[src]
§
PAGE_LABEL_ROMAN_UC: string
[src]