UNPKG

@syncfusion/ej2-pdf

Version:

Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.

168 lines (167 loc) 5.6 kB
import { PdfXmpSchema } from './pdf-xmp-schema'; import { PdfXmpSchemaType } from '../enumerator'; import { PdfXmpMetadata } from './pdf-xmp-metadata'; /** * Represents the base schema for PDF document metadata properties. * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Create XMP metadata * let xmp: PdfXmpMetadata = new PdfXmpMetadata(); * // Sets PDF keywords * xmp.pdfSchema.keywords = 'sample, pdf, metadata'; * // Save the document * document.save('output.pdf'); * // Destroy the document * document.destroy(); * ``` */ export declare class PdfSchema extends PdfXmpSchema { private _keywords; private _pdfVersion; private _producer; /** * Initializes a new `PdfSchema` instance. * * @private * @param {PdfXmpMetadata} xmp Optional parent PdfXmpMetadata reference. */ constructor(xmp?: PdfXmpMetadata); /** * Gets the schema type. * * @returns {PdfXmpSchemaType} The schema type. * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets the PDF Schema from the XMP metadata * let pdfSchema: PdfSchema = xmpMetadata.pdfSchema; * // Gets the schema type * let schemaType: PdfXmpSchemaType = pdfSchema.schemaType; * // Save the document * document.save('output.pdf'); * // Destroy the document * document.destroy(); * ``` */ readonly schemaType: PdfXmpSchemaType; /** * Gets the PDF keywords. * * @returns {string} The PDF keywords. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets the xmp metadata * let xmpMetadata = documentProperties.xmpMetadata; * // Access keywords from PDF schema * let keywords: string = xmpMetadata.pdfSchema.keywords; * // Destroy the document * document.destroy(); * ``` */ /** * Sets the PDF keywords. * * @param {string} value The PDF keywords to set. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets the xmp metadata * let xmp = documentProperties.xmpMetadata; * // Sets keywords * xmp.pdfSchema.keywords = 'sample, pdf, metadata'; * // Save the document * document.save('output.pdf'); * // Destroy the document * document.destroy(); * ``` */ keywords: string; /** * Gets the PDF version. * * @returns {string} The PDF version. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets the xmp metadata * let xmpMetadata = documentProperties.xmpMetadata; * // Access PDF version from PDF schema * let pdfVersion: string = xmpMetadata.pdfSchema.pdfVersion; * // Destroy the document * document.destroy(); * ``` */ /** * Sets the PDF version. * * @param {string} value The PDF version to set. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets the xmp metadata * let xmp = documentProperties.xmpMetadata; * // Sets PDF version * xmp.pdfSchema.pdfVersion = '1.7'; * // Save the document * document.save('output.pdf'); * // Destroy the document * document.destroy(); * ``` */ pdfVersion: string; /** * Gets the PDF producer. * * @returns {string} The PDF producer. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets the xmp metadata * let xmpMetadata = documentProperties.xmpMetadata; * // Access producer from PDF schema * let producer: string = xmpMetadata.pdfSchema.producer; * // Destroy the document * document.destroy(); * ``` */ /** * Sets the PDF producer. * * @param {string} value The PDF producer to set. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets the xmp metadata * let xmp = documentProperties.xmpMetadata; * // Sets producer * xmp.pdfSchema.producer = 'Syncfusion EJ2 PDF'; * // Save the document * document.save('output.pdf'); * // Destroy the document * document.destroy(); * ``` */ producer: string; }