Skip to content

BRLMCustomPaperSize

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

initRollWithTapeWidth:margins:unitOfLength:

Initialize this object with parameters of a roll paper size.

Declaration

- (instancetype) initRollWithTapeWidth:(CGFloat) tapeWidth
                               margins:(BRLMCustomPaperSizeMargins) margins
                          unitOfLength:(BRLMCustomPaperSizeLengthUnit) unit;

Parameters

Name Type Description
tapeWidth CGFloat Width of the paper
margins BRLMCustomPaperSizeMargins Margins against the printable area
unit BRLMCustomPaperSizeLengthUnit Inch or mm

Return Value

An instance of this class.

initDieCutWithTapeWidth:tapeLength:margins:gapLength:unitOfLength:

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

Declaration

- (instancetype) initDieCutWithTapeWidth:(CGFloat) tapeWidth
                              tapeLength:(CGFloat) tapeLength
                                 margins:(BRLMCustomPaperSizeMargins) margins
                               gapLength:(CGFloat) gapLength
                            unitOfLength:(BRLMCustomPaperSizeLengthUnit) unit;

Parameters

Name Type Description
tapeWidth CGFloat Width of the paper
tapeLength CGFloat Length of the paper
margins BRLMCustomPaperSizeMargins Margins against the printable area
gapLength CGFloat Gap between each label
unit BRLMCustomPaperSizeLengthUnit Inch or mm

Return Value

An instance of this class.

initMarkRollWithTapeWidth:tapeLength:margins:markPosition:markHeight:unitOfLength:

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

Declaration

- (instancetype) initMarkRollWithTapeWidth:(CGFloat) tapeWidth
                                tapeLength:(CGFloat) tapeLength
                                   margins:(BRLMCustomPaperSizeMargins)margins
                              markPosition:(CGFloat) markVerticalOffset
                                markHeight:(CGFloat) markLength
                              unitOfLength:(BRLMCustomPaperSizeLengthUnit) unit;

Parameters

Name Type Description
tapeWidth CGFloat Width of the paper
tapeLength CGFloat Length of the paper
margins BRLMCustomPaperSizeMargins Margins against the printable area
markVerticalOffset CGFloat Vertical offset of the marks
markLength CGFloat Length of the marks
unit BRLMCustomPaperSizeLengthUnit Inch or mm

Return Value

An instance of this class.

initWithFile:

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

Declaration

- (instancetype)initWithFile:(NSURL *)filePath;

Parameters

Name Type Description
filePath NSURL* Filepath of the binary file containing paper size

Return Value

An instance of this class.

Properties

paperKind

Declaration

@property (nonatomic, readonly) BRLMCustomPaperSizePaperKind paperKind;

paperBinFilePath

Declaration

@property (nonatomic, nullable, readonly) NSURL *paperBinFilePath;

tapeWidth

Declaration

@property (nonatomic, readonly) CGFloat tapeWidth;

tapeLength

Declaration

@property (nonatomic, readonly) CGFloat tapeLength;

margins

Declaration

@property (nonatomic, readonly) BRLMCustomPaperSizeMargins margins;

gapLength

Declaration

@property (nonatomic, readonly) CGFloat gapLength;

markVerticalOffset

Declaration

@property (nonatomic, readonly) CGFloat markVerticalOffset;

markLength

Declaration

@property (nonatomic, readonly) CGFloat markLength;

unit

Declaration

@property (nonatomic, readonly) BRLMCustomPaperSizeLengthUnit unit;

Types

BRLMCustomPaperSizeLengthUnit

Declaration

typedef NS_ENUM(NSInteger, BRLMCustomPaperSizeLengthUnit) {
    BRLMCustomPaperSizeLengthUnitInch,
    BRLMCustomPaperSizeLengthUnitMm,
};

BRLMCustomPaperSizePaperKind

Declaration

typedef NS_ENUM(NSInteger, BRLMCustomPaperSizePaperKind) {
    BRLMCustomPaperSizePaperKindRoll,
    BRLMCustomPaperSizePaperKindDieCut,
    BRLMCustomPaperSizePaperKindMarkRoll,
    BRLMCustomPaperSizePaperKindByFile,
};

BRLMCustomPaperSizeMargins

Declaration

typedef struct
{
    CGFloat top;
    CGFloat left;
    CGFloat bottom;
    CGFloat right;
} BRLMCustomPaperSizeMargins;