Skip to main content

@pdfme/common

Type aliases

Alignment

Ƭ Alignment: z.infer<typeof Alignment>

Defined in

type.ts:39


BarCodeType

Ƭ BarCodeType: z.infer<typeof BarcodeSchemaType>

Defined in

type.ts:41


BarcodeSchema

Ƭ BarcodeSchema: z.infer<typeof BarcodeSchema>

Defined in

type.ts:44


BasePdf

Ƭ BasePdf: z.infer<typeof BasePdf>

Defined in

type.ts:48


CommonProps

Ƭ CommonProps: z.infer<typeof CommonProps>

Defined in

type.ts:50


DesignerProps

Ƭ DesignerProps: z.infer<typeof DesignerProps>

Defined in

type.ts:57


DesignerReactProps

Ƭ DesignerReactProps: z.infer<typeof DesignerReactProps>

Defined in

type.ts:58


Font

Ƭ Font: z.infer<typeof Font>

Defined in

type.ts:47


GenerateProps

Ƭ GenerateProps: z.infer<typeof GenerateProps>

Defined in

type.ts:52


GeneratorOptions

Ƭ GeneratorOptions: z.infer<typeof GeneratorOptions>

Defined in

type.ts:51


ImageSchema

Ƭ ImageSchema: z.infer<typeof ImageSchema>

Defined in

type.ts:43


Lang

Ƭ Lang: z.infer<typeof Lang>

Defined in

type.ts:37


PreviewProps

Ƭ PreviewProps: z.infer<typeof PreviewProps>

Defined in

type.ts:55


PreviewReactProps

Ƭ PreviewReactProps: z.infer<typeof PreviewReactProps>

Defined in

type.ts:56


Schema

Ƭ Schema: z.infer<typeof Schema>

Defined in

type.ts:45


SchemaForUI

Ƭ SchemaForUI: z.infer<typeof SchemaForUI>

Defined in

type.ts:46


SchemaType

Ƭ SchemaType: z.infer<typeof SchemaType>

Defined in

type.ts:40


Size

Ƭ Size: z.infer<typeof Size>

Defined in

type.ts:38


Template

Ƭ Template: z.infer<typeof Template>

Defined in

type.ts:49


TextSchema

Ƭ TextSchema: z.infer<typeof TextSchema>

Defined in

type.ts:42


UIOptions

Ƭ UIOptions: z.infer<typeof UIOptions>

Defined in

type.ts:53


UIProps

Ƭ UIProps: z.infer<typeof UIProps>

Defined in

type.ts:54

Variables

BLANK_PDF

BLANK_P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CjUzMgolJUVPRgo="

Defined in

constants.ts:7


DEFAULT_ALIGNMENT

DEFAULT_ALIGNMENT: "left"

Defined in

constants.ts:2


DEFAULT_CHARACTER_SPACING

DEFAULT_CHARACTER_SPACING: 0

Defined in

constants.ts:4


DEFAULT_FONT_COLOR

DEFAULT_FONT_COLOR: "#000"

Defined in

constants.ts:5


DEFAULT_FONT_SIZE

DEFAULT_FONT_SIZE: 13

Defined in

constants.ts:1


DEFAULT_LINE_HEIGHT

DEFAULT_LINE_HEIGHT: 1

Defined in

constants.ts:3


schemaTypes

schemaTypes: readonly ["text", "image", "qrcode", "japanpost", "ean13", "ean8", "code39", "code128", "nw7", "itf14", "upca", "upce"] = _schemaTypes

Defined in

type.ts:31

Functions

b64toUint8Array

Const b64toUint8Array(base64): Uint8Array

Parameters

NameType
base64string

Returns

Uint8Array

Defined in

helper.ts:53


checkDesignerProps

Const checkDesignerProps(data): void

Parameters

NameType
dataunknown

Returns

void

Defined in

helper.ts:150


checkFont

Const checkFont(arg): void

Parameters

NameType
argObject
arg.fontRecord<string, { data: ArrayBuffer | Uint8Array ; fallback: undefined | boolean ; subset: undefined | boolean }>
arg.templateObject
arg.template.basePdfstring | ArrayBuffer | Uint8Array
arg.template.columnsundefined | string[]
arg.template.sampledataundefined | Record<string, string>[]
arg.template.schemasRecord<string, { alignment: undefined | "left" | "center" | "right" ; backgroundColor: undefined | string ; characterSpacing: undefined | number ; fontColor: undefined | string ; fontName: undefined | string ; fontSize: undefined | number ; height: number ; lineHeight: undefined | number ; position: { x: number; y: number; } ; rotate: undefined | number ; type: "text" ; width: number } | { height: number ; position: { x: number; y: number; } ; rotate: undefined | number ; type: "image" ; width: number } | { height: number ; position: { x: number; y: number; } ; rotate: undefined | number ; type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce" ; width: number }>[]

Returns

void

Defined in

helper.ts:93


checkGenerateProps

Const checkGenerateProps(data): void

Parameters

NameType
dataunknown

Returns

void

Defined in

helper.ts:151


checkInputs

Const checkInputs(data): void

Parameters

NameType
dataunknown

Returns

void

Defined in

helper.ts:145


checkPreviewProps

Const checkPreviewProps(data): void

Parameters

NameType
dataunknown

Returns

void

Defined in

helper.ts:149


checkTemplate

Const checkTemplate(data): void

Parameters

NameType
dataunknown

Returns

void

Defined in

helper.ts:147


checkUIOptions

Const checkUIOptions(data): void

Parameters

NameType
dataunknown

Returns

void

Defined in

helper.ts:146


checkUIProps

Const checkUIProps(data): void

Parameters

NameType
dataunknown

Returns

void

Defined in

helper.ts:148


getB64BasePdf

Const getB64BasePdf(basePdf): string | Promise<string>

Parameters

NameType
basePdfstring | ArrayBuffer | Uint8Array

Returns

string | Promise<string>

Defined in

helper.ts:30


getDefaultFont

Const getDefaultFont(): Record<string, { data: ArrayBuffer | Uint8Array ; fallback: undefined | boolean ; subset: undefined | boolean }>

Returns

Record<string, { data: ArrayBuffer | Uint8Array ; fallback: undefined | boolean ; subset: undefined | boolean }>

Defined in

helper.ts:79


getFallbackFontName

Const getFallbackFontName(font): string

Parameters

NameType
fontRecord<string, { data: ArrayBuffer | Uint8Array ; fallback: undefined | boolean ; subset: undefined | boolean }>

Returns

string

Defined in

helper.ts:65


isBarcodeSchema

Const isBarcodeSchema(arg): arg is Object

Parameters

NameType
argObject
arg.heightnumber
arg.position{ x: number; y: number; }
arg.rotateundefined | number
arg.type"text" | "image" | "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce"
arg.widthnumber

Returns

arg is Object

Defined in

type.ts:34


isImageSchema

Const isImageSchema(arg): arg is Object

Parameters

NameType
argObject
arg.heightnumber
arg.position{ x: number; y: number; }
arg.rotateundefined | number
arg.type"text" | "image" | "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce"
arg.widthnumber

Returns

arg is Object

Defined in

type.ts:33


isTextSchema

Const isTextSchema(arg): arg is Object

Parameters

NameType
argObject
arg.heightnumber
arg.position{ x: number; y: number; }
arg.rotateundefined | number
arg.type"text" | "image" | "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce"
arg.widthnumber

Returns

arg is Object

Defined in

type.ts:32


validateBarcodeInput

Const validateBarcodeInput(type, input): boolean

Parameters

NameType
type"qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce"
inputstring

Returns

boolean

Defined in

helper.ts:175