We would like to see examples on how to implement concatpdf ()
HI,
rbv_api.concatPDF(), concatenates two or more PDF documents specified as base-64 encoded strings.
Syntax
rbv_api.concatPDF(encodedValue1, encodedValue2, …)
Specific example
var pdf1 = rbv_api.getBinaryData("document", {!id}, "pdf_file1");
var pdf2 = rbv_api.getBinaryData("document", {!id}, "pdf_file2");
var pdf3 = rbv_api.concatPDF(pdf1, pdf2);
rbv_api.setBinaryFieldValue("document", {!id}, "pdf_file3", pdf3,
"application/pdf", "merged.pdf");
Regards,
Mani.
Hi Leslie,
For reference of our official documentation, "Rollbase in Action":
getBinaryData(), retrieves the binary interpretation a File field.
Middle of page 438
concatpdf(), appends a series of pdf documents (supplied via arguments as binary data) and returns binary data of the concatenation.
Bottom of page 201
setBinaryField() method, assigns a value for a field of a record.
After the concatpdf() method is used to append two PDF files (returning the result), this method is used to assign the PDF (binary value returned from concatpdf()) to a specified field.
Bottom of page 491
So:
- Use getBinaryData to retrieve the binary values of the PDF
- concatpdf() will append the different pdf files. Values from getBinaryData() will be supplied to concatpdf() as arguments.
- The result of concatpdf() will be supplied as an argument (among other values to specify the precise field) to setBinaryData(), which will place the concatenated PDF file in the field.
I hope this helps, let me know if you'd like me to elaborate on any points.
Corey Prak