Record Class PageSize
java.lang.Object
java.lang.Record
org.eclipse.swt.printing.PageSize
- Record Components:
width- the width of the page in points (1/72 inch)height- the height of the page in points (1/72 inch)
A
PageSize represents the dimensions of a page in points
(1 point = 1/72 inch), as used in PDF documents and printing.
This record provides predefined constants for common paper sizes that are supported across all platforms (Windows, GTK, macOS). Using these constants avoids confusion between points and pixels and ensures consistent page dimensions.
Example usage:
PDFDocument pdf = new PDFDocument("output.pdf", PageSize.A4);
GC gc = new GC(pdf);
gc.drawText("Hello, PDF!", 100, 100);
gc.dispose();
pdf.dispose();
- Since:
- 3.133
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PageSizeISO A3 size: 297 x 420 mm (842 x 1191 points)static final PageSizeISO A4 size: 210 x 297 mm (595 x 842 points)static final PageSizeISO A5 size: 148 x 210 mm (420 x 595 points)static final PageSizeUS Executive size: 7.25 x 10.5 inches (522 x 756 points)private final doubleThe field for theheightrecord component.static final PageSizeUS Legal size: 8.5 x 14 inches (612 x 1008 points)static final PageSizeUS Letter size: 8.5 x 11 inches (612 x 792 points)static final PageSizeUS Tabloid size: 11 x 17 inches (792 x 1224 points)private final doubleThe field for thewidthrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPageSize(double width, double height) Creates an instance of aPageSizerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleheight()Returns the value of theheightrecord component.final StringtoString()Returns a string representation of this record class.doublewidth()Returns the value of thewidthrecord component.
-
Field Details
-
width
private final double widthThe field for thewidthrecord component. -
height
private final double heightThe field for theheightrecord component. -
LETTER
US Letter size: 8.5 x 11 inches (612 x 792 points) -
LEGAL
US Legal size: 8.5 x 14 inches (612 x 1008 points) -
A3
ISO A3 size: 297 x 420 mm (842 x 1191 points) -
A4
ISO A4 size: 210 x 297 mm (595 x 842 points) -
A5
ISO A5 size: 148 x 210 mm (420 x 595 points) -
EXECUTIVE
US Executive size: 7.25 x 10.5 inches (522 x 756 points) -
TABLOID
US Tabloid size: 11 x 17 inches (792 x 1224 points)
-
-
Constructor Details
-
PageSize
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
width
-
height
-