CustomPaperSize

A class to set custom paper/label size.

Overview

RJ/TD series support printing on papers that are not standard size such as a third-party paper/label. PJ also supports not only those and also standard size papers such as A4 and letter. There are two ways to set the paper size for your printing. One is that you create a binary file by using a Setting Tool on Windows and set its filepath to this class. The other is that you set parameters of the paper size by using following initializations.

Instance methods

newRollPaperSize

Initialize this object with parameters of a roll paper size.

Declaration

public static CustomPaperSize newRollPaperSize(float width, Margins margins, Unit unit);

Parameters

Name Type Description
width float Width of the paper
margins Margins Margins against the printable area
unit Unit Inch or mm

Return Value

An instance of this class.

newDieCutPaperSize

Initialize this object with parameters for a die-cut paper size.

Declaration

public static CustomPaperSize newDieCutPaperSize(float width, float length, Margins margins, float gapLength, Unit unit);

Parameters

Name Type Description
width float Width of the paper
length float Length of the paper
margins CustomPaperSizeMargins Margins against the printable area
gapLength float Gap between each label
unit CustomPaperSizeLengthUnit Inch or mm

Return Value

An instance of this class.

newMarkRollPaperSize

Initialize this object with parameters of a marked roll paper size.

Declaration

public static CustomPaperSize newMarkRollPaperSize(float width, float length, Margins margins, float markVertialOffset, float markLength, Unit unit);

Parameters

Name Type Description
width float Width of the paper
length float Length of the paper
margins CustomPaperSizeMargins Margins against the printable area
markVerticalOffset float Vertical offset of the marks
markLength float Length of the marks
unit CustomPaperSizeLengthUnit Inch or mm

Return Value

An instance of this class.

newFile

Initialize this object with a filepath of a binary file including paper size data.

Declaration

public static CustomPaperSize newFile(String paperBinFilePath);

Parameters

Name Type Description
paperBinFilePath String Filepath of the binary file containing paper size

Return Value

An instance of this class.

Properties

paperKind

Declaration

public PaperKind getPaperKind();

paperBinFilePath

Declaration

public String getPaperBinFilePath();

tapeWidth

Declaration

public float getWidth();

tapeLength

Declaration

public float getLength();

margins

Declaration

public Margins getMargins();

gapLength

Declaration

public float getGapLength();

markVerticalOffset

Declaration

public float getMarkVerticalOffset();

markLength

Declaration

public float getMarkLength();

unit

Declaration

public Unit getUnit();

Types

CustomPaperSizeLengthUnit

Declaration

public enum Unit {
    Inch,
    Mm,
}

PaperKind

Declaration

public enum PaperKind {
    Roll,
    DieCut,
    MarkRoll,
    ByFile,
}

Margins

Declaration

public static class Margins implements Serializable {
    public float top;
    public float left;
    public float bottom;
    public float right;
}