Pdfmake: Predefined page sizes

Created on 12 Mar 2014  路  3Comments  路  Source: bpampuch/pdfmake

It would be nice if one could declaratively define a desired page size. The docuement definition object now supports this syntax:

var dd = {
    content: someContentObject,
    pageSize: {
        width: pageWidth,
        height: pageHeight
    }
};

I'd like to be able to define it like that:

var dd = {
    content: someContentObject,
    pageSize: 'A4' // A3, A5 or other standard page sizes
};

Most helpful comment

@jayiconcmo Taking this file as reference :- https://github.com/bpampuch/pdfmake/blob/7b5675d5b9d5d7b815bd721e00504b16560a6382/src/standardPageSizes.js

I'd say width and height are in pixels as per 72 DPI.

All 3 comments

you can now use: 4a0, 2a0, a0, ... a10, b0, ... b10, c0, ... c10, ra0, ... ra4, sra0, ... sra4, executive, folio, legal, letter, tabloid

Trying to make labels. What is the measurement in for me to set the width and height? Is it inches, CM, MM, and so on?

@jayiconcmo Taking this file as reference :- https://github.com/bpampuch/pdfmake/blob/7b5675d5b9d5d7b815bd721e00504b16560a6382/src/standardPageSizes.js

I'd say width and height are in pixels as per 72 DPI.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaelqiji picture michaelqiji  路  3Comments

jokris1 picture jokris1  路  3Comments

svenyonson picture svenyonson  路  3Comments

MathLavallee picture MathLavallee  路  3Comments

Christian24 picture Christian24  路  3Comments