1

I am using the svg package to include an svg file with transparent 3D graphic and latex code to be set at the right label positions. I tried many different methods to do that (matlab->eps+tex file) where always a bitmap graphic was included in an vector graphic (eps) and non of them did perform nicely. I think the conversion from bitmap to vector graphics has sometimes problems with the conversion since I had regular patterns of white/blank line over the image.

Now after solving this issue with the matlab2svg and importing the resulting pdf of the svg package with \includesvg I have the issue with quite large files size and slow rendering of the final pdf at the corresponding pages.

Now I thought maybe one could change the svg package such that it generates the intermediate pdf not with the vector graphic but with a high resolution bitmap pdf (let's say 600dpi). This should decrease the final file size and increase the pdf rendering while viewing it.

Can somebody tell me if this is possible and how I could come to this solution? Maybe it is just a change of an option and that's it. My goal is to have a quite straight forwards automated workflow and until now the svg workflow was the best for my graphics despite of the resulting file size.

Hope for some advise. Best regards to the latex geeks out there!

1
  • 1
    I don't understand, vector graphics are strictly speaking unitless. You can scale them as you like. You can for instance use the shell of inkscape."` Commented Mar 3, 2014 at 14:07

1 Answer 1

2

Until someone finds a way within TeX, you can rasterize PDF-vector-graphics outside of TeX in your matlab-export-workflow, or from shell-escape within a TeX-document, in the TeX-import-workflow.

Many tools rasterize vector files. ImageMagick, GraphicsMagick, Inkscape, GhostScript... and Xpdf, which I prefer. You can find precompiled binaries for all important systems here: http://www.foolabs.com/xpdf/download.html. pdftoppm is the program within the xpdf-package that you need.

pdftoppm version 3.03
Copyright 1996-2011 Glyph & Cog, LLC
Usage: pdftoppm [options] <PDF-file> <PPM-root>
  -f <int>          : first page to print
  -l <int>          : last page to print
  -r <int>          : resolution, in DPI (default is 150)
  -mono             : generate a monochrome PBM file
  -gray             : generate a grayscale PGM file
  -freetype <string>: enable FreeType font rasterizer: yes, no
  -aa <string>      : enable font anti-aliasing: yes, no
  -aaVector <string>: enable vector anti-aliasing: yes, no
  -opw <string>     : owner password (for encrypted files)
  -upw <string>     : user password (for encrypted files)
  -q                : don't print any messages or errors
  -cfg <string>     : configuration file to use in place of .xpdfrc
  -v                : print copyright and version info
  -h                : print usage information
  -help             : print usage information
  --help            : print usage information
  -?                : print usage information

You can enable or disable anti-aliasing, choose pages and resolution in DPI. I suggest enabling AA for everything

After that you can convert the uncompressed bitmap file to .png- or .pdf-format with a tool of your choice (nconvert for me http://www.xnview.com/en/nconvert/).

1
  • Thanks, I'll give it a try and will come back later. Any suggestion how the code would look like which I would have to call in the tex file before I include my pdf with includegraphics command? The includegraphics call is automatically generated by the inkscape pdf+tex export I guess.
    – NanisTe
    Commented Mar 3, 2014 at 17:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .