MCPcopy Create free account
hub / github.com/LibPDF-js/core / PDF

Class PDF

src/api/pdf.ts:278–3342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276 * ```
277 */
278export class PDF {
279 /** Central context for document operations */
280 private ctx: PDFContext;
281
282 private originalBytes: Uint8Array;
283 private originalXRefOffset: number;
284
285 /** Font operations manager (created lazily) */
286 private _fonts: PDFFonts | null = null;
287
288 /** Attachment operations manager (created lazily) */
289 private _attachments: PDFAttachments | null = null;
290
291 /** Cached form (loaded lazily via getForm()) */
292 private _form: PDFForm | null | undefined;
293
294 /** Whether this document was recovered via brute-force parsing */
295 private _recoveredViaBruteForce: boolean;
296
297 /** Whether this document was recovered via brute-force parsing */
298 get recoveredViaBruteForce(): boolean {
299 return this._recoveredViaBruteForce;
300 }
301
302 /** Whether this document is linearized */
303 private _isLinearized: boolean;
304
305 /** Whether this document is linearized */
306 get isLinearized(): boolean {
307 return this._isLinearized;
308 }
309
310 /** Whether the original document uses XRef streams (PDF 1.5+) */
311 private _usesXRefStreams: boolean;
312
313 /** Whether the document uses XRef streams (PDF 1.5+) */
314 get usesXRefStreams(): boolean {
315 return this._usesXRefStreams;
316 }
317
318 /**
319 * Whether this document was newly created (not loaded from bytes).
320 * Newly created documents cannot use incremental save.
321 */
322 private _isNewlyCreated!: boolean;
323
324 /**
325 * Pending security state for save.
326 * Tracks whether encryption should be added, removed, or unchanged.
327 */
328 private _pendingSecurity: PendingSecurityState = { action: "none" };
329
330 /** Warnings from parsing and operations */
331 get warnings(): string[] {
332 return this.ctx.warnings;
333 }
334
335 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected