17:39 - Friday, 18 April 2014

How Can I Convert Text To Paths With Pdflatex?

Is there any way to convert text to paths? I tried to use Inkscape, but it

has some troubles with reading a PDF file.

The PDF is produced by pdflatex (I can’t use dvips) with the beamer class and the beamerposter package.

Basically, I understand that Type1 fonts should be enough, however people in our print office require paths instead of text.

I assume you want to convert the entire document into outlines, in this case you can use pdf2ps utility to convert the PDF to outlined PS file, and you can then use ps2pdf to convert it back to PDF (both utilities from Ghostscript).

$ pdffonts test.pdf name                                 type              emb sub uni object ID------------------------------------ ----------------- --- --- --- ---------PEUCZM+Amiri-Regular                 CID TrueType      yes yes yes     18  0$ pdf2ps test.pdf $ ps2pdf test.ps$ pdffonts test.pdf name                                 type              emb sub uni object ID---

Works also with package beamerposter

documentclass{beamer}usepackage[T1]{fontenc}usepackage{pst-text}DeclareFixedFont{RM}{T1}{ptm}{b}{n}{2cm}begin{document}begin{frame}{News}{}pscharpath{RM Japan won}parpausepscharpath[fillstyle=solid,fillcolor=red!70]{RM the World}parpausepscharpath[fillstyle=solid,fillcolor=blue!70]{RM Cup}parpauseend{frame}end{document}

enter image description here

An alternative with less possibilities for filling is to use an outline font like Biolinum:

documentclass{beamer}usepackage{fontspec}setsansfont{Linux Biolinum O}newfontfaceOutline{Linux Biolinum Outline O} begin{document}begin{frame}{News}{}fontsize{40}{42}selectfontOutlineJapan wonparpausethe WorldparpauseCupparpauseend{frame}end{document}

This needs a lualatex or xelatex run!

enter image description here


pdftops -level3 myfile.pdf myfile.ps

(note pdftops not pdf2ps) and then use ghostscript to convert back to pdf with a command something like:

gswin32c -q -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dNOPAUSE -dPDFSETTINGS=/prepress -dAutoRotatePages=/None -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -sOutputFile=myfile-curves.pdf -c "/show { true charpath currentpoint /jy exch def /jx exch def fill jx jy moveto} bind def /ashow {exch pop exch /j_ax exch def show /j_ax {0} def } bind def /widthshow { show pop pop pop} bind def /awidthshow {ashow pop pop pop} bind def" -f myfile.ps