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

without build

parent b9493bc3
No related branches found
No related tags found
No related merge requests found
Showing
with 931 additions and 6 deletions
File deleted
import fs from "fs";
import path from "path";
import { describe, it, expect } from "@jest/globals";
import { describe, it, expect, beforeAll } from "@jest/globals";
import PDFparser from "../src/pdfParser";
import { AppError } from "../src/lib/errors";
import { saveAs } from "file-saver";
......@@ -56,23 +56,37 @@ type SealCoords = {
describe("PDF insert", () => {
it.only("should insert qrcode into the pdf without breaking the signature", async () => {
// Signed-linux-libreOfficeWriterTest-v1.6-signed-pades-baseline-b
// Signed-linux-OpenOfficeWriter-v1.4-signed-pades-baseline-b
// Signed-mac-Adobe-1.3-signed-pades-baseline-b
// Signed-XXX-nopodofo-test-v.1.7-signed-pades-baseline-b
const filename = "abacus-two-signatures";
const file = fs.readFileSync(
path.resolve(__dirname, "./abacus-two-signatures.pdf")
path.resolve(__dirname, `./source/${filename}.pdf`)
);
const qrcode = fs.readFileSync(path.resolve(__dirname, "./qrcode.png"));
const parser = new PDFparser(file);
const sealCoords: SealCoords = { 1: { x: "261.6", y: "384.84" } };
const sealCoords: SealCoords = {
"1": { x: "261.6", y: "384.84" },
"2": { x: "261.6", y: "384.84" },
};
const resultPDF = await parser.insertQrCode(
qrcode.buffer,
"vereign.com",
sealCoords,
0.25
0.25,
"demo:1652778685773:7b893c000300000000b9c455b21b7b47780dc82f9ef63ddc54ce5c282b"
);
fs.writeFileSync(`${__dirname}/test.pdf`, Buffer.from(resultPDF));
});
fs.writeFileSync(
`${__dirname}/outputs/tron/${filename}-im11age.pdf`,
Buffer.from(resultPDF)
);
expect(true).toBeTruthy();
}, 30000);
});
File added
File added
File added
File added
File added
File added
File added
File added
__tests__/qrcode.png

27.3 KiB | W: | H:

__tests__/qrcode.png

247 KiB | W: | H:

__tests__/qrcode.png
__tests__/qrcode.png
__tests__/qrcode.png
__tests__/qrcode.png
  • 2-up
  • Swipe
  • Onion skin
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