Convert PDF with embedded fonts to EMF for PowerPoint
I had been facing the same problem as you: I had a number of .pdf
files (two pages each) that I wanted to transform into something that I could import into a Word file; something just happened to be an .emf
in the end (all other formats were not accepted).
This answer assumes you are comfortable in using the console.
The tool of choice to convert vector format X into vector format Y seems to be inkscape
. However, when importing a .pdf
file directly into inkscape
- you can only access the first page on console (to the best of my knowledge)
- even if you select the text-to-paths option flag
-T
, the text is not well-transformed.
Therefore, I found it necessary to pre-convert the .pdf
file into something inkscape
is able to use. I found this answer very useful, especially the mention of pdf2svg
. My final sequence was the following:
pdf2svg input_filename.pdf interim_filename_%d.svg all
inkscape -T interim_filename_1.svg --export-emf=interim_filename_1.emf
(repeat for all additional pages of the .pdf)
To the best of what I can see on screen, transferring those .emf
files to a Windows machine and opening them using the Windows image viewer, the result is identical to the input. Plus, having tried a test case with a custom-made LaTeX document using a font not present on my Windows machine, I also found the result identical. Skipping the initial pdf2svg
step meant that the spacing was completely messed up after inkscape
’s conversion.
In my case, I did not need to remove the .pdf
page boundaries (I was dealing with full-page files). You may require such an intermediate step if you are interested in only a small part of the .pdf
page. Pulling from this answer, pdfcrop
seems to be able to do that.
Despite the title mentioning EMF, it sounds like the OP's actual goal is to include PDF files into PowerPoint while keeping everything as vector graphics, and EMF is only a means to do so, not an end. IguanaTex now supports import of vector graphics formats (PDF/PS/EPS/EMF) into PowerPoint.
Using IguanaTex also saves the user the trouble of preparing the EMF file for further editing. EMF files normally inserted in PowerPoint appear as pictures. They can be ungrouped into PowerPoint objects, but this creates extraneous shapes that need to be deleted. IguanaTex takes care of cleaning that up.
Internally, IguanaTex does in fact convert the PDF to EMF to then include it in PowerPoint. It does so using pdfiumdraw, which is part of TeX2img. The actual command is (see IguanaTex's source code on Github:
pdfiumdraw.exe --extent=50 --emf --transparent --pages=1 input.pdf
Full disclosure: I'm the developer of IguanaTex.