May I ask why you don't want to use "Append to existing PDF"? I normally export the first PDF in the temporary folder, then APPEND all the other PDFs and send (or store or whatever) the result. Works for me.
I've used the technique you are suggesting. Successful only when the PDFs are generated by FileMaker.
The technique does not work if the PDFs are stored in containers.
But you are welcome to prove me wrong. Please feel free to edit the sample file.
Sent from a phone.
There are several plugins that work with PDFs.
Monkeybread has an exhausting series of functions using some external heavy duty PDF manipulators.
Scribe has pdf manipulation but few functions
Either would require at a minimum loading the PDF into memory or saving to disk.
To expand upon marcodezordo:
Export PDF to temporary directory as Temp.pdf
Export PDF to temporary directory as Temp2.pdf
Append Temp2.pdf to Temp.pdf
Export PDF to ...Temp2.pdf
This doesn't require a plugin, is simple and straightforward. Since it doesn't require a plugin it should work on all computers and IOS devices (haven't checked IOS).
I'll look into the plugins you suggested. But I'd like to exhaust Script Master first.
Also Append doesn't work, as mentioned to Marco. Please check out the sample file to see what I mean.
Sent from a phone.
Leo: you are right, I was wrong. There is no such a command as Append PDF, only a switch to append the PDF you are producing in FileMaker from a record or a group of records. I just checked an old solution of mine, and to achieve your goal I was forced to use applescript and an external utility (I bet you can follow a similar path for windows too). Wonder if there is a simpler way.
You include 3 .jars, but javadoc and sources are not need.
The function MergePDF() seems working, what is your problem?
If run the script twice or more, error occurs since the previous pdfs are already there. I haven't found why they are not overwritten. Assembled.pdf is overwritten.
I disagree. MergePDF() result is "ERROR".
I stepped through the script several times, and always the same result.
Also the 3 .jars are needed. Otherwise the functions fail to register on startup.
You can use ScriptMaster with iText and there are plenty of examples of the code to do all kinds of append operations just by googling text and concatenate.
There will shortly be a way for FileMaker developers to buy the (inexpensive) licences to make it all legal.. just bookmark http://www.fmtopdf.com for some upcoming announcements.
The code example on FmForums DOES absolutely work, I know, I wrote it and use it all the time.
This technique can be amended to take the original PDF files from containers, and also put the finished result back into a container, WITHOUT hitting the hard drive at all. Makes it perfect for running in FMP13 with PSOS.
First error I can see
The PATH that you need to pass to the external function is NOT the result of Get ( DocumentsPath ) - it is the OS specific version of the same thing. i.e. not filemac://la/la/la but /Users/la/la/la
So you need to find a custom function that converts the FileMaker path to an OS path
Then as previously stated you do not need the javadocs or sources just the compiled itext jar file
Export ALL files you want to 'add' with a unique name - best not to the temp path...
Pass a list of OS paths to these files as the first parameter, and the OS path of the file you want to be the result as the second parameter to the PDFadd function.
Re-export nothing to the list of filenames to delete them
Then do what you will with the result, import it, email it.... etc.
I’d like to see what you mean please.
I’m using Get ( TemporaryPath), which doesn’t look OS specific to me; i.e. no filemac:/la/la/
I found a custom function fnPlatformPathPrefix, but that basically adds the filemac prefix. I’m a little confused about what you’re saying.
If I don’t have the javadocs or sources, then I get an error when I register the functions on startup. But I don’t have much experience doing this stuff, so I feel bit lost.
I will try what you suggested and repost the sample file shortly.
Don't use the Temporary Path
this is mac but there is a same thing for Win to do with getting slashes the right way round
get ( DocumentsPath) = /MacBookPro/Users/RWU/Documents/
the path you ACTUALLY need is /Volumes/MacBookPro/Users/RWU/Documents
its an OS thing.