mfullstackdev
mfullstackdev

Reputation: 55

What units does itext use for page size and margin?

What units does itext use for page size and margin? What is llx, lly, urx, ury?
Document document = new Document( new RectangleReadOnly(dimension.getRectangle()), marginLeft, 0, marginTop, 0 );

public RectangleReadOnly(Rectangle rect) {
    super(rect.llx, rect.lly, rect.urx, rect.ury);
    super.cloneNonPositionParameters(rect);
}

public Document(Rectangle pageSize, float marginLeft, float marginRight, float marginTop, float marginBottom) {

Upvotes: 0

Views: 921

Answers (1)

mkl
mkl

Reputation: 95918

The units are the PDF default user space units which default to 1/72 inch.

On a per-page basis this unit can be changed by setting the UserUnit page property:

Key Type Value
UserUnit number (Optional; PDF 1.6) A positive number that shall give the size of default user space units, in multiples of 1 ⁄ 72 inch. The range of supported values shall be implementation-dependent.
Default value: 1.0 (user space unit is 1 ⁄ 72 inch).

(ISO 32000-2, Table 31 — Entries in a page object)

Beware and take The range of supported values shall be implementation-dependent seriously - some viewers only support positive integer values, some only values >=1, some ignore it altogether.

Upvotes: 1

Related Questions