3

This question already has an answer here:

Visio can export many different image formats but only .emf and .pdf as vector graphics. Tex can only handle .eps and .pdf vector graphics and therefor .pdf is the file format to go.

But there is the problem. All PDF exports allways have a big white margin around them and can't be imported in Tex like this.

How to export a Visio graphic properly to use it in Tex?

marked as duplicate by Spen, Mensch, Stefan Pinnow, barbara beeton, CarLaTeX Nov 1 '17 at 4:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    For a general way to crop PDF files (not just from Visio), use the pdfcrop command line utility as described here: tex.stackexchange.com/questions/5559/… – James Jun 22 '16 at 14:43
  • I usually do the exporting by doing a print and saving it to a PDF. The important part tough is that remember to increase the resolution and disable any compression before hitting the print button. And then include the PDF in your latex. – user144028 Sep 22 '17 at 9:38
  • 5
    I'm voting to close this question as off-topic because it is a question about Visio not about TeX. – Schweinebacke Oct 30 '17 at 9:19
  • How to remove the margin for Visio is completely off topic. This question should have been closed. – Johannes_B Oct 30 '17 at 9:19
  • @Schweinebacke Actually you are wrong. Reading this question with it's answers after the fact does look like off-topic but this question actually looks for a solution within Tex. I couldn't find any and therefore posted my workaround outside of Tex. But this is not the desired solution. Therefore this question is actually not off-topic. It was made off-topic by the existing answers or the lack of solutions within tex. But as moha showed in ins answer (4h ago) there is a tex solution to this problem. – Spen Oct 30 '17 at 12:42
3

I had the same problem.

I found a simple way to deal with it.

  • Save the chart as svg file by Visio.
  • open the svg file by Inkscape.
  • Save as the .pdf format
  • On the next pop up window:
    • Embed Fonts
    • Use exported object's size
    • Margin 0.1
  • click ok

Next the generated pdf file will be imported by latex easily as same as png or eps.


But some times inkscape does not read the svg file properly and some mistakes are occurred. In this case the solution which works great and mentioned above is:

  • save the pdf file by visio

  • include the pdf file in latex

  • use trim for cropping the figure in latex

for example:

\includegraphics[width=0.8\textwidth, trim={1cm 3cm 1cm 8cm},clip]{Fig.pdf}
5

I was searching for a solution for some time so it's probably usefull for someone else.

You have to do the following in the same order:

In Visio:

  1. Go to options and open Customize Ribbon
  2. Add the developertools to the menu
  3. Go to the developer tab and open Show ShapeSheet -> Print Properties
  4. Edit PageLeftMargin, PageRightMargin, PageTopMargin and PageBottomMargin to 1
  5. Fit to Drawing
  6. Export PDF
  7. options -> current page & don't show background
  8. Save PDF file

In Tex as usual:

\begin{figure}
    \centering
    \includegraphics{graphic.pdf}
    \caption{graphic} \label{fig:graphic}
\end{figure}

I hope this helps someone else struggling with this problem.

Not the answer you're looking for? Browse other questions tagged or ask your own question.