Other Stuff

Google Docs

I'm using Google Docs for almost everything document related. Couldn't figure out how to use the spreadsheet with a background image, though.

Now I'm exporting the spreadsheet to OpenDocument (ODS). To make this work, you have to make sure not to 'wrap' any text. There's a “Wrap text” icon in the tool bar which show the wrap-status for any cell in your spreadsheet. But you can also just select them all and toggle the 'wrap' button to make sure it's not activated. Also, be very careful with ctrl-enter: this will also created undesired white space in the target ODS document.

Then I open the document with OpenOffice (LibreOffice) and export it from there as pdf. Now I'm ready to add the background image, with this little script:


  echo "Usage: $0 -f original_pdf_file"
  exit 1
# $# contains number of arguments
if [ $# -eq 0 ] 
	usageQuit # no arguments
args=`getopt f: $*`
# $? contains exit status or return code of last command
if [ $? != 0 ]
	usageQuit # not the right arguments
set -- $args
if [ $? != 0 ]
	usageQuit # not the right arguments or options
for i
  case "$i" in
        -f) shift; PDF_FILE=$1; shift;;     


pdftk ${PDF_FILE} background ${BACKGROUND} output out.pdf
mv out.pdf ${PDF_FILE}

This is how you call the script (make sure it's executable):

./invoicing.sh -f big-invoice.pdf

And that's it, now your page filling background.pdf will get merged with big-invoice.pdf and stored under the latter name.

Personal Tools