Solution 1
You can use Foxit PhantomPDF (see here):
- Select the text you want to convert (Tip: Use Edit Object > Text to only select text)
- Right click and press the "Convert to shape object" button at the bottom.
Solution 2
Adobe Acrobat also can do this (see this blog post):
- When you have opened the document you want to work with, look at the right side, and in the Tool panel click More Tools button.
- Now from here type in the Search bar Preflight and click on Preflight next to Print Production.
- In the now open Window, select Profiles.
- Make sure you have pressed the green bars button next to the Search field
- Enter Convert fonts into the field.
- Select any of the Convert fonts to outlines profiles and press the Analyze and fix button.
Solution 3
Alternatively if you don't want to use these proprietary tools you can use the mat2 metadata removal tool, which will also convert all text to paths.
- After installation, call it with
mat2 /path/to/file.pdf.
- The now created file
/path/to/file.cleaned.pdf should have all text converted to paths.
Solution 4
Another way is to convert each page the document to an individual SVG file and then reconvert and recombine those (taken from this StackOverflow post).
Convert pages to SVG:
import os, math
import cairo
import poppler
def convert(inputname, base=None):
'''Converts a multi-page PDF to multiple SVG files.
:param inputname: Name of the PDF to be converted
:param base: Base name for the SVG files (optional)
'''
if base is None:
base, ext = os.path.splitext(os.path.basename(inputname))
# Convert the input file name to an URI to please poppler
uri = 'file://' + os.path.abspath(inputname)
pdffile = poppler.document_new_from_file(uri, None)
pages = pdffile.get_n_pages()
# Prefix the output template with zeros so that ordering is preserved
# (page 10 after page 09)
output_template = ''.join([
base,
'_',
'%0',
str(math.ceil(math.log10(pages))),
'd',
'.svg'
])
# Iterate over all pages
for nthpage in range(pages):
page = pdffile.get_page(nthpage)
# Output file name based on template
outputname = output_template % (nthpage + 1)
# Get the page dimensions
width, height = page.get_size()
# Open the SVG file to write on
surface = cairo.SVGSurface(outputname, width, height)
context = cairo.Context(surface)
# Now we finally can render the PDF to SVG
page.render_for_printing(context)
context.show_page()
# Free some memory
surface.finish()
Assembling the SVGs into a PDF:
import rsvg
import cairo
def convert_merge(inputfiles, outputname):
# We have to create a PDF surface and inform a size. The size is
# irrelevant, though, as we will define the sizes of each page
# individually.
outputsurface = cairo.PDFSurface(outputname, 1, 1)
outputcontext = cairo.Context(outputsurface)
for inputfile in inputfiles:
# Open the SVG
svg = rsvg.Handle(file=inputfile)
# Set the size of the page itself
outputsurface.set_size(svg.props.width, svg.props.height)
# Draw on the PDF
svg.render_cairo(outputcontext)
# Finish the page and start a new one
outputcontext.show_page()
# Free some memory
outputsurface.finish()
dvipswith beamer! – Jul 18 '11 at 18:39