Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.15 KB

filespec.md

File metadata and controls

56 lines (39 loc) · 1.15 KB

API Documentation for FileSpec

NoPoDoFo FileSpec

A FileSpec Dictionary is used for embedding files in a PDF. This dictionary contains keys:

  • F: filename
  • UF: filename as utf16
  • EF: the embedded file

The simplist method for attaching a file is using Document.attachFile.

class FileSpec {

  new(file: string, doc: Base, embed?: boolean): FileSpec
  new(obj: Object): FileSpec

  readonly name: string

  getContents(): Buffer
}

Constructors


new(file: string, doc: Base, embed?: boolean): FileSpec

Constructs a new FileSpec Dictionary with the file provided and attached to the Document.

Properties


name

The name of the file as utf8

Methods


getContents

getContents(): Buffer

Get the contents of a file