Jump to content
Server Maintenance This Week. ×

Append an exported pdf


fermi

This topic is 5285 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
Share on other sites

This topic is 5285 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.