Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Change values in document form e.g. with form bridge

Avatar

Level 2

Hello,

I have the following problem: My pdf form must be signed. I submit a pdf via http post to the servlet which starts a process with the pdf as input. After some processing steps I want to show it in the workspace for further actions. As an input für the "Assign Task" I used the document form, which contains the form bridge. The workspace shows me the PDF and I can submit it. But I want to set some values in the pdf for showing.

The cannot use the FormDataIntegrationClient because it change all values in the pdf and I lost the valid signature (refers only to some fields not all). I want to set some fields in the pdf without destroy the signature.

When I read the comments in the designer for form bridge, it provides the possibility to change values inside the pdf, but I have no idea how I can do it.

The Designer Comment:

/*
    FormBridge provides a scripting API to access and change information in a PDF form.
    It supports actions such as getting and setting form data, getting a list
    of fields, email, and print just to name a few.

    Messages are sent to this script have the following format:
        [id][requestName][params...]
    where:
        id          is a number supplied by the requestor
        requestName is the command to perform (see: "FormBridge API command"s below)
        params      are the parameters for the command

and so on.....

How can I send these message to the PDF to change a value inside after signing?

Did somebody else anything like this?

Christoph

5 Replies

Avatar

Level 10

'The cannot use the FormDataIntegrationClient because it change all values in the pdf and I lost the valid signature (refers only to some fields not all)."

You could use the FormDataIntegration and just change the fields you want. You don't have to change all fields.

Jasmin

Avatar

Level 2

Hello,

I have tried it allready. When I change one value in the XML Data and invoke the method importData all other datas are deleted and my signature is destroyed.

Is that correct so?

Christoph

Avatar

Level 10

What about if export the data first, and then change the one value you need to change an re-import.

That way the original data is going to be imported again with the same value, and the signature should still be valid since the signed fields contain the same value.

Jasmin

Avatar

Level 2

Thx for this advice but these steps doesn't work correctly.

The signature is unvalid after importing the data. I export all data and import it again. After this the signature is unvalid because some fields are changed. Although the fields aren't changed. But the import-Service sets all values (same values too) in pdf and so the signature is unvalid.

Is there any possibility to change values in unsigned fields in the document ?

Christoph

Avatar

Level 10

There are a few stated the signature can be in. A green checkmark (valid), a red X (invalid) or a yellow triangle (warning).

Which one do you get?

Jasmin