Print merge on Google Drive with autoCrat
Posted by Geremia Taglialatela on 24 January 2014
We were looking for a way to create simple invoices using a “print merge” approach that wouldn’t require offline software. We wanted a solution on the cloud, free, compatible with Google Drive and possibly open source.
Update! February, 25th 2016
You should use the last version of autoCrat. Examples here are not up to date, sorry.
Update! May, 4th 2015
After April 20th, autoCrat script stopped working again. Here it is a fix:
Go to Tools -> Script Editor. Then go to Edit -> Find and replace.
- Find 
DocsListand replace all withDriveApp - Find 
"document"(both lowercase and uppercase, with quotes) and replace all withMimeType.GOOGLE_DOCS - Find 
getFileTypeand replace all withgetMimeType - Find 
file.addToFolder(folder)and replace all withfolder.addFile(file) - Find 
copy.addToFolder(parent)and replace withparent.addFile(copy) - Find 
pdfFile.addToFolder(secondaryFolder)and replace withsecondaryFolder.addFile(pdfFile) - Find 
file.addToFolder(secondaryFolder)and replace withsecondaryFolder.addFile(file) - Find 
copy.removeFromFolder(root)and replace withDriveApp.removeFile(copy) - Find 
pdfFile.removeFromFolder(DriveApp.getRootFolder())and replace withDriveApp.removeFile(pdfFile) - Find 
file.removeFromFolder(DriveApp.getRootFolder())and replace withDriveApp.removeFile(file) 
Credits: ReferenceError: “DocsList” is not defined
Update! October, 13th 2014
After September 30th, autoCrat script stopped working. Here it is a simple fix:
Go to Tools -> Script Editor. Then go to Edit -> Find and replace.
- Find 
createDecordatedPopupPaneland replace all withcreatePopupPanel. - Find 
DocsListDialog()and replace all withDocsListDialog().setOAuthToken(ScriptApp.getOAuthToken()). 
Credits: Having trouble with Autocrat… Fix for Failed UI on Drive Picker for autoCrat, Doctopus, and formRat
Fortunately there is autoCrat, a Google Apps Script that meets our requirements and we want to share our experience.
autoCrat has a very good documentation and a video tutorial, it was very simple to setup and use. There are some issues with formatted fields (dates, currencies…) but we found a very simple workaround. Let’s say the field B2 contains January, 20th 2014 (in date format). autoCrat will produce Mon Jan 20 2014 00:00:00 GMT+0100 (CET). You can add a new cell with the formula =TEXT(B2; "mm-dd-yyyy") and instruct autoCrat to use the new column. We did the same thing for money values (=TEXT(F2; "$ #,###.00")). After doing this, you can hide these “helpers” columns in the spreadsheet.
A working example is available in this Google Drive shared folder
All comments and suggestions are welcome.
Names, addresses and companies were generated via Fake Name Generator