Remove field signature

75 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Carlo Nesta

ungelesen,
05.12.2016, 15:46:5005.12.16
an PDFTron PDFNet SDK
Hello, I have created a signature field  at run  time (without saving the PDF document) and I want to delete this field always at runtime with its appearance.                                           I can take the correct widget and can also eliminate appearance and eliminate the widget.                           Then I save  the document and later reopened after an audit to check if the there exist signature fields in the documents gives me successful. I can not figure out how to remove the field in question.   I attach the code (VB) I have used. Thank you for the help.
Allegato.txt

Ryan

ungelesen,
07.12.2016, 13:00:0807.12.16
an PDFTron PDFNet SDK
The field and Widget are not necessarily the same object. In particular, a field can have multiple Widgets.

Your code is removing the annotation from the page, but the field remains in the document.

However, I am curious on what your overall user story is. Why is this important for you?

Carlo Nesta

ungelesen,
09.12.2016, 14:04:3609.12.16
an PDFTron PDFNet SDK
Thank you very much for your response.
For me it is important because I'm developing an application graphometric signature and a feature that the user will have is to create at runtime a signature field on the document, but then could think again and then cancel it. I had thought of developing it in the way I described in my previous post and then I realized that the field was not deleted from the document. Is there a way to delete it after you create at runtime so that it is not junk in your document?

Thank you very much.

Ryan

ungelesen,
09.12.2016, 17:50:0709.12.16
an PDFTron PDFNet SDK
In that case, the easiest way would be the following.

int sig_field_object_num = sig.GetSDFObj().GetObjNum()

and store that value

Then when you want to erase the field, add the following code.

Dim acroforms As Obj = pdfdoc.GetAcroForm()
If acroforms IsNot Nothing And acroforms.IsDict() Then
 
Dim fields As Obj = acroforms.FindObj("Forms")
 
If fields IsNot Nothing And fields.IsArray() Then
   
For index As Integer = 1 To fields.Size()
     
Dim o As Obj = fields.GetAt(index)
     
If o.GetObjNum() = sig_field_object_num Then
        fields
.EraseAt(index)
       
break

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten