Outputing png from pgfornament

Contents


Installation of pgfornament

Download pgfornament.zip and follow the instructions in ornaments.pdf to install. Specifically:

  • pgfornament must to be in /texmf/tex/latex
  • pgflibraryvectorian.code.tex must to be in /texmf/tex/latex
  • pgflibraryam.code.tex must to be in /texmf/tex/latex
  • the folder vectorian must to be in /texmf/tex/generic
  • the folder am must to be in /texmf/tex/generic

Latex code — pgf-ornament-generate.tex

Here we render ornament 88. There are 89 ornaments, see instructions ornaments.pdf.

\documentclass{article}
\usepackage[margin=8mm]{geometry}
\usepackage[object=vectorian]{pgfornament}
\usepackage{pgfplots}

\usepgfplotslibrary{external} % creates a tight self-contained pdf figure for each tikzpicture
\tikzexternalize % comment out to debug if latex errors: generates the external pdf
\tikzset{external/force remake} % force remarking of external pdf otherwise will use external pdf

\tikzsetexternalprefix{figures/} % output the pdf to an existing directory (needs to exist)
\tikzsetnextfilename{pgf-ornament}

\tikzset{png export/.style={
	external/system call={
		pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource";
		echo "\\n---- Checking convert available ----\\n\\nPATH:" $PATH "\\n";
		which convert; echo; convert -version;
		convert -units pixelsperinch -density 150 "\image.pdf" "\image.png";
		convert -units pixelsperinch -density 600 "\image.pdf" "\image-600.png";
	}}}

\tikzset{png export}
\pgfplotsset{compat=1.12}

\begin{document}
\pgfornament{88}
\end{document}

Output png figure — pgf-ornament.png

fig

Output png figure — pgf-ornament-600.png

fig

Downloads


Code Index:

Sphere Index:

Misc Index: