Skip to content
Snippets Groups Projects
Commit 2a3ca79f authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

fix params

parent 38e90c71
No related branches found
No related tags found
No related merge requests found
export declare const TimestampAndEnableLTV: (in_docpath: any, tsa_url: any, in_trusted_cert_path: any, in_appearance_img_path: any, coords: any) => Promise<any>;
export declare const TimestampAndEnableLTV: (docBuffer: ArrayBuffer, certPath: string, certTSAUrl: string, imgBytes: ArrayBuffer, coords: any) => Promise<ArrayBuffer>;
......@@ -11,13 +11,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimestampAndEnableLTV = void 0;
const pdfnet_node_1 = require("@pdftron/pdfnet-node");
const TimestampAndEnableLTV = (in_docpath, tsa_url, in_trusted_cert_path, in_appearance_img_path, coords) => __awaiter(void 0, void 0, void 0, function* () {
const doc = yield pdfnet_node_1.PDFNet.PDFDoc.createFromBuffer(in_docpath);
const TimestampAndEnableLTV = (docBuffer, certPath, certTSAUrl, imgBytes, coords) => __awaiter(void 0, void 0, void 0, function* () {
const doc = yield pdfnet_node_1.PDFNet.PDFDoc.createFromBuffer(docBuffer);
doc.initSecurityHandler();
const tst_config = yield pdfnet_node_1.PDFNet.TimestampingConfiguration.createFromURL(tsa_url);
const tst_config = yield pdfnet_node_1.PDFNet.TimestampingConfiguration.createFromURL(certTSAUrl);
const opts = yield pdfnet_node_1.PDFNet.VerificationOptions.create(pdfnet_node_1.PDFNet.VerificationOptions.SecurityLevel.e_compatibility_and_archiving);
yield opts.addTrustedCertificateUString(in_trusted_cert_path);
const img = yield pdfnet_node_1.PDFNet.Image.createFromMemory2(doc, in_appearance_img_path);
yield opts.addTrustedCertificateUString(certPath);
const img = yield pdfnet_node_1.PDFNet.Image.createFromMemory2(doc, imgBytes);
//make this dynamic with canvas lib
const imgWidth = 300;
const imgHeight = 300;
......
import { PDFNet } from "@pdftron/pdfnet-node";
export const TimestampAndEnableLTV = async (
in_docpath,
tsa_url,
in_trusted_cert_path,
in_appearance_img_path,
coords
) => {
const doc = await PDFNet.PDFDoc.createFromBuffer(in_docpath);
docBuffer: ArrayBuffer,
certPath: string,
certTSAUrl: string,
imgBytes: ArrayBuffer,
coords: any
): Promise<ArrayBuffer> => {
const doc = await PDFNet.PDFDoc.createFromBuffer(docBuffer);
doc.initSecurityHandler();
const tst_config = await PDFNet.TimestampingConfiguration.createFromURL(
tsa_url
certTSAUrl
);
const opts = await PDFNet.VerificationOptions.create(
PDFNet.VerificationOptions.SecurityLevel.e_compatibility_and_archiving
);
await opts.addTrustedCertificateUString(in_trusted_cert_path);
await opts.addTrustedCertificateUString(certPath);
const img = await PDFNet.Image.createFromMemory2(doc, in_appearance_img_path);
const img = await PDFNet.Image.createFromMemory2(doc, imgBytes);
//make this dynamic with canvas lib
const imgWidth = 300;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment