@ironsoftware/ironpdf
Version:
IronPDF for Node
76 lines • 3.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultChromePdfRenderOptions = exports.WaitForType = exports.LinearizationMode = void 0;
const paper_1 = require("./paper");
const types_1 = require("./types");
/**
* Specifies the linearization strategy to use when producing a linearized
* (web-optimized) PDF.
*
* Mirrors {@code IronPdf.LinearizationMode} on the C# side.
*/
var LinearizationMode;
(function (LinearizationMode) {
/**
* Automatically selects the optimal linearization method based on system capabilities.
*
* Behavior:
* 1. First attempts {@link FileBased} linearization.
* 2. If disk access is restricted (e.g. limited permissions, sandboxed environment),
* automatically falls back to {@link InMemory}.
*
* Recommended default for most applications.
*/
LinearizationMode[LinearizationMode["Automatic"] = 0] = "Automatic";
/**
* Performs linearization entirely in memory without any disk I/O operations.
*
* Use when:
* - Compliance requirements mandate zero disk I/O (e.g. HIPAA, PCI-DSS)
* - Sandboxed or restricted environments without disk write permissions
* - Cloud-based environments where disk I/O introduces latency
*/
LinearizationMode[LinearizationMode["InMemory"] = 1] = "InMemory";
/**
* Performs linearization using temporary file operations on disk.
* Requires write permissions to the system temporary directory.
*/
LinearizationMode[LinearizationMode["FileBased"] = 2] = "FileBased";
})(LinearizationMode = exports.LinearizationMode || (exports.LinearizationMode = {}));
/**
* A wait-for type. see {@link ChromePdfRenderOptions.waitFor} also {@link WaitFor}
*/
var WaitForType;
(function (WaitForType) {
WaitForType["PageLoad"] = "PageLoad";
WaitForType["JavaScript"] = "JavaScript";
WaitForType["RenderDelay"] = "RenderDelay";
WaitForType["NetworkIdle0"] = "NetworkIdle0";
WaitForType["NetworkIdle2"] = "NetworkIdle2";
WaitForType["NetworkIdleN"] = "NetworkIdleN";
WaitForType["HtmlElement"] = "HtmlElement";
})(WaitForType = exports.WaitForType || (exports.WaitForType = {}));
function defaultChromePdfRenderOptions() {
return {
cssMediaType: types_1.CssMediaType.Print,
enableJavaScript: true,
firstPageNumber: 1,
tableOfContents: types_1.TableOfContentsTypes.None,
fitToPaperMode: types_1.FitToPaperModes.Default,
grayScale: false,
inputEncoding: "utf-8",
margin: { default: 0.38, top: 0.39, left: 0.39 },
paperSize: paper_1.PaperSize.A4,
paperOrientation: paper_1.PdfPaperOrientation.Portrait,
printHtmlBackgrounds: true,
waitFor: { type: WaitForType.RenderDelay, delay: 20 },
// viewPortWidth: 1280,
// viewPortHeight: 1024,
// zoom: 100,
createPdfFormsFromHtml: true,
customCssUrl: "",
useMarginsOnHeaderAndFooter: types_1.UseMargins.All,
};
}
exports.defaultChromePdfRenderOptions = defaultChromePdfRenderOptions;
//# sourceMappingURL=render.js.map