fermi Posted October 23, 2009 Posted October 23, 2009 I am building a report via the Save Records as PDF from various layouts, appending as I go. Along the way I need to export a PDF from a container field and append this exported PDF to the report being created via the Save Records as PDF. I can't seem to figure out how to get the various "exported" PDF's appended to the report I am building it. Perhaps I've missed the answer in the forum? The end goal is to have a single report with all the "exported" PDF's in their proper place within the main document.
jamesducker Posted October 23, 2009 Posted October 23, 2009 FileMaker has no facility to append exported PDFs (from a container field) to an existing PDF that is created with "Save records as PDF". You can however achieve this by making FileMaker call an AppleScript, which calls a Shell script, which calls a Python script! It's not as horrific as it sounds. The python script is already on your mac and is described here: http://kpwu.wordpress.com/2007/02/02/joinsplit-pdf-file-easily-at-mac/ Get yourself familiar with how it works, and experiment with it manually in the Terminal. Once you have tested it, you need just a few lines of FileMaker script: set variable $pdfsToCombine to "saved1.pdf exported.pdf saved2.pdf" set variable $outputName to "finished.pdf" set variable $shellCommand to "/System/Library/Automator/Combine PDF pages.action/Contents/Resources/join.py -o " & $outputName & " " & $pdfsToCombine perform Applescript "do shell script "" & $shellCommand & """ That should do it. You may need to play around with pathnames and syntax but the principle is there. Hope that helps. James
fermi Posted October 23, 2009 Author Posted October 23, 2009 Thank you, I'll try it right now. Although I develop on a Mac, my users are all PC. Is there an equivalent to "Python Script" native on a PC?
jamesducker Posted October 23, 2009 Posted October 23, 2009 I don't know much about Python or how portable it is to the Windows environment. However a forthcoming project of ours requires exactly this. My research so far has led me to this: http://www.accesspdf.com/pdftk/ which looks promising as a starting point for command-line-based Windows PDF combining. J
IdealData Posted October 23, 2009 Posted October 23, 2009 FileMaker WILL allow PDF appending, but you need to get version 9 or higher.
jamesducker Posted October 23, 2009 Posted October 23, 2009 Yes, you can append to existing PDF when doing 'save records as PDF', but you cannot append the pages from a PDF file being exported from a container field. It could only be done completely by FileMaker if: - you have only one PDF being exported from a container field - that PDF is to come BEFORE all the pages to be generated via 'save records as PDF' Because you could then: - export field contents ( PDFcontainer ; file:output.pdf ) - perform find (restore) - go to layout (whatever) - sort (however) - save records as PDF (file:output.pdf ; append) - perform find (restore) - go to layout (whatever) - sort (however) - save records as PDF (file:output.pdf ; append) - perform find (restore) - go to layout (whatever) - sort (however) - save records as PDF (file:output.pdf ; append) If you have more than one PDF in a container, or you don't want it at the beginning, then you need Python or similar. James
jamesducker Posted October 23, 2009 Posted October 23, 2009 If the exported document goes in the middle of the finished "book" then you need three PDFs: 1) a PDF (built using Save Records as PDF, appending as necessary) containing all the pages that should come BEFORE the exported PDF 2) the exported PDF 3) a PDF similar to file 1, but containing all the pages that should come AFTER the exported PDF You then use join.py or a Windows equivalent to join them together. James
bcooney Posted October 23, 2009 Posted October 23, 2009 James said:My research so far has led me to this: http://www.accesspdf.com/pdftk/ which looks promising as a starting point for command-line-based Windows PDF combining. Lastest version, Nov. 28, 2006!
jamesducker Posted October 23, 2009 Posted October 23, 2009 Yes, I noticed that too! But if it was a good product in 2006 it *might* still work reliably now, all the more so as it is a command-line thing. After all, my copy of FileMaker 6 is still going strong ;-) J
jkrier Posted November 18, 2009 Posted November 18, 2009 Fermi, Did you get this to work on Windows with the following? »http://www.accesspdf.com/pdftk/« I am trying to do the same thing. I have 2 PDFs and want to append into one on the fly. The first is a PDF generated from FM. The second is a standard, static document I'm gettting from the Windows file system. The downside is that you have to install the pdft.exe file so everyone can access it. Yet another layer to maintain. Thank you.
Recommended Posts
This topic is 5552 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now