Digital Signatures through Core API

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
cjwakefield
User
Posts: 2
Joined: Thu May 03, 2018 1:47 pm

Digital Signatures through Core API

Post by cjwakefield »

Do you have any samples for digitally signing pdfs through the Core API SDK in VB.NET or C#? I have added a signature block through code, but it puts a dark border around it unlike the transparent border used in the application, is there a way to remove that?

Thanks,

Chris
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Digital Signatures through Core API

Post by Sasha - Tracker Dev Team »

Hello Chris,

A small sample project will help us to advice your problem.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
cjwakefield
User
Posts: 2
Joined: Thu May 03, 2018 1:47 pm

Re: Digital Signatures through Core API

Post by cjwakefield »

I was hoping for some samples as I don't see anything that uses digital signatures through the API on the forum.

I have tried using the method doc.DeferedDigitalSign(cert, flags, pageNumber, rect, reason, location, contactInfo, imageFile), but have had no luck getting it to work.

As for creating the signature field, I am using the following VB.net code:
Private Sub AddSignatureField()
Dim pdfx As New PDFXCoreAPI.PXC_Inst
'No code works without this Init line''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
pdfx.Init("SigField")
Dim doc As PDFXCoreAPI.IPXC_Document
doc = pdfx.OpenDocumentFromFile("C:\source\Not Signed.pdf", Nothing)
Dim pageNumber As UInteger = 1
Dim rect As New PXC_Rect()
rect.top = 225
rect.bottom = 50
rect.left = 395
rect.right = 570
'This creates the field but it has a border that does not occur when not using the com control'''''''''''''''''''''''''''''''''''''''''''
doc.AcroForm.CreateField("FieldName", PXC_FormFieldType.FFT_Signature, pageNumber - 1, rect)
'There is no save, there is just write to functions'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
doc.WriteToFile("C:\source\Test.pdf")
'This is required to clean up memory supposedly'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
pdfx.Finalize()
Process.Start("C:\source\Test.pdf")
End Sub
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Digital Signatures through Core API

Post by Sasha - Tracker Dev Team »

Hello

I've searched through the Core API forum for the method that you mentioned and found this:
viewtopic.php?f=67&t=25683&p=100457&hil ... gn#p100603

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply