Ask two PDF converters for the same A4 page at 300 DPI and one hands back a PNG 2481 pixels wide while the other says 2480. Nothing is broken, and a calculator is enough to see why. I ran one A4 page (595.276 × 841.89 pt, generated by me) through four things on a single Apple M4 machine, once each: poppler's pdftoppm 26.08.0, PyMuPDF 1.26.5, pdf.js 4.4.168 in a desktop Chromium 149, and ImgIng, a PDF to image tool in the desktop browser at https://imging.ai/ with its three presets of 144, 216 and 300 DPI. In the runs I watched, ImgIng sent no request that carried the file.
Four tools, three answers
A4 at 300 DPI Width × height
pdftoppm 2481 × 3508
PyMuPDF 2481 × 3508
pdf.js, canvas sized with Math.floor 2480 × 3507
ImgIng, 300 DPI preset 2480 × 3508
The pdf.js row is partly my doing. pdf.js hands you a viewport with fractional sizes, and the floor comes from my own line that creates the canvas.…