UNPKG

@syncfusion/ej2-pdf

Version:

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

131 lines (130 loc) 5.04 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { PdfXmpSchema } from './pdf-xmp-schema'; import { PdfXmpSchemaType } from '../enumerator'; /** * Represents metadata for print job and production instructions. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets XMP metadata * let xmpMetadata: PdfXmpMetadata = documentProperties.xmpMetadata; * // Sets job references * xmpMetadata.basicJobTicketSchema.jobRef = ['JobA', 'JobB']; * // Save the document * document.save('output.pdf'); * // Destroy the document * document.destroy(); * ``` */ var PdfBasicJobTicketSchema = /** @class */ (function (_super) { __extends(PdfBasicJobTicketSchema, _super); /** * Initializes a new `PdfBasicJobTicketSchema` instance. * * @private * @param {PdfXmpMetadata} xmp Optional parent PdfXmpMetadata reference. */ function PdfBasicJobTicketSchema(xmp) { var _this = _super.call(this, xmp) || this; _this._prefix = 'xmpBJ'; _this._name = 'BasicJobTicket'; return _this; } Object.defineProperty(PdfBasicJobTicketSchema.prototype, "schemaType", { /** * Gets the schema type. * * @returns {PdfXmpSchemaType} The schema type. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets XMP metadata * let xmpMetadata: PdfXmpMetadata = documentProperties.xmpMetadata; * // Access schema type from basic job ticket schema * let type: PdfXmpSchemaType = xmpMetadata.basicJobTicketSchema.schemaType; * // Destroy the document * document.destroy(); * ``` */ get: function () { return PdfXmpSchemaType.basicJobTicket; }, enumerable: true, configurable: true }); Object.defineProperty(PdfBasicJobTicketSchema.prototype, "jobRef", { /** * Gets the list of job references (rdf:Bag). * * @returns {string[]} The job references. * * ```typescript * // Load an existing PDF document * let document: PdfDocument = new PdfDocument(data, password); * // Access the document properties * let documentProperties: PdfDocumentInformation = document.getDocumentInformation(false); * // Gets XMP metadata * let xmpMetadata: PdfXmpMetadata = documentProperties.xmpMetadata; * // Access job references from basic job ticket schema * let jobRef: string[] = xmpMetadata.basicJobTicketSchema.jobRef; * // Destroy the document * document.destroy(); * ``` */ get: function () { if (typeof this._jobRef !== 'undefined' && this._jobRef !== null) { return this._jobRef; } this._jobRef = this._getProperty('xmpBJ:JobRef'); if (this._jobRef) { return this._jobRef; } return []; }, /** * Sets the list of job references (rdf:Bag). * * @param {string[]} value The job references 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 XMP metadata * let xmpMetadata: PdfXmpMetadata = documentProperties.xmpMetadata; * // Sets job references * xmpMetadata.basicJobTicketSchema.jobRef = ['JobA', 'JobB']; * // Save the document * document.save('output.pdf'); * // Destroy the document * document.destroy(); * ``` */ set: function (value) { this._jobRef = value; this._setProperty('xmpBJ:JobRef', value); }, enumerable: true, configurable: true }); return PdfBasicJobTicketSchema; }(PdfXmpSchema)); export { PdfBasicJobTicketSchema };