[Tex/LaTex] Exporting true pdf without dpi

graphicspdfresolution

I've used Inkscape for certain drawings, with the aim of including them into the text for printing. The whole text is compiled with LaTex.

I chose the option "save as", and then select pdf option with dpi of 90. However, since the rest of the text is pdf, the imported image seems "less sharp", and does not allow "endless zooming" that I could do with text. The problem is more noticeable with printing, where the imported image (from Inkscape) is just "out of the rest" with sharpness.

What would be your suggestion for a good quality drawing that would "fit the sharpness"? Since the drawings are created in Inkscape, I might export it to svg. Any other software that would allow me to export good pdf from svg?

The best way would be to allow automatic and "as in Inkscape" import of graphtics to LaTex. Is this possible. Note that LatexDraw could allow me to achieve some work, but without some sophisticated drawings that I easily achieve with Inkscape.

Could someone share the idea of how I might get the true, infinite resolution PDF from the svg I created in Inkscape. It seems that whatever I create in Inkscape, the 'save as' – > pdf option always asks for dpi.

Best Answer

Inkscape should export to a pure vector PDF file. There is no need to tweak the DPI value or using the --export-dpi option, since it only affects the rasterized output that you want to avoid.

It can be problematic to convert from one vector format to another. That only works under two conditions:

  • The target format supports all the features of the source format (or these features cannot be used)
  • There is a conversion program that knows how to map the features from the source to the target format

Problems most likely occur if you use gradients or filters. I don't know how well inkscape handles the conversion of gradients, but when filters are used, the output is always rasterized.

A workaround would be to use the option --export-ignore-filters. Instead of applying the filters and to rasterize the output, inkscape ignores the filters and keeps the vector format, which is — in my opinion — almost always a way better choice.

Here is an example to convert the file drawing.svg to drawing.pdf:

inkscape \
  --export-pdf=drawing.pdf \
  --export-ignore-filters  \
  --export-area-drawing    \
  drawing.svg

--export-ignore-filters forces inkscape to not use filters, which would rasterize the output. --export-area-drawing is used to set the bounding box. Without this option the entire page would be exported.

Related Question