Troubleshooting Email PDF attachments

You can construct a workflow rule to send an email along with a PDF attachment. To do so, you specify a document template (currently, this must be a Google Doc on Google Drive) which has variables that are replaced by the actual values in an updated data row.

Occasionally, the PDF produced is not identical in formatting to the original document. Problems include changes in the margins, portrait vs landscape mode, changes in page break positions, and other such formatting issues. To understand why they occur, here is an explanation of the process followed by the AppSheet backend.

When the workflow rule fires successfully,

  1. The document template (a Google doc) is downloaded from Google Drive in HTML format. So it is converted from the Google doc format to HTML format. This conversion is lossy --- in particular, HTML does not include concepts of pagination.
  2. AppSheet replaces variables in the HTML document format with the actual values from the row.
  3. AppSheet then converts the HTML document into a PDF document. This conversion reintroduces concepts of pagination (like margins and page breaks). However, these may not perfectly match the original pagination settings.

We are working to eliminate these differences. However, it is useful to know why these differences exist. If you find an unacceptable mismatch in formatting, the easiest way to work around it is to try exporting the document template to HTML format and examine the result. Often you can make minor changes to the structure of the Google document template to ensure that it exports to HTML format with good fidelity. 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.