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

if subfilter is not detected return instead of throw

parent 09235998
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ describe("PDF parser", () => { ...@@ -13,7 +13,7 @@ describe("PDF parser", () => {
const parser = new PDFparser(file); const parser = new PDFparser(file);
const actual = await parser.getPDFMeta(); const actual = await parser.getPDFMeta();
expect(actual.pages).toEqual(1); expect(actual.signatures.length).toEqual(1);
}); });
it("should return pdf document metadata without signatures", async () => { it("should return pdf document metadata without signatures", async () => {
......
File added
...@@ -7,7 +7,8 @@ export const verifyPDF = (pdf: Buffer) => { ...@@ -7,7 +7,8 @@ export const verifyPDF = (pdf: Buffer) => {
try { try {
checkForSubFilter(pdfBuffer); checkForSubFilter(pdfBuffer);
} catch (error) { } catch (error) {
throw new Error(error.message); //SubFilter is only available if there is a sig in the pdf
return null;
} }
try { try {
......
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