Sunday, 2 June 2013

Are there any commands for extracting tikz pictures from a pdf file?

Are there any commands for extracting tikz pictures from a pdf file?

I know that pdfimages can extract images from pdf file.
But how to extract an embedded image that is generated by some tikz code?
EDIT
I just need the high quality picture. It seems the picture is generated by some tikz commands (it's a vector picture for sure).
Well, it's nice to know the commands for generating that picture, but I did not expect that would be possible.
EDIT2
I'm using the trim & clip, options of \includegraphics now, but still looking forward to some automatic extraction commands.
\documentclass{standalone}
\usepackage{graphicx}

\begin{document}
    \includegraphics[trim = 15mm 113mm 110mm 130mm, clip]{a-single-page-pdf-file}
\end{document}
EDIT3
Add a ruler, just to make it easier
\documentclass{standalone}
\usepackage{graphicx}
\usepackage{tikz}

\begin{document}
    %\includegraphics[trim = 1.5cm 11.3cm 11cm 13cm, clip]{single-page-pdf}

    \begin{tikzpicture}
        \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics{single-page-pdf}};
        % A4 paper size: 21.0 × 29.7
        \draw[help lines,xstep=1,ystep=1] (0,0) grid (21,29.7);
        \foreach \x in {0,1,...,21} { \node [anchor=north] at (\x,0) {\x}; }
        \foreach \y in {0,1,...,29.7} { \node [anchor=east] at (0,\y) {\y}; }
    \end{tikzpicture}

\end{document}

No comments:

Post a Comment