Documentation
¶
Overview ¶
The pdf package enables creating and manipulating PDF documents.
var lib = require('pdf'); var pdf = lib("xxxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx"); var doc = new pdf({ masterpassword: '123456', permissions: "noprint nohiresprint nocopy nomodify noaccessible noassemble", }); doc.page(595, 842); doc.pipe(context.res.body);
Index ¶
- func New(orb *orbit.Orbit) interface{}
- type Doc
- func (this *Doc) Embed(call otto.FunctionCall) otto.Value
- func (this *Doc) Find(callback otto.Value)
- func (this *Doc) Flow(call otto.FunctionCall) otto.Value
- func (this *Doc) Font(name string, rdr io.Reader) *Font
- func (this *Doc) Load(rdr io.Reader) *File
- func (this *Doc) Page(call otto.FunctionCall) otto.Value
- func (this *Doc) Pipe(wtr io.Writer)
- type File
- type Flow
- type Font
- type Graphics
- type Leaf
- type Lib
- type Module
- type Page
- type State
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Doc ¶
type Doc struct { Graphics *Graphics // contains filtered or unexported fields }
func (*Doc) Find ¶
Find adds a callback function which is used to load fonts.
var lib = require('pdf')(); var doc = new lib(); doc.find(function(name) { console.log('Searching for font:', name); return require('file').load("fonts/" + name + ".ttf"); });
func (*Doc) Font ¶
Font loads a font which can be used in a subsequent text area. The specified name of the font is the same name which must be used in subsequent text calls.
var lib = require('pdf')(); var doc = new lib(); doc.font("Arial", require('file').load("arial.ttf"));
func (*Doc) Load ¶
Load loads a file for processing, enabling page manipulation, copying, and placement.
var lib = require('pdf')(); var doc = new lib(); var pdf = doc.Load( require('file').load("other.pdf") ); for (var i=1; i<=pdf.pages(); i++) { console.log( pdf.page(i).width(), 'x', pdf.page(i).height() ); }
Click to show internal directories.
Click to hide internal directories.