Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Extract diagrams from PDF to SVG (github.com/mbrukman)
7 points by mbrukman 1 day ago | hide | past | favorite | discuss
I've noticed that many blog posts about papers (which are in PDF) use raster screenshots (JPG, PNG, etc.) of key diagrams, which makes it hard to zoom in on the details (e.g., on mobile) because they pixelate and turn blurry, unless the screenshot was taken at a much higher resolution than the space on the page, which enables some zooming in without much degradation.

I wondered why they don't use SVG (since the original source in the PDF is usually a vector diagram), and when I went to try to extract diagrams as SVG from a PDF, I wasn't able to find an easy way to do that, even when trying SVG editors which have support for importing PDFs such as Inkscape.

So I built a small GUI tool which lets you open a PDF and view it, visually select a rectangular region (which you can drag to reposition), and save the region to an SVG.

It uses the Poppler CLI tools to do the PDF rendering and extraction, but it would be difficult to specify the necessary flags (especially the coordinates) to these tools manually without a GUI tool like this.

Please try it out and see if it's helpful! Feature requests and bug reports are welcome, including any issues with installation or usage.

Thanks for taking a look.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: