Aspose java 24.9 - help in finding code to add signature form field to a tag

Hi,
I am trying to evaluate aspose for one of our requirements. I tried downloading the aspose pdf java jar 24.9 version from the website. Also we got temporary license which I don’t know how to set it yet. I tried using the jar and I am looking for answers for following questions.

  1. We use complicated tagged PDF’s as part of our app which needs to be accessible. How can I search for a tagname in a tagged pdf and add a signature form field to this tag name and associate it inside a form tag. I tried searching code for this in website but was unable to find it. Can I get a working sample for this req.
  2. Can I use aspose java to add tags for checkboxes, radio buttons, drop downs and make them accessible? And can these be associated in a form tags just like in my first question.

Also FYI - As part of my trial and error for first question, I tried searching for a text in the PDF and replace it with a signature field. I was able to do this successfully. However I was unable to find code for adding this signature field inside a tag.

Please let me know if you want me to attach a sample code that I tried.

@tryaspose1

Please check below documentation article to set the license while using the API:

For the rest of your requirements and regarding searching for a tag and signature by tag, we have created a ticket as PDFJAVA-44688 in our issue tracking system as we need to investigate it. Can you please provide an example of a document and an example of a signature that needs to be signed?

Since we need to create several examples, test them and we can’t understand what error you are actually talking about. We need to understand what exactly you are doing to know what needs to be fixed.

Hi Ali,
Thanks for the reply.
Basically I am trying to associate a signature field to be placed inside a form tag. We are currently using .NET library and it is placing the signature field inside the form. We want to try this using java library like aspose.

The sample that I tried is as follows. Here XXX.#001 is the text I am trying to replace with signature field. This text is inside a tag named Signature1. Is it possible for us to associate the signature field added in below code to be associated with form tag. We need this because of accessibility requirements.

//Load the doc
Document document = new Document(“some-path”);
String targetText = “XXX.#001”;
//start
TaggedContent taggedContent = (TaggedContent) document.getTaggedContent();

    TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(targetText);
    document.getPages().accept(textFragmentAbsorber);
    for (TextFragment textFragment : textFragmentAbsorber.getTextFragments()) {
        Rectangle rect = textFragment.getRectangle();
        textFragment.setText("Signature1");
        SignatureField signatureField = new SignatureField(document.getPages().get_Item(1), rect);
        signatureField.setPartialName("Signature1");
        document.getForm().add(signatureField);
        log.info("Replaced text with a signature field.");
    }
    document.save("some-path");

@tryaspose1

As requested earlier, would you kindly also share the sample source and expected output PDF for our reference as well. We need this information to properly investigate this case and provide a solution for your requirements.

Hi,
Sorry I cannot attach the pdf. However I can share the expected output that we are looking. This is the expected out that we are looking to achieve with aspose which we were able to do with the .Net library.

image.png (31.1 KB)

We are trying to associate a signature form field inside a form tag like in above screenshot.

@tryaspose1

Thanks for providing the details. We have updated the ticket information accordingly and will investigate from this perspective. Once we have some updates or need any information from you side, we will let you know via this forum thread. Please spare us some time.

We are sorry for the inconvenience.

Thanks. Please let me know once you have update on this.

@tryaspose1

Sure, we will inform you as soon as we have some updates in this regard.

Hi,
Just wanted to see if there is any update. FYI - I tried asking chatGPT for a way to associate a signature field to a form tag. It gave me a code, but that code is not getting compiled due to incorrect classes that it is suggesting and the aspose version I am using. Not sure if this is accurate or not, just want to inform you.

@tryaspose1

Sadly, the ticket hasn’t been fully investigated yet. However, your concerns have been recorded and we will surely let you know once we have some updates regarding ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi Ali,
Any update on this ticket/issue?

@tryaspose1

The ticket hasn’t been resolved yet sadly due to the other issues logged prior to it. We will prioritize it on a first come first serve basis and as soon as we have some updates regarding its fix, we will let you know. We apologize for the inconvenience.

Hi,
Any update on this issue?

@tryaspose1

We are afraid that the earlier logged issue is not yet resolved. Your concerns have already been recorded and we will surely inform you as soon as we have definite updates in this regard. Please spare us some time.

We are sorry for the inconvenience.

Thanks for your response. We have a significant work pending at our end related to this. Can you please let me know if there is any other way to escalate or contact sales team regarding the same.

@tryaspose1

The ticket is logged under free support model where it will be prioritized on first come first serve basis as per policies. You can escalate it to the highest priority using paid support option if issue is a showstopper for you. This way the ticket will be investigated on urgent basis. You can subscribe to paid support if you haven’t already and create a post there with the reference of ticket ID. In the meanwhile, we will inform you if we have some updates about ticket resolution.

We apologize for the inconvenience.

Hi Ali,
Thanks for your reply. We want to understand the scope of the product before we buy or get into paid support. We want to check if this product can solve or fix our current requirement as detailed earlier like the .NET library(ABCPDF) that we use. This way we can save your and our time before getting into any paid support etc. Appreciate your response.

@tryaspose1

We do understand your concerns and assure you that we will consider them during the investigation. We have escalated the ticket priority to another level and will inform you once we have more updates to share regarding its resolution. We highly appreciate your patience and comprehension in this regard. We apologize for the inconvenience.