Wikipedia:Graphics Lab/Resources/PDF conversion to SVG: Difference between revisions

Content deleted Content added
Added dvisvgm tool
Line 39:
#Convert the PDF with <tt>pdf2svg file.pdf file.svg</tt>
#If necessary use Inkscape to edit the resulting SVG.
 
====Conversion with dvisvgm====
 
Large and complex PDFs such as some of the maps from the USGS are sometimes difficult for PDF2SVG or Inkscape to convert. For PDFs that are not able to be converted by these tools, <tt>dvisvgm</tt> seems to do a better job, and even results in smaller SVGs in some cases. <tt>dvisvgm</tt> is often distributed as part of TexLive, and instructions for obtaining it are available on [https://dvisvgm.de/ their website].
 
To convert a PDF to SVG with dvisvgm, run the following command:
<tt>dvisvgm --pdf --output=file.svg file.pdf</tt>
 
If you want to make your SVG smaller, you can add <tt>--optimize=all</tt> to <tt>dvisvgm</tt> and additionally run the resulting SVG through [https://github.com/RazrFalcon/svgcleaner svgcleaner] to further shrink the file without perceptual quality loss.
 
===Extracting part of a PDF===