UNPKG

@cantoo/pdf-lib

Version:

Create and modify PDF files with JavaScript

43 lines (32 loc) 1.12 kB
import type { PDFObject, PDFRef } from '../../core'; import type { DocumentSnapshot } from './DocumentSnapshot'; export class DefaultDocumentSnapshot implements DocumentSnapshot { pdfSize = 0; prevStartXRef = 0; deletedCount = 0; shouldSave(_objectNumber: number): boolean { return true; } markRefForSave(_ref: PDFRef): void { throw new Error('This method should not be called.'); } markRefsForSave(_refs: PDFRef[]): void { throw new Error('This method should not be called.'); } markObjForSave(_obj: PDFObject): void { throw new Error('This method should not be called.'); } markObjsForSave(_objs: PDFObject[]): void { throw new Error('This method should not be called.'); } markDeletedObj(_obj: PDFObject): void { throw new Error('This method should not be called.'); } markDeletedRef(_ref: PDFRef): void { throw new Error('This method should not be called.'); } deletedRef(_index: number): PDFRef | null { throw new Error('This method should not be called.'); } } export const defaultDocumentSnapshot = new DefaultDocumentSnapshot();