1) What happens when we don't want to create a templateFile. How do we create a PDF then?2) What happens when there are repeatable fields in a group inside the templateFile which are completed at runtime. For e.g. we have a field which calculates total cost by adding all added costs to the table. Now these added costs can be a total 5 different costs or even 10 different costs. How do we accept this and set it as form field in the PDF as an array of costs?
Again, there is no OOTB solution and what I described is just one approach. Whenever possible, I'll use a template file. It's quick - the code's already written to support this. As you point out, it's not the answer for everything. You can build PDF files without a template (again using iText as the PDF API is just one approach that will work). This will mean some Java development on your end to write the code necessary to build them from scratch.
3) If we indeed are using this templateFile, where do we place it which deploying our code onto the server and what would be the access path to it? Will it be on Weblogic or physically located on the server or where4) Finally how do we get the contents in Binary format of this generated pdf file because the method Fuego.Lib.Attachment.create(contents : null, name : targetFile, description : "test"); accepts contents only in Binary format? xmpMetaData of the PDFStamper although in Binary format is ready only? So we cannot put it in the contents field of Fuego.Lib.Attachment.create(contents : null, name : targetFile, description : "test"); ?
One approach is to put the binary for the PDF files in a database. If you have a content management system, use that to store the files.
This logic assumes that you put the PDF in the c:\temp directory and that you have a variable named "clientCase" that is a BPM Object and this BPM Object has a "clientName" attribute. This variable needs to be populated with text before this logic is invoked.
hashMap as Any[String] hashMap["customerName"] = clientCase.clientName hashMap["customerNameLabel"] = "Customer Name" docName as String docDirectory as String docName = "Test document.pdf" docDirectory = "c:/temp/" generate(Integration.Jacket.Jacket, templateFile : docDirectory + docName, targetFile : docDirectory + "Generated_" + clientCase.clientName + "_" + docName, hashMap : hashMap) end