Not sure what you mean by "attach all reciepts to it"
I have lineItems for the invoice. One of the fields is a container for scanned receipts. What I would ultimately like (and can achieve in the cluncky way above) is a PDF with the invoice and then scanned receipts. Does that make more sense?
In later versions of FileMaker you can "append" a PDF to an existing PDF file. So you can do the Invoice first, then append the Receipts. I believe it starts a new page with the appended.
The mechanism to do the above automatically would be to calculate a valid file path, as an absolute path, using FileMaker syntax, set it into a local script Variable, Save As PDF [$path]. Then go to the other layout, Save As PDF [$path, Append] (a checkbox on the left of the dialog). Calculation for the $path Variable (result Text, Storage, [x] Do not store)
Let ( [
prefix = Case ( Abs ( Get(SystemPlatform)) = 1; "filemac:"; "filewin:")
folder_path = Get (DesktopPath);
file_name = "some field name.pdf" // however you want to do it, without overwriting existing?
prefix & folder_path & file_name
P.S. The OS Web Viewer syntax (on a Mac) looks like:
file:///Users/fej/Desktop/Screenshot.pdf // but the above is closer to a FileMaker syntax path
Absolutely - that's how I did it. The question now that I have the"full" PDF is how to show it to the user before printing? I've donw this at the moment through the webviewer pointing to the pdf exactly how you describe. The PDF shows up beautifully in the viewer and the user can print it from in there but there is no way to know that. I've set up two buttons "cancel" and "continue" which assume that the user did not and did, respectively, print the report. This seems clumsy to me. Is there a better way?
Thanks for you help!
In what way do you consider it clunky? The user must click a button, in order to tell you for sure that they did it (printed? sent the PDF?). But you would need to make sure that they could not leave the "viewing" layout by some other means.
I think it's clunky because the user could choose not to print the PDF (from the browser) and still click "continue"(or vice versa). I would prefer the solution to "know" if the PDF was printed rather than the user having to "tell" it. I'm just not sure there's a way to do this...
You could Print without dialog, or you can capture a "Cancel" of a Print Dialog, if you Set Error Capture ["On"]. But other than that...
But the print command comes from within the WebViewer - how can I access the PDF viewer commands in the solution? I'm confused - the "print" script will not print the PDF as if the user printed it from the webviewer's PDF viewer. Does that make sense?
I supposed you could print the Web Viewer itself. But I have no idea what quality you'd get out of that; and there is a 111 inch layout length limit. Also, you'd have to write to the WV to change the default alignment to top instead of center.
On a Mac I would just print the file directly, using AppleScript with the Unix "lpr" command, which prints directly to the default printer, or to whichever printer you specify.
Or you could just redo the PDF, but check the [x] open file option. Then they could just Print from whatever app opened the PDF. Since they'd already clicked the button to say they were going to print it, that would be OK.