Mac or Win?
Windows, certainly, but it would be nicer if I could do it cross-platform.
1 of 1 people found this helpful
ScriptMaster with iText will eat this for breakfast.
Cross platform, but not on Go obviously
Save remote file to known location
Export existing PDF to same location
With SM function Open file #2, append file #1, save as file #3
Import file #3 into FM (delete temp files if required)
As I read the ScriptMaster documentation, AppendToFile will append text to a text file. I need to append a pdf file on to the end of another pdf file. Am I missing something?
You can't simply use text functions to append pdf. The directory of the PDF has to be updated at least.
Our MBS Plugin has Mac only functions to do this. For Windows, we'll may do something later this something.
There IS a way to do this cross platform with the iText library
As a first stop look at this video, although the code is out of date, but will still work
We do this ALL the time on both platforms.
Thanks! I'll take a look.
I'm trying to use this method, but for some reason, the catpdf () external function is returning an error, but Get SMLastError isn't enlightening me as to what it is. I think my inputs are properly formatted...
Running from the sample file that's provided at the link (where the example script works perfectly), I have a modified script that includes the following:
catpdf( $reports ; $filepath )
And that last function returns an error, but when I try to invoke SMLastError, I get nothing.
The files are there where the paths indicate, I don't see any forbidden characters in the file names, and all the code is properly loaded.
Message was edited by: paul_mitchell
Does the $filepath end with .pdf??
What did you do to modify the script.
On all of them you can start from /Users/.....
If there is no actual error message in the Groovy script then you will get nothing from SMlastError though.
Start with just 2 PDF files to check it works in your file...
Yes, just like in the example file.
I copied it and modified it to combine files that were generated by another script in another file.
I tried with just two files, and that didn't work either.
Can you find a way to post just the bits that seem to not work??
Set Variable [$$RESULT; Value:catpdf( $reports ; $filepath )]
Everything works perfectly, just as I expect, just as it does in the example script, until I reach this step.
$$RESULT returns: ERROR
I got it! Thanks for all your help! My inputs were malformed. Corrected that, and it worked perfectly! I very much appreciate your pointing me in this direction!