iframed PDF in a Form
We have a form for requesting meals to be ordered from a vending service for when we have guests and such. Previously the menu was in the form as a formula URL that had the link to the menu as an attachment from a resources table.
I was asked to update the menu. That's when I learned that employees would click the link in the form and the attachment would download and then they would have to open the file to view the menu. Not optimal.
I did some research and found a way to embed the PDF menu in the form as an iframe.
Here's how:
- upload the pdf to a file attachment field
- create an HTML page
- toggle the HTML button so you can add code
- add this code to the HTML page
- <iframe src="https://docs.google.com/gview?url=COPY&PASTE_YOUR_PDF_ATTACHMENT_URL_HERE&embedded=true" width="600" height="650" frameborder="0" target="_blank"></iframe>
- create a formula URL field
- add this formula
- URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=20"
- change the 20 to your page ID number
- check the embed as iframe box and set the window size
That's it.
For additional optimization I used text HTML to wrap the iframed menu and other fields into a table, table row, and table cells so that the menu is to the left of the fields where the requested items are inputted.
And now life is a little easier for my colleagues:
Enjoy.
------------------------------
Adam Keever
------------------------------