3

I would like to add a background image to an Excel sheet covering the whole page and print it.

  • A background in Excel is only shown on screen and not printed.
  • Using a large image as header in Excel works but leaves a lot of white space.

I tried generating a 'background' PDF and using pdftk to merge them, which worked well a couple of years ago but I am no longer able to find a working version of pdftk (see for example https://trac.macports.org/ticket/48528).

pdftk excel.pdf background background.pdf output out.pdf

Is there another way to achieve the same result?

Edit

A screenshot of what I was able to achieve with a PDF background:

A screenshot of what I was able to achieve with a PDF background

All the Excel solutions have some margins.

  • Does extendoffice.com/documents/excel/… help? – nohillside Aug 31 '15 at 6:34
  • It has the same effect as putting the image as a header. It will not cover the whole page. – Matteo Aug 31 '15 at 6:39
  • I may have missed this, but what version of Excel? 2011 or 2016? – bjbk Aug 31 '15 at 23:03
  • @bjbk I have both, any solution would be OK (even Open or Libre Office could be an option). – Matteo Sep 1 '15 at 5:47
  • I do it routinely with Numbers. But there are limitations with formulas. (No array formulas) – bjbk Sep 1 '15 at 10:45
1
+50

You mention in the comments that you are open to other solutions outside of Excel. That being the case, I found Apple Numbers to do well with using a PDF form as a background image. This requires no outside software to modify the original PDF.

Embedding the PDF

To begin with, select the PDF you wish to use. If it is a multi-page document, I find it works best to separate the pages by copying them to individual sheets. (They can still all be printed or exported together as a single document from Numbers.)

This example uses a generic Employment Application.

Create a new Numbers document

  • Use the default blank template and delete the table if desired. Later, we will add tables that can offer far more flexibility of position over the PDF than can be done with a conventional spreadsheet table.
  • Paste your PDF onto the sheet.
  • Set the size to the Original Size using the button
  • set the position to 0x and 0y
  • Lock the image so it does not get moved again inadvertently (It can be unlocked at any time for adjustment, then re-locked)

Inspector change size


Change the Print Setup

  • Enter the Print Setup by selecting File > Print +P
  • Set the Page Margins to 0"
  • Set the Header and Footer to -.5" or -1cm

Page Margins

Resulting printout


Overlay Tables

  • Add tables over your fields. These tables can be independent and inter-connected, meaning that tricks like merging cells is unnecessary. They can be inter-referenced for calculations just as can be done in Excel.

Tables Overlaid

Custom cells


Formatting Tables

Tables can be formatted to taste. - Remove borders - Change font colors - Use formulas

With a little creativity, I think you would be easily able to use Numbers to create your documents. I would recommend the creation of a template for future use if you need the same document over and over again.

Tip: Saving the finished document as a PDF. Use the Print Dialog to export as a PDF rather than the PDF export feature in Numbers.

Print dialog


Resulting PDF

Finished product

  • Glad it worked!! – bjbk Sep 3 '15 at 14:01
0

ImageMagick

Consider using ImageMagick's composite tool to combine the Excel PDF and your background image:

Use the composite program to overlap one image over another. See Command Line Processing for advice on how to structure your composite command or see below for example usages of the command.

Example Usage

We list a few examples of the composite command here to illustrate its usefulness and ease of use. To get started, lets overlay a smiley face over a rose:

composite -gravity center smile.gif  rose: rose-over.png

You will probably need to write a short script to deal with each page, but the result should be more resilient and should work across multiple versions of OS X.

You can use Automator to split out each page of the Excel PDF and, after compositing with the background, another Automator Action can recombine the pages.

Vector Art Applications

There are numerous vector applications available on the Mac that can achieve the result you are looking for:

pdftk

Working editions of pdftk for OS X 10.9 and 10.10 appear to be available, see How to install pdftk on Mac OS X for build details and various forks.

pdftk on OS X 10.9+

For 10.9 and 10.10, try using the quantiverge edition of pdftk on homebrew. Comments suggest this works on OS X 10.9 to at least 10.10.4.

Install homebrew and then use the command:

brew install https://raw.github.com/quantiverge/homebrew-binary/pdftk/pdftk.rb
  • I have the same behaviour as with the "official" release. The process hangs with no output. – Matteo Sep 1 '15 at 12:31
  • If you can, please report a bug with pdftk. I have extended the answer to mention ImageMagick. – Graham Miln Sep 1 '15 at 12:44
  • I will submit a bug report but the dependency on gcj gives little hope. The are several re-implementation of pdftk but none of them seems to support (yet) the background command. – Matteo Sep 1 '15 at 15:17
  • As for ImageMagic it works by converting everything to a bitmap. – Matteo Sep 1 '15 at 15:18
  • Is a high resolution bitmap unworkable – if nothing else currently works? Alternatively, why not consider a vector art tool like Inkscape or Sketch – both have scripting interfaces and fine grain PDF control. – Graham Miln Sep 1 '15 at 20:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .