22

I am running MS Office under wine and would like to print PDF documents.

Installing the official extension via wine does nothing.

3 Answers 3

33

The answer is cups-pdf

sudo apt-get install cups-pdf

or from Ubuntu 16.04 on

sudo apt-get install printer-driver-cups-pdf

If there's no such folder, create PDF at your home:

mkdir ~/PDF

Now you're set to go. From MS Word, do Print -> Select PDF as printer -> wait for the printing to complete (it takes some time).

6
  • 1
    +1, just a note: I didn’t have to manually create the ~/PDF folder; this was done automatically for me (CUPS-PDF version 2.6.1-6, Ubuntu 12.04).
    – Chriki
    Dec 12, 2013 at 18:17
  • 1
    Once cups-pdf installed, you need to create a new PDF printer from the control panel in Ubuntu. This "printer" will be available for the whole system (including wine).
    – user351382
    Nov 23, 2014 at 10:41
  • My worked only after rebooting the computer. Nov 12, 2016 at 1:46
  • And the printing does not appear to be well-translated. I have two-color tables, equations, and transparent boxes, and, when printing using cups-pdf, all three come out somewhat strange. The transparent box is pixelated and somewhat visible, some variables are misplaced in the equations, and the second color of the tables is blurred into the first color. Any ideas?
    – Marius
    May 20, 2017 at 16:06
  • in U 18.04+ it does not work any more, the CUPS-PDF printer disappears from the GUI menue. Any idea how to fix that? Nov 5, 2018 at 16:29
5

cups-pdf didn't work properly for me, here's what I did:

Download the official extension from Microsoft's website. It didn't work for me eihter initially, but this is because I have Microsoft Office installed in a separate Wine prefix.

To find out if you have Word installed in a separate prefix, look at the file ~/.local/share/applications/wine/Programs/Microsoft Office/Microsoft Office Word 2007.desktop. Locate the line that starts with "Exec". On my system it looks like this:

Exec=env WINEPREFIX="/home/rune/.wine_office2007" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/rune/.wine_office2007/dosdevices/c:/users/rune/Start\\ Menu/Programs/Microsoft\\ Office/Microsoft\\ Office\\ Word\\ 2007.lnk

From this I can see that Office is installed in the prefix /home/rune/.wine_office2007.

Now go to the folder where you downloaded the official PDF add-on. And run the .exe file using the following command, replacing <prefix> with the prefix in the "Exec" line of your Word .desktop file.:

WINEPREFIX="<prefix>" wine SaveAsPDFandXPS.exe

In my case the prefix is /home/rune/.wine_office2007, so the command to install the add-on becomes:

WINEPREFIX="/home/rune/.wine_office2007" wine SaveAsPDFandXPS.exe

After doing this, restart Word, and you should see the option to save as a PDF in the Save As file menu.

3
  • Make sure that you create the PDF folder in your home directory. Also shut down all programs that use wine and manually kill any wine processes still running (check with ps ax | grep wine): killall wineserver && killall winedevice.exe This should force the list of available printers in Wine (and Word) to be reset. Alternatively you could prefer to reboot.
    – logion
    Jun 19, 2014 at 8:37
  • Just installing cups-pdf didn't work for either but after rebooting the computer it worked just fine. Nov 12, 2016 at 1:45
  • Link rot: the extension is no longer there.
    – Michaël
    Jun 30, 2020 at 20:15
5

I support runeks' answer.

However, I kept having problems installing the SaveAsPDF.exe extension - it never showed up as being installed.

I finally realized that I had used PlayOnLinux to install Office rather than pure Wine, and this meant using the PoL Wine prefix.

This thread (in Italian!) helped me solve it:

http://forum.ubuntu-it.org/viewtopic.php?t=447961&p=3510913

Basically had to look in my /home/name/.PlayOnLinux/wineprefix folder to discover the correct WINEPREFIX path, then used that to run the .exe file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.