XDoc.PDF
Features
Tech Specs
How-to VB.NET
Pricing
How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

VB.NET PDF - Add Digital Signatures to PDF in VB.NET


Guide VB.NET Programmers to Improve the Security of Your PDF File by Adding Digital Signatures in VB.NET





Look for HTML5 PDF Editor?

EdgePDF: ASP.NET PDF Editor is the best HTML5 PDF Editor and ASP.NET PDF Viewer based on XDoc.PDF, JQuery, HTML5. It supports ASP.NET MVC and WebForms projects.


VB.NET users may hope their copyright to be respected, XDoc.PDF also allows PDF such security setting via digital signature. By using it in your VB.NET application, you can easily do following things.


Add a signature or an empty signature field in any PDF file page


Search unsigned signature field in PDF document


Prepare a certification which used to sign a document


Verify the validity of PDF signature




Use VB.NET Demo to Sign Your PDF Document



Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Raster.dll


  RasterEdge.XDoc.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;


This is a simple VB.NET demo that explains how to sign your PDF document using XDoc.PDF.




Dim inputFilePath As String = "..."
Dim outputFilePath As String = "..."
Dim imagePath As String = "..."
Dim certSubjectName As String = "..."
Dim fieldID As String = "..."

Dim cert As X509Cert = PDFDigitalSignatureHandler.MakeCert(StoreName.My, StoreLocation.CurrentUser, certSubjectName)

' Set cert properties.
cert.Location = "CHINA SHANGHAI"
cert.Reason = "Reason"
cert.APMode = APMode.Text   ' APMode.Text | APMode.Image.
cert.Image = New Bitmap(imagePath)

If PDFDigitalSignatureHandler.Sign(inputFilePath, outputFilePath, cert, fieldID) = 0 Then
    Console.WriteLine("[SUCCESS]")
Else
    Console.WriteLine("[FAILED]")
End If