Pdf - Static Functions
18 Nov 20265 minutes to read
Root static functions of Pdf Component
_code128Check
Calculates the Mod-103 check value: the start value plus each following symbol value times its one-based position.
| Parameter | Type | Description |
|---|---|---|
| symbols | number[] |
The start symbol followed by the data and switch symbols. |
Returns number
_createCode128Plan
Builds the immutable plan from logical symbols; the check symbol and stop are appended here.
| Parameter | Type | Description |
|---|---|---|
| symbols | number[] |
The start symbol followed by the data and switch symbols. |
| caption | string |
The human-readable text, which never contains control symbols. |
Returns _UniPlan
_eanCheckDigit
Calculates the modulo-10 check digit of a numeric string whose last digit is weighted 3.
| Parameter | Type | Description |
|---|---|---|
| digits | string |
The data digits without the check digit. |
Returns number
_eanPlanFromModules
Builds the immutable plan from a module string where 1 is a bar and 0 is a space.
| Parameter | Type | Description |
|---|---|---|
| modules | string |
The module string, starting and ending with a bar. |
| caption | string |
The human-readable text. |
Returns _UniPlan
_createAsn1Constructed
Creates a der encoded asn1 constructed element.
| Parameter | Type | Description |
|---|---|---|
| tag | number |
The asn1 constructed tag. |
| elements | _PdfUniqueEncodingElement[] |
The ordered child elements to be nested. |
Returns _PdfUniqueEncodingElement
_createPrimitive
Creates a der encoded asn1 primitive element.
| Parameter | Type | Description |
|---|---|---|
| tag | number |
The asn1 tag. |
| value | Uint8Array |
Encoded primitive value bytes. |
Returns _PdfUniqueEncodingElement
_encodeCodePointToUtf8
Encodes a single Unicode code point (U+0000 to U+10FFFF) into UTF-8 bytes.
| Parameter | Type | Description |
|---|---|---|
| codePoint | number |
The Unicode code point to encode. |
Returns number[]
_encodeObjectIdentifier
Encodes a dotted Object Identifier string into der bytes.
| Parameter | Type | Description |
|---|---|---|
| oidString | string |
The dotted oid string. |
Returns Uint8Array
_hashBytes
Compute a 32-bit non-cryptographic hash of a byte array.
| Parameter | Type | Description |
|---|---|---|
| bytes | Uint8Array |
The input bytes to hash. |
Returns number
_isByteArrayEqual
Compare two byte arrays for exact equality.
| Parameter | Type | Description |
|---|---|---|
| a (optional) | Uint8Array |
First byte array. |
| b (optional) | Uint8Array |
Second byte array. |
Returns boolean
_isHexDigit
Checks whether a given character is a valid hexadecimal digit.
| Parameter | Type | Description |
|---|---|---|
| ch | string |
The character to check. |
Returns boolean
_toHex2
Converts a number to a two-character uppercase hexadecimal string.
| Parameter | Type | Description |
|---|---|---|
| n | number |
The number to convert (0 to 255 recommended). |
Returns string
_trimInteger
Trim leading zero bytes from a big-endian integer byte array.
| Parameter | Type | Description |
|---|---|---|
| bytes | Uint8Array |
The integer represented as a byte array. |
Returns Uint8Array