@cantoo/pdf-lib
Version:
Create and modify PDF files with JavaScript
31 lines (24 loc) • 550 B
text/typescript
import PDFObject from './PDFObject';
import CharCodes from '../syntax/CharCodes';
class PDFNull extends PDFObject {
asNull(): null {
return null;
}
clone(): PDFNull {
return this;
}
toString(): string {
return 'null';
}
sizeInBytes(): number {
return 4;
}
copyBytesInto(buffer: Uint8Array, offset: number): number {
buffer[offset++] = CharCodes.n;
buffer[offset++] = CharCodes.u;
buffer[offset++] = CharCodes.l;
buffer[offset++] = CharCodes.l;
return 4;
}
}
export default new PDFNull();