java getTextData

#40203
Posted: 01/31/2018 00:14:51
by SangHyuk Lee (Premium support level)
Joined: 11/08/2017
Posts: 6

hello.

i'm using pades sample by java.

signature is ok.
but i have a problem.

i wanna get Strings from signed pdf document about a signature.(like signer, signtime, signatureName, customText)

so i opened signed pdf and chose the sign by getSignatureEntry(index) method.

i extracted info using getter methods.

i wanna get customText in WidgetProperty.

i used sign.getWidgetProps().getCustomText() method
According to reference, there is getTextData() method in CustomTextList.
but it doesn't exist.

i don't mind it's exist.
i just wanna get customTexts.

there is another way???
#40208
Posted: 01/31/2018 04:09:39
by Dmytro Bogatskyy (Team)

Thank you for contacting us.

Quote

i wanna get customText in WidgetProperty.
i just wanna get customTexts.

The PDFBlackbox component doesn't parse the signature widget because signature widget formatting is application specific. There are too many ways how a signature widget could be created.
At the moment, only the following signature properties are extracted: Invisible, Page, SignatureType, SigningTime, AuthorName, ContactInfo, Location, Reason, LockAction, LockFields, CustomData. And the following signature widget properties are extracted: OffsetX, OffsetY, Width, Height.

The TElPDFSignature.CustomData property could be used to store custom data along with a signature. Usually, this property is used to store biometric data, but you can store your signature widget text there. It is stored as the string object in the signature dictionary. The string object has a custom name 'EldoS.SecureBlackbox.AttachedData' (could be changed using TElPDFDocument.SignatureCustomDataName property, this property should be set before opening the document) and the data encoded using hexadecimal encoding (could be changed using TElPDFSignature.CustomDataEncoding property). This data is ignored by PDF viewers.


Best regards,
Dmytro
#40211
Posted: 01/31/2018 20:07:24
by SangHyuk Lee (Premium support level)
Joined: 11/08/2017
Posts: 6

hi dmytro.
thank you for response.

actually i have to extract pretty lots of sign information.
e.i) certificate subject, issuerDN, timestamp information, pades level, hash Algorithm

are that list all i can extract?
#40216
Posted: 02/02/2018 06:03:00
by Dmytro Bogatskyy (Team)

Hi,

Quote
e.i) certificate subject, issuerDN, timestamp information, hash Algorithm

Yes, you can extract this information. Please take a look at PDFBlackbox\PAdES sample.
Quote
pades level,

There is no such property, but you can identify the PAdES level of the signature based on the presence of PAdES properties. For example, in short, for B-T you need to check if the PAdES signature type is pastEnhanced and signature or document timestamp is present. For detailed check see ETSI EN 319 142-1 standard.


Best regards,
Dmytro
#40218
Posted: 02/02/2018 08:32:28
by SangHyuk Lee (Premium support level)
Joined: 11/08/2017
Posts: 6

ok thank you for explain.

i have one more question.

i have a pdf file that has some emptyfields.
users gonna sign into that pdf document.
Quote

if the last empty field is fulled, i want to lock the pdf document so no one can modify the document.


i found lockAction property in TElPDFSignature class.

Quote

so i tried to lock up pdf document by document timestamp signature.(i added timestamp sign the last)

but i could modify the output pdf document.


i did like this
Code
TElPDFSignature tsaSig = original.getSignatureEntry(original.addSignature());
      tsaSig.setInvisible(true);
      tsaSig.setLockAction((short) 1);
      tsaSig.setAllowedChanges((short) 1);
      tsaSig.setSigningTime(SBUtils.utcNow());


is that wrong way??
#40219
Posted: 02/02/2018 15:17:29
by Dmytro Bogatskyy (Team)

Hi,

Quote
tsaSig.setLockAction((short) 1);

Try to use fmaAll constants, it will lock all fields:
Code
tsaSig.setLockAction(SBPDF.fmaAll);

Then, you should not enable sacFillInForms value for AllowedChanges property (but, anyway, this property has effect only for MDP signatures).
#40220
Posted: 02/04/2018 18:23:45
by SangHyuk Lee (Premium support level)
Joined: 11/08/2017
Posts: 6

oh i don't sign mdp signature. only document.

i have to sign multiple so i can't use mdp signature.

is there something solution for not mdp signature?
#40222
Posted: 02/05/2018 08:32:55
by Dmytro Bogatskyy (Team)

Hi,

Quote
is there something solution for not mdp signature?

AllowedChanges property is used to restrict form filling or adding comments for MDP signatures, and it is ignored by non-MDP signatures. For non-MDP signatures to lock particular or all fields after signing you should use TElPDFSignature.LockAction and LockFields properties.
If you have a problem in locking some particular document, then please attach this PDF document, so we could use to reproduce the issue locally. Please use Helpdesk ( https://sbb.eldos.com/helpdesk/ ) to post the documents to us privately.


Best regards,
Dmytro

Reply

Statistics

Topic viewed 135 times

Number of guests: 1, registered members: 0, in total hidden: 0





Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!