pdf-visual-compare
Visual regression testing library for PDFs in Js/Ts without binary and OS dependencies.
Getting started
Installation:
npm install -D pdf-visual-compare
Example
const result: boolean = await comparePdf('./pdf1.pdf', './pdf2.pdf');
const result: boolean = await comparePdf('./pdf1.pdf', './pdf2.pdf', {
diffsOutputFolder?: string;
pdfToPngConvertOptions?: {
viewportScale: 2.0,
disableFontFace: false,
useSystemFonts: false,
pdfFilePassword: 'pa$$word',
outputFolder: 'output/folder',
outputFileMask: 'buffer',
pagesToProcess: [1, 3, 11],
strictPagesToProcess: false
verbosityLevel: 0
};
excludedAreas?: ExcludedPageArea[];
compareThreshold?: number;
});
Buy Me A Coffee
In case you want support my work