I have a use case for a client that wants to be able to email a PDF form to their clients part filled in by data from their Servoy solution.
The pdf_output plugin nearly does what I need with the 'convertPDFFormToPDFDocument', but I don't want the PDF file fully "flattened", just a new PDF form created with some form values filled in from database, but other form values left blank for their client to fill in and then save & email back (does not need to go back in to Servoy database!)
So code something like a 'convertPDFFormToNewPDFForm' instead of the 'convertPDFFormToPDFDocument'
- Code: Select all
var pdfform = plugins.file.readFile('TestPDFForm.pdf');
//var field_values = plugins.file.readFile('c:/temp/1040a-data.fdf');//read adobe fdf values or
var field_values = new Array()//construct field values
field_values[0] = 'first_name=Rafi'
field_values[1] = 'last_name=Galibov'
var result_pdf_doc = plugins.pdf_output.convertPDFFormToNewPDFForm(pdfform, field_values);
if (result_pdf_doc != null) {
plugins.file.writeFile( + 'UpdatedTestPDFForm.pdf', result_pdf_doc);
}
as the convertPDFFormToPDFDocument does create a new PDF with filled in values, but stops any other fields on form from working...
(I'm not sure much has been done with this plug in for a long time & certainly the docs don't seem to have been updated for a long time...)
Otherwise, does anyone have an easy way of doing what I'm asking?
Thanks
Rafi