Live data from Hacker News

A tool that converts PDFs to SVG, built using PDF.js

pramodhkp.github.io

1–10 of 13 posts

Re: A tool that converts PDFs to SVG, built using PDF.js

#3
I've used `pdftocairo -svg` (it's part of the Poppler[0] utilities) to do this in the past, but Cairo insists on converting all of the text to shapes. (They are/were planning to fix that, so maybe it's already fixed.) You've got all of the text there, so you're a step closer to what I wanted, but I noticed that the spaces are all missing. I'm actually pretty impressed that SVG can render properly without the spaces for the text.

[0] http://poppler.freedesktop.org/

Re: A tool that converts PDFs to SVG, built using PDF.js

#7
post #4

When would one need a SVG version of a PDF instead of just using pdf.js by itself?

I've had several cases where a drawing I want to edit is only available as PDF. There are various ways to convert between the formats (e.g. inkscape) but so far I haven't found one that always works.

Re: A tool that converts PDFs to SVG, built using PDF.js

#8
I would be interested in knowing about the Sizes of SVG produced by this tool. Some of the SVGs converted by poppler utility tool 'pdftocairo' are just too large i.e few MB's which is absolutely unacceptable as these large SVG'S tends to crash the mobile browsers.

Re: A tool that converts PDFs to SVG, built using PDF.js

#9

I would be interested in knowing about the Sizes of SVG produced by this tool. Some of the SVGs converted by poppler utility tool 'pdftocairo' are just too large i.e few MB's which is absolutely unacceptable as these large SVG'S tends to crash the mobile browsers.

Original PDF - 1.0M, SVGs - 7.7M, gzip'ed SVGs - 1.7M. I think the latter is a preferable format for the web, so you are looking 70% increase for this types of documents, but bare in mind that you may send only certain pages.

Re: A tool that converts PDFs to SVG, built using PDF.js

#10
post #5
post #2

The fonts are not kept. Any real use case?

What does "the fonts are not kept" mean? http://pramodhkp.github.io/pdf2svg/svgdump/tracemonkey-1.svg looks as original PDF page and the SVG contains embedded fonts.

Oh, thanks. Sorry, I've just notice the CSS style for web browsers. So I should ask what is the use case for the web? Replacing PDF files for embedding without special viewers? And to add some custom styles if we want? seems great.
Post reply on HN