pdf-visual-diff icon indicating copy to clipboard operation
pdf-visual-diff copied to clipboard

Option to set rendering DPI

Open ChrisAndersonFV opened this issue 2 years ago • 1 comments

It would be very helpful to be able to control the resolution of the PNGs that are rendered. As-is, it's not bad, but I may need to have much higher resolution to better capture fine details. It appears the DPI is being set to 144 in pdf2png.ts lines 88/89? I think I would want a DPI of at least 300, but would like to be able to experiment with various DPIs via an option.

I'm happy to make a PR to contribute, let me know what you think. Loving this library, it's great!

ChrisAndersonFV avatar Jan 26 '24 23:01 ChrisAndersonFV

👋 I don't mind expanding configuration a bit. A PR would be much appreciated. At first thought only suggestion that comes to my mind is to think how to shape the api. I can see a potential need to abstract over the tool that actually creates the images, therefore it might be beneficial to provide tool specific config options. But I'm fine with a simpler solution for the time being that will extend current config and pass down the layers DPI setting.

moshensky avatar Jan 29 '24 10:01 moshensky

👋 @ChrisAndersonFV,

I have published a new version 0.10.0 with exposed option to set custom DPI. You can find more info at the new docs site: https://moshensky.github.io/pdf-visual-diff/functions/comparePdfToSnapshot.html

moshensky avatar Sep 06 '24 13:09 moshensky