/// /// /// import { Buffer } from "buffer"; import { BarcodeStampOptions, BarcodeType, ChangeTrackingModes, ChromePdfRenderOptions, DigitalSignature, VerifiedSignature, HtmlAffix, HtmlFilePath, HtmlStampOptions, HtmlString, HttpLoginCredentials, ImageBuffer, ImageFilePath, ImageStampOptions, ImageToPdfOptions, ImageType, PageInfo, PageRotation, PdfInput, PdfPageSelection, PdfPaperSize, PdfPassword, PdfPermission, SaveOptions, TextAffix, TextStampOptions } from "./types"; import { Readable } from "stream"; import { PdfAVersions, PdfUAVersions } from "../internal/grpc_layer/pdfium/pdfa"; import { NaturalLanguages } from "./naturalLanguages"; /** * Represents a PDF document. Allows: loading, editing, manipulating, merging, signing printing and saving PDFs. * * @remark Make sure that you call {@link PdfDocument.close} or {@link cleanUp} to free the memory, when you stop using the PdfDocument object. */ export declare class PdfDocument { /** * Open or Create a PdfDocument from a {@link PdfInput} * @param pdfInput {@link PdfInput} * @param options including {@link PdfPassword} {@link ChromePdfRenderOptions} {@link HttpLoginCredentials} mainHtmlFile */ static open(pdfInput: PdfInput, options?: { /** * required for open a protected PDF file * @default undefined */ password?: PdfPassword | undefined; /** * Apply renderOptions if PdfInput is a {@link HtmlString} or {@link HtmlFilePath} or {@link ZipFilePath} or {@link Url}} * @default undefined */ renderOptions?: ChromePdfRenderOptions | undefined; /** * Apply httpLoginCredentials if PdfInput is a {@link HtmlString} or {@link HtmlFilePath} or {@link ZipFilePath} or {@link Url}} * @default undefined */ httpLoginCredentials?: HttpLoginCredentials | undefined; /** * Apply mainHtmlFile if PdfInput is {@link ZipFilePath} * @default index.html */ mainHtmlFile?: string | undefined; /** * Optionally track changes to the document (for use with incremental saves) * @default {@link ChangeTrackingModes.AutoChangeTracking} */ trackChanges?: ChangeTrackingModes | undefined; } | undefined): Promise; /** * Open a PdfDocument from .pdf file * @param pdfFilePath A path to .pdf file * @param Optionally track changes to the document (for use with incremental saves) */ static fromFile(pdfFilePath: string, trackChanges?: ChangeTrackingModes | undefined): Promise; /** * Create a PdfDocument from an Url * @param url A website Url * @param options including {@link ChromePdfRenderOptions} */ static fromUrl(url: URL | string, options?: { /** * Apply renderOptions if PdfInput is a {@link HtmlString} or {@link HtmlFilePath} or {@link ZipFilePath} or {@link Url}} * @default undefined */ renderOptions?: ChromePdfRenderOptions | undefined; } | undefined): Promise; /** * Creates a PDF file from a local Zip file, and returns it as a {@link PdfDocument}. * IronPDF is a W3C standards compliant HTML rendering based on Google's Chromium browser. * If your output PDF does not look as expected: * * - Validate your HTML file using https://validator.w3.org/ & CSS https://jigsaw.w3.org/css-validator/ * * - To debug HTML, view the file in Chrome web browser's print preview which will work almost exactly as IronPDF. * * - Read our detailed documentation on pixel perfect HTML to PDF: https://ironpdf.com/tutorials/pixel-perfect-html-to-pdf/ * * @param zipFilePath Path to a Zip to be rendered as a PDF. * @param options including {@link ChromePdfRenderOptions} and `mainHtmlFile` a main .html file default: `index.html` */ static fromZip(zipFilePath: string, options?: { /** * Apply renderOptions if PdfInput is a {@link HtmlString} or {@link HtmlFilePath} or {@link ZipFilePath} or {@link Url}} * @default undefined */ renderOptions?: ChromePdfRenderOptions | undefined; /** * a main .html file default: `index.html` */ mainHtmlFile?: string | undefined; } | undefined): Promise; /** * Creates a PDF file from a Html string, and returns it as an {@link PdfDocument} object which can be edited and saved to disk or served on a website. * * ------------------------------------------------ * * **Usage:** * ```ts * const pdf = await fromHtml(htmlStringOrHtmlFilePath, renderOptions); * ``` * * ------------------------------------------------ * * @param htmlStringOrHtmlFilePath The Html to be rendered as a PDF. * @param options including {@link ChromePdfRenderOptions} * @returns A `PdfDocument` generated from the provided HTML file. * * --- * ### Important Notes: * * 🐳 **Docker Limitation:** * This method **does not work** for **HTML file path** when the application runs inside a Docker environment * due to rendering engine restrictions. * In such cases, use `fromZip()` instead. * * 📄 **Input:** Requires access to a local HTML file on disk if htmlFilePath is passing. * * --- * ### Related Methods: * 📌 `fromZip()` — Recommended alternative for rendering from HTML file when running inside Docker. */ static fromHtml(htmlStringOrHtmlFilePath: string, options?: { /** * Apply renderOptions if PdfInput is a {@link HtmlString} or {@link HtmlFilePath} or {@link ZipFilePath} or {@link Url}} * @default undefined */ renderOptions?: ChromePdfRenderOptions | undefined; } | undefined): Promise; /** * Converts multiple image files to a PDF document. Each image creates 1 page which matches the image * dimensions. The default PaperSize is A4. You can set it via ImageToPdfConverter.PaperSize. * Note: Imaging.ImageBehavior.CropPage will set PaperSize equal to ImageSize. * @param images The image file path name(s) or {@link ImageBuffer} object(s) * @param options including {@link ImageToPdfOptions} */ static fromImage(images: ImageFilePath | ImageFilePath[] | ImageBuffer | ImageBuffer[], options?: { /** * Apply renderOptions if PdfInput is a {@link HtmlString} or {@link HtmlFilePath} or {@link ZipFilePath} or {@link Url}} * @default undefined */ imageToPdfOptions?: ImageToPdfOptions | undefined; }): Promise; /** * Static method that joins (concatenates) multiple PDF documents together into one compiled PDF document. * If the PDF contains form fields the form field in the resulting PDF's name will be appended with '_{index}' e.g. 'Name' will be 'Name_0' * @param pdfs array of PDF */ static mergePdf(pdfs: PdfInput[]): Promise; /** * Saves the PdfDocument to a file. * @param filePath Target file path * @param saveOptions see {@link SaveOptions} */ saveAs(filePath: string, saveOptions?: SaveOptions | undefined): Promise; /** * Saves the PdfDocument to a binary (Buffer) * @param saveOptions see {@link SaveOptions} */ saveAsBuffer(saveOptions?: SaveOptions | undefined): Promise; /** * Compress existing PDF images using JPG encoding and the specified settings. * @deprecated Use {@link compressAndSaveAs}, {@link compressPdfToBytes}, or {@link compressPdfToStream} instead for better compression results. * @param imageQuality Quality (1 - 100) to use during compression * @param scaleToVisibleSize Scale down the image resolution according to its visible size in the PDF document */ compressSize(imageQuality: number, scaleToVisibleSize?: boolean): Promise; /** * Remove document struct tree information which describes the logical layout of the document. * Removing the "structure tree" can significantly reduce the disk space used by the document. * Removing the "structure tree" of a complicated document can negatively impact text selection. */ compressStructTree(): Promise; /** * Compress the PDF and return the result as a Buffer (byte array). * Uses QPdf compression which can significantly reduce file size. * @param imageQuality Optional JPEG quality (1-100) for image compression. If omitted, default compression is applied. * @returns A Promise resolving to a Buffer containing the compressed PDF bytes. */ compressPdfToBytes(imageQuality?: number): Promise; /** * Compress the PDF and return the result as a Readable stream. * Uses QPdf compression which can significantly reduce file size. * Useful for piping directly to file streams or HTTP responses without buffering the entire PDF in memory. * @param imageQuality Optional JPEG quality (1-100) for image compression. If omitted, default compression is applied. * @returns A Promise resolving to a Readable stream of the compressed PDF bytes. */ compressPdfToStream(imageQuality?: number): Promise; /** * Compress the PDF and save the result directly to a file. * Uses QPdf compression which can significantly reduce file size. * @param filePath The output file path to save the compressed PDF. * @param imageQuality Optional JPEG quality (1-100) for image compression. If omitted, default compression is applied. */ compressAndSaveAs(filePath: string, imageQuality?: number): Promise; /** * Gets information of all pages in the PdfDocument */ getPagesInfo(): Promise; /** * Gets the number of pages in the PdfDocument. */ getPageCount(): Promise; /** * Set the page orientation. * @param pageRotation see {@link PageRotation} * @param options including {@link PdfPageSelection} */ setRotation(pageRotation: PageRotation, options?: { /** * @default "all" */ pdfPageSelection?: PdfPageSelection | undefined; } | undefined): Promise; /** * Resize a page to the specified dimensions * @param newSize {@link PdfPaperSize} * @param options including {@link PdfPageSelection} */ resize(newSize: PdfPaperSize, options?: { /** * @default "all" */ pdfPageSelection?: PdfPageSelection | undefined; } | undefined): Promise; /** * Adds another PDF to the beginning of the current PdfDocument * If AnotherPdfFile contains form fields, those fields will be appended with '_' in the resulting PDF. e.g. 'Name' will be 'Name_' * @param fromPdfDocument PdfDocument to prepend */ prependAnotherPdf(fromPdfDocument: PdfDocument): Promise; /** * Appends another PDF to the end of the current * If AnotherPdfFile contains form fields, those fields will be appended with '_' in the resulting PDF. e.g. 'Name' will be 'Name_' * @param fromPdfDocument PdfDocument to Append */ appendAnotherPdf(fromPdfDocument: PdfDocument): Promise; /** * Inserts another PDF into the current PdfDocument, starting at a given Page Index. * If AnotherPdfFile contains form fields, those fields will be appended with '_' in the resulting PDF. e.g. 'Name' will be 'Name_' * @param fromPdfDocument Another PdfDocument * @param insertAtPageIndex Index at which to insert the new content. Note: Page 1 has index 0... */ insertPagesFromAnotherPdf(fromPdfDocument: PdfDocument, insertAtPageIndex: number): Promise; /** * Removes a range of pages from the PDF * @param pages pages to remove */ removePage(pages: PdfPageSelection): Promise; /** * Creates a new PDF by copying a range of pages from this {@link PdfDocument}. * @param pages pages to copy (default "all") */ duplicate(pages?: PdfPageSelection): Promise; /** * Finds all embedded Images from within a specified pages in the PDF and returns them as Buffer * @param options including {@link PdfPageSelection} */ extractRawImages(options?: { /** * @default "all" */ fromPages?: PdfPageSelection; } | undefined): Promise; /** * Renders the PDF and exports image Files in convenient formats. 1 image file is created for each * page. * * @param options including {@link PdfPageSelection} {@link ImageType} * * @return array of images as Buffer[] */ rasterizeToImageBuffers(options?: { /** * @default "all" */ fromPages?: PdfPageSelection | undefined; /** * @default {@link ImageType.PNG} */ imageType?: ImageType | undefined; } | undefined): Promise; /** * Renders the PDF and exports image Files in convenient formats. 1 image file is created for each * page. Running number will append output file path. * * @param filePath output file path. * @param options including {@link PdfPageSelection} {@link ImageType} * * @return array of images file name as string[] */ rasterizeToImageFiles(filePath: string, options?: { /** * @default "all" */ fromPages?: PdfPageSelection | undefined; /** * @default {@link ImageType.PNG} */ type?: ImageType | undefined; } | undefined): Promise; /** * Replace the specified old text with new text on a given page * @param oldText Old text to remove * @param newText New text to add * @param onPages Page index to search for old text to replace (default "all") */ replaceText(oldText: string, newText: string, onPages?: PdfPageSelection | undefined): Promise; extractText(onPages?: PdfPageSelection | undefined): Promise; /** * Convert the current document into the specified PDF-A standard format * @param pdfaVersion The PDF/A version to convert to (default: PdfA3b) * @param customICC (Optional) Custom color profile file path */ convertToPdfA(pdfaVersion?: PdfAVersions, customICC?: string | undefined): Promise; /** * Convert the current document into the specified PDF/UA standard format */ convertToPdfUA(naturalLanguages: NaturalLanguages, pdfUaVersion?: PdfUAVersions): Promise; /** * Gets a Map of metadata properties */ getMetadata(): Promise>; /** * Add or Update a single metadata property * @param key * @param value */ addOrUpdateMetadata(key: string, value: string): Promise; /** * Remove a single metadata property * @param key */ removeMetadata(key: string): Promise; /** * Sets a whole metadata properties Map (override all the metadata property) * @param newMetadataDictionary new metadata properties Map */ overrideMetadata(newMetadataDictionary: Map): Promise; /** * Sign PDF with digital signature certificate. * Note that the PDF will not be fully signed until Saved * using {@link saveAs} or {@link saveAsBuffer} * * Multiple certificates may be used. * @param signature see {@link DigitalSignature} */ signDigitalSignature(signature: DigitalSignature): Promise; /** * Check if PdfDocument was signed or not */ isSigned(): Promise; /** * Count the number signature that signed to this PdfDocument */ signatureCount(): Promise; /** * Get all verified digital signatures from this PdfDocument. * Returns details including signature name, signer contact, reason, location, date, and validity. * @returns A Promise resolving to an array of {@link VerifiedSignature} objects. */ getVerifiedSignatures(): Promise; /** * Apply page header on top of an existing Pdf. * @param header {@link TextAffix} * @param toPages {@link PdfPageSelection} */ addTextHeader(header: TextAffix, toPages?: PdfPageSelection | undefined): Promise; /** * Apply page footer on top of an existing Pdf. * @param footer {@link TextAffix} * @param toPages {@link PdfPageSelection} */ addTextFooter(footer: TextAffix, toPages?: PdfPageSelection | undefined): Promise; /** * Apply HTML header on top of an existing Pdf. * @param header {@link HtmlAffix} * @param toPages {@link PdfPageSelection} */ addHtmlHeader(header: HtmlAffix, toPages?: PdfPageSelection | undefined): Promise; /** * Apply HTML footer on top of an existing Pdf. * @param footer {@link HtmlAffix} * @param toPages {@link PdfPageSelection} */ addHtmlFooter(footer: HtmlAffix, toPages?: PdfPageSelection | undefined): Promise; /** * Edits the PDF by applying the HTML's rendered to only selected page(s). * @param htmlStringOrHtmlFilePath * @param options including {@link HtmlStampOptions} {@link PdfPageSelection} */ stampHtml(htmlStringOrHtmlFilePath: HtmlFilePath | HtmlString, options?: { htmlStampOptions?: HtmlStampOptions | undefined; toPages?: PdfPageSelection | undefined; } | undefined): Promise; /** * Edits the PDF by applying the image to only selected page(s). * @param image image file path or image buffer * @param options including {@link ImageStampOptions} {@link PdfPageSelection} */ stampImage(image: ImageFilePath | ImageBuffer, options?: { imageStampOptions?: ImageStampOptions | undefined; toPages?: PdfPageSelection | undefined; } | undefined): Promise; /** * Edits the PDF by applying the text to only selected page(s). * @param text text to stamp * @param options including {@link TextStampOptions} {@link PdfPageSelection} */ stampText(text: string, options?: { textStampOptions?: TextStampOptions | undefined; toPages?: PdfPageSelection | undefined; } | undefined): Promise; /** * Edits the PDF by applying the barcode to only selected page(s). * @param barcodeValue barcode * @param options including {@link BarcodeType} {@link BarcodeStampOptions} {@link PdfPageSelection} */ stampBarcode(barcodeValue: string, options?: { barcodeEncoding: BarcodeType; barcodeStampOptions?: BarcodeStampOptions | undefined; toPages?: PdfPageSelection | undefined; } | undefined): Promise; /** * Adds a background to each page of this PDF. The background is copied from a first page in the * backgroundPdf document. * * @param fromPdf background PDF document * @param sourcePageIndex Index (zero-based page number) of the page to copy from the Background/Foreground PDF. Default is 0. * @param applyToPages PageSelection to which the background/foreground will be added. Default is "all" */ addBackgroundFromAnotherPdf(fromPdf: PdfDocument, sourcePageIndex?: number, applyToPages?: PdfPageSelection | undefined): Promise; /** * Adds a foreground to each page of this PDF. The background is copied from a first page in the * backgroundPdf document. * * @param fromPdf foreground PDF document * @param sourcePageIndex Index (zero-based page number) of the page to copy from the Background/Foreground PDF. Default is 0. * @param applyToPages PageSelection to which the background/foreground will be added. Default is "all" */ addForegroundFromAnotherPdf(fromPdf: PdfDocument, sourcePageIndex?: number, applyToPages?: PdfPageSelection | undefined): Promise; /** * Removes all user and owner password security for a PDF document. Also disables content * encryption. * If content is encrypted at 128 bit, copy and paste of content, annotations and form editing may be disabled. */ removePasswordsAndEncryption(): Promise; /** * Sets the user password and enables 128Bit encryption of PDF content. * A user password is a password that each user must enter to open or print the PDF document. */ setUserPassword(userPassword: string): Promise; /** * Sets the owner password and enables 128Bit encryption of PDF content. An owner password is one used to * enable and disable all other security settings. OwnerPassword must be set to a non-empty string * value for {@link PdfPermission.AllowAccessibilityExtractContent} , {@link PdfPermission.AllowAnnotations} , * {@link PdfPermission.AllowFillForms}, {@link PdfPermission.AllowPrint}, {@link PdfPermission.AllowModify} to be * restricted. */ setOwnerPassword(ownerPassword: string): Promise; /** * Sets the permissions of this PdfDocument * @param permissions see {@link PdfPermission} */ setPermission(permissions: PdfPermission): Promise; /** * Gets the current permissions of this PdfDocument * @return {@link PdfPermission} */ getPermission(): Promise; /** * Makes this PDF document read only such that: Content is encrypted at 128 bit. Copy and paste of * content is disallowed. Annotations and form editing are disabled. * @param ownerPassword The owner password for the PDF. A string for owner password is required to enable PDF encryption and * all document security options. */ makePdfDocumentReadOnly(ownerPassword: string): Promise; /** * Dispose this PdfDocument object (clean up the resource) * This is necessary to free the memory used by PdfDocument. See {@link cleanUp} * Once this method was called this PdfDocument object no longer usable. */ close(): Promise; /** * Internal PDF document ID * @private */ private pdfDocumentId?; /** * @private */ private readonly promiseDocumentId?; /** * @private */ private pdfPassword?; /** * Create a PdfDocument object from a {@link PdfInput} * For more specific way to create/open PdfDocument see {@link fromUrl} {@link fromZip} {@link fromHtml} {@link fromImage} {@link open} * * @param pdfInput see {@link PdfInput} (required) (pdfInput is {@link PdfFilePath} or {@link Buffer}) * @param password a password to open the PDF required if PDF file was private. * @param trackChanges Optionally track changes to the document (for use with incremental saves) */ constructor(pdfInput?: PdfInput | undefined, password?: PdfPassword | undefined, trackChanges?: ChangeTrackingModes | undefined); /** * Dispose this PdfDocument object (clean up the resource) * This is necessary to free the memory used by PdfDocument. See {@link cleanUp} * Once this method was called this PdfDocument object no longer usable. */ private internal_close; /** * @private */ private internal_getId; /** * Open or Create a PdfDocument from a {@link PdfInput} * @param pdfInput {@link PdfInput} * @param options including {@link PdfPassword} {@link ChromePdfRenderOptions} {@link HttpLoginCredentials} mainHtmlFile */ private static internal_open; /** * Open a PdfDocument from .pdf file * @param pdfFilePath A path to .pdf file * @param Optionally track changes to the document (for use with incremental saves) */ private static internal_fromFile; /** * Create a PdfDocument from an Url * @param url A website Url * @param options including {@link ChromePdfRenderOptions} */ private static internal_fromUrl; /** * Creates a PDF file from a local Zip file, and returns it as a {@link PdfDocument}. * IronPDF is a W3C standards compliant HTML rendering based on Google's Chromium browser. * If your output PDF does not look as expected: * * - Validate your HTML file using https://validator.w3.org/ & CSS https://jigsaw.w3.org/css-validator/ * * - To debug HTML, view the file in Chrome web browser's print preview which will work almost exactly as IronPDF. * * - Read our detailed documentation on pixel perfect HTML to PDF: https://ironpdf.com/tutorials/pixel-perfect-html-to-pdf/ * * @param zipFilePath Path to a Zip to be rendered as a PDF. * @param options including {@link ChromePdfRenderOptions} and `mainHtmlFile` a main .html file default: `index.html` */ private static internal_fromZip; /** * Creates a PDF file from a Html string, and returns it as an {@link PdfDocument} object which can be edited and saved to disk or served on a website. * @param htmlStringOrHtmlFilePath The Html to be rendered as a PDF. * @param options including {@link ChromePdfRenderOptions} */ private static internal_fromHtml; /** * Converts multiple image files to a PDF document. Each image creates 1 page which matches the image * dimensions. The default PaperSize is A4. You can set it via ImageToPdfConverter.PaperSize. * Note: Imaging.ImageBehavior.CropPage will set PaperSize equal to ImageSize. * @param images The image file path name(s) or {@link ImageBuffer} object(s) * @param options including {@link ImageToPdfOptions} */ private static internal_fromImage; /** * Static method that joins (concatenates) multiple PDF documents together into one compiled PDF document. * If the PDF contains form fields the form field in the resulting PDF's name will be appended with '_{index}' e.g. 'Name' will be 'Name_0' * @param pdfs array of PDF */ private static internal_mergePdf; /** * Saves the PdfDocument to a file. * @param filePath Target file path * @param saveOptions see {@link SaveOptions} */ private internal_saveAs; /** * Saves the PdfDocument to a binary (Buffer) * @param saveOptions see {@link SaveOptions} */ private internal_saveAsBuffer; /** * Compress existing PDF images using JPG encoding and the specified settings * @param imageQuality Quality (1 - 100) to use during compression * @param scaleToVisibleSize Scale down the image resolution according to its visible size in the PDF document */ private internal_compressSize; /** * Remove document struct tree information which describes the logical layout of the document. * Removing the "structure tree" can significantly reduce the disk space used by the document. * Removing the "structure tree" of a complicated document can negatively impact text selection. */ private internal_compressStructTree; /** * Compress the PDF and return the result as a Buffer (byte array). * Uses QPdf compression which can significantly reduce file size. * @param imageQuality Optional JPEG quality (1-100) for image compression. If omitted, default compression is applied. */ private internal_compressPdfToBytes; /** * Compress the PDF and return the result as a Readable stream. * Uses QPdf compression which can significantly reduce file size. * Useful for piping directly to file streams or HTTP responses without buffering the entire PDF in memory. * @param imageQuality Optional JPEG quality (1-100) for image compression. If omitted, default compression is applied. */ private internal_compressPdfToStream; /** * Compress the PDF and save the result directly to a file. * Uses QPdf compression which can significantly reduce file size. * @param filePath The output file path to save the compressed PDF. * @param imageQuality Optional JPEG quality (1-100) for image compression. If omitted, default compression is applied. */ private internal_compressAndSaveAs; /** * Gets information of all pages in the PdfDocument */ private internal_getPagesInfo; /** * Gets the number of pages in the PdfDocument. */ private internal_getPageCount; /** * Set the page orientation. * @param pageRotation see {@link PageRotation} * @param options including {@link PdfPageSelection} */ private internal_setRotation; /** * Resize a page to the specified dimensions * @param newSize {@link PdfPaperSize} * @param options including {@link PdfPageSelection} */ private internal_resize; /** * Adds another PDF to the beginning of the current PdfDocument * If AnotherPdfFile contains form fields, those fields will be appended with '_' in the resulting PDF. e.g. 'Name' will be 'Name_' * @param fromPdfDocument PdfDocument to prepend */ private internal_prependAnotherPdf; /** * Appends another PDF to the end of the current * If AnotherPdfFile contains form fields, those fields will be appended with '_' in the resulting PDF. e.g. 'Name' will be 'Name_' * @param fromPdfDocument PdfDocument to Append */ private internal_appendAnotherPdf; /** * Inserts another PDF into the current PdfDocument, starting at a given Page Index. * If AnotherPdfFile contains form fields, those fields will be appended with '_' in the resulting PDF. e.g. 'Name' will be 'Name_' * @param fromPdfDocument Another PdfDocument * @param insertAtPageIndex Index at which to insert the new content. Note: Page 1 has index 0... */ private internal_insertPagesFromAnotherPdf; /** * Removes a range of pages from the PDF * @param pages pages to remove */ private internal_removePage; /** * Creates a new PDF by copying a range of pages from this {@link PdfDocument}. * @param pages pages to copy (default "all") */ private internal_duplicate; /** * Finds all embedded Images from within a specified pages in the PDF and returns them as Buffer * @param options including {@link PdfPageSelection} */ private internal_extractRawImages; /** * Renders the PDF and exports image Files in convenient formats. 1 image file is created for each * page. * * @param options including {@link PdfPageSelection} {@link ImageType} * * @return array of images as Buffer[] */ private internal_rasterizeToImageBuffers; /** * Renders the PDF and exports image Files in convenient formats. 1 image file is created for each * page. Running number will append output file path. * * @param filePath output file path. * @param options including {@link PdfPageSelection} {@link ImageType} * * @return array of images file name as string[] */ private internal_rasterizeToImageFiles; /** * Replace the specified old text with new text on a given page * @param oldText Old text to remove * @param newText New text to add * @param onPages Page index to search for old text to replace (default "all") */ private internal_replaceText; private internal_extractText; /** * Convert the current document into the specified PDF-A standard format * @param pdfaVersion The PDF/A version to convert to * @param customICC (Optional) Custom color profile file path */ private internal_convertToPdfA; /** * Convert the current document into the specified PDF/UA standard format */ private internal_convertToPdfUA; /** * Gets a Map of metadata properties */ private internal_getMetadata; /** * Add or Update a single metadata property * @param key * @param value */ private internal_addOrUpdateMetadata; /** * Remove a single metadata property * @param key */ private internal_removeMetadata; /** * Sets a whole metadata properties Map (override all the metadata property) * @param newMetadataDictionary new metadata properties Map */ private internal_overrideMetadata; /** * Sign PDF with digital signature certificate. * Note that the PDF will not be fully signed until Saved * using {@link saveAs} or {@link saveAsBuffer} * * Multiple certificates may be used. * @param signature see {@link DigitalSignature} */ private internal_signDigitalSignature; /** * Check if PdfDocument was signed or not */ private internal_isSigned; /** * Count the number signature that signed to this PdfDocument */ private internal_signatureCount; /** * Get all verified digital signatures from this PdfDocument. */ private internal_getVerifiedSignatures; /** * Apply page header on top of an existing Pdf. * @param header {@link TextAffix} * @param toPages {@link PdfPageSelection} */ private internal_addTextHeader; /** * Apply page footer on top of an existing Pdf. * @param footer {@link TextAffix} * @param toPages {@link PdfPageSelection} */ private internal_addTextFooter; /** * Apply HTML header on top of an existing Pdf. * @param header {@link HtmlAffix} * @param toPages {@link PdfPageSelection} */ private internal_addHtmlHeader; /** * Apply HTML footer on top of an existing Pdf. * @param footer {@link HtmlAffix} * @param toPages {@link PdfPageSelection} */ private internal_addHtmlFooter; /** * Edits the PDF by applying the HTML's rendered to only selected page(s). * @param htmlStringOrHtmlFilePath * @param options including {@link HtmlStampOptions} {@link PdfPageSelection} */ private internal_stampHtml; /** * Edits the PDF by applying the image to only selected page(s). * @param image image file path or image buffer * @param options including {@link ImageStampOptions} {@link PdfPageSelection} */ private internal_stampImage; /** * Edits the PDF by applying the text to only selected page(s). * @param text text to stamp * @param options including {@link TextStampOptions} {@link PdfPageSelection} */ private internal_stampText; /** * Edits the PDF by applying the barcode to only selected page(s). * @param barcodeValue barcode * @param options including {@link BarcodeType} {@link BarcodeStampOptions} {@link PdfPageSelection} */ private internal_stampBarcode; /** * Adds a background to each page of this PDF. The background is copied from a first page in the * backgroundPdf document. * * @param fromPdf background PDF document * @param sourcePageIndex Index (zero-based page number) of the page to copy from the Background/Foreground PDF. Default is 0. * @param applyToPages PageSelection to which the background/foreground will be added. Default is "all" */ private internal_addBackgroundFromAnotherPdf; /** * Adds a foreground to each page of this PDF. The background is copied from a first page in the * backgroundPdf document. * * @param fromPdf foreground PDF document * @param sourcePageIndex Index (zero-based page number) of the page to copy from the Background/Foreground PDF. Default is 0. * @param applyToPages PageSelection to which the background/foreground will be added. Default is "all" */ private internal_addForegroundFromAnotherPdf; /** * Removes all user and owner password security for a PDF document. Also disables content * encryption. * If content is encrypted at 128 bit, copy and paste of content, annotations and form editing may be disabled. */ private internal_removePasswordsAndEncryption; /** * Sets the user password and enables 128Bit encryption of PDF content. * A user password is a password that each user must enter to open or print the PDF document. */ private internal_setUserPassword; /** * Sets the owner password and enables 128Bit encryption of PDF content. An owner password is one used to * enable and disable all other security settings. OwnerPassword must be set to a non-empty string * value for {@link PdfPermission.AllowAccessibilityExtractContent} , {@link PdfPermission.AllowAnnotations} , * {@link PdfPermission.AllowFillForms}, {@link PdfPermission.AllowPrint}, {@link PdfPermission.AllowModify} to be * restricted. */ private internal_setOwnerPassword; /** * Sets the permissions of this PdfDocument * @param permissions see {@link PdfPermission} */ private internal_setPermission; /** * Gets the current permissions of this PdfDocument * @return {@link PdfPermission} */ private internal_getPermission; /** * Makes this PDF document read only such that: Content is encrypted at 128 bit. Copy and paste of * content is disallowed. Annotations and form editing are disabled. * @param ownerPassword The owner password for the PDF. A string for owner password is required to enable PDF encryption and * all document security options. */ private internal_makePdfDocumentReadOnly; } //# sourceMappingURL=pdfDocument.d.ts.map