Custom Field - passing value to Template
Wednesday, August 10, 2016 at 05:59pmHello,
How do you populate a field when creating a package from a template? I don't want to define the field location in my code. Instead I need to simply pass along the value that should appear in the correct location. Some of these uses will be for read only fields and some for pre-populating an input that is required/optional.
I've successfully setup a template using the online interface and placed a field with the name "CustomField1" inside the template. But I cannot find how to pass a field value unless I also upload a document and define the field location, which I do not want to do since that is already defined & maintained in the template.
Thanks,
Reply to: Custom Field - passing value to Template
Tuesday, August 16, 2016 at 07:24amReply to: Custom Field - passing value to Template
Wednesday, August 10, 2016 at 06:42pmReply to: Custom Field - passing value to Template
Wednesday, August 10, 2016 at 07:38pmReply to: Custom Field - passing value to Template
Thursday, August 11, 2016 at 11:40amReply to: Custom Field - passing value to Template
Thursday, August 18, 2016 at 02:41pmReply to: Custom Field - passing value to Template
Friday, August 19, 2016 at 10:50amReply to: Custom Field - passing value to Template
Friday, August 19, 2016 at 11:31amReply to: Custom Field - passing value to Template
Monday, July 30, 2018 at 11:47amReply to: Custom Field - passing value to Template
Monday, July 30, 2018 at 11:53amReply to: Custom Field - passing value to Template
Monday, July 30, 2018 at 12:06pmReply to: Custom Field - passing value to Template
Monday, July 30, 2018 at 12:07pmReply to: Custom Field - passing value to Template
Tuesday, July 31, 2018 at 08:32amReply to: Custom Field - passing value to Template
Tuesday, July 31, 2018 at 06:26pmReply to: Custom Field - passing value to Template
Wednesday, August 1, 2018 at 03:18amReply to: Custom Field - passing value to Template
Friday, May 14, 2021 at 01:22pmHow can i create a custom fields? the fields custom they are by package?
Reply to: How can i create a custom…
Monday, May 17, 2021 at 11:06amHi csar,
Thanks for your post! Custom Fields in OneSpan Sign offers you the ability to add supplementary information to your sender profiles in addition to the out-of-the-box fields like “title”, “company”. These custom fields can later be added to your transactions, and the values will be populated to the document after signing.You can only create custom fields for senders at the account level. To learn more about custom fields, refer to my blogs:
OneSpan Sign Developer – Custom Fields
OneSpan Sign Developer – Custom Fields Part 2
Duo
Reply to: Custom Field - passing value to Template
Monday, April 25, 2022 at 06:36amHi mwilliams
I'm new to OSS. This is exactly what I want - "...create your documents as PDF forms, you could automatically extract fields from the PDF and inject text where you want it at package creation or document upload (if adding to an existing package) time". But I don't know how to place the fields "full_name" and "amount" in the PDF using below code. I tried curly braces {full_name} and square brackets [full_name], but neither worked. Could you advise? Thanks!
.withDocument(DocumentBuilder.newDocumentWithName("sampleAgreement")
.fromFile("sources/TestTemplate.pdf")
.enableExtraction()
.withInjectedField(FieldBuilder.textField()
.withName("amount")
.withValue("50000"))
.withInjectedField(FieldBuilder.textField()
.withName("full_name")
.withValue("John Doe"))
J.P.
Reply to: Custom Field - passing value to Template
Monday, April 25, 2022 at 08:41amHi Jianping,
I've attached an example PDF, where you can directly name the field "amount" and "full_name" without the brackets:
DocumentPackage packageToSend = PackageBuilder.newPackageNamed("Field Injection Example")
.withSigner(SignerBuilder.newSignerWithEmail("[email protected]")
.withFirstName("John")
.withLastName("Smith")
.withCustomId("Signer1")
)
.withDocument(DocumentBuilder.newDocumentWithName("Sample Contract")
.fromFile(FILE_PATH)
.enableExtraction()
.withInjectedField(FieldBuilder.textField()
.withName("amount")
.withValue("50000"))
.withInjectedField(FieldBuilder.textField()
.withName("full_name")
.withValue("John Doe"))
.withSignature(SignatureBuilder.signatureFor("[email protected]")
.atPosition(100, 100)
.onPage(0)
.withSize(150, 50))
)
.build();
PackageId packageId = eslClient.createPackageOneStep(packageToSend);
Duo
Reply to: Custom Field - passing value to Template
Monday, April 25, 2022 at 11:17amThank you Duo for your quick answer! I used your PDF file in my test code and it worked too.
Unfortunately I don't have paid Adobe Acrobat to create/edit PDF files? We always create the template in HTML with placeholder fields, then covert it to a PDF file (programmatically, or manually load HTML to Word and then save as PDF). I tried to use the HTML <input> tag for the fields, and again it's not recognized by OSS. Do you know if there is HTML equivalent to the PDF form fields, or in other words how the PDF form field names can be defined in source HTML?
My simple HTML source for PDF looks like blow:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form>
<p>Name: <input name="full_name"></p>
<p>Amount: <input name="amount"></p>
</form>
</body>
</html>
Reply to: Custom Field - passing value to Template
Tuesday, April 26, 2022 at 03:18pmThanks Duo Liang! In my case, We'll populate our own custom fields (they are read-only anyway) before forming the PDF file and just do the signer related fields on the PDF.