In This Topic
Provides methods, which allow work with long term validation (LTV) information of PDF signatures.
Object Model
Syntax
'Declaration
Public MustInherit NotInheritable Class PdfDocumentLtv
public static class PdfDocumentLtv
public __gc abstract __sealed class PdfDocumentLtv
public ref class PdfDocumentLtv abstract sealed
Example
Here is an example that shows how to add long term validation (LTV) information to all signatures of specified PDF document.
''' <summary>
''' Adds long term validation (LTV) information to all signatures of specified PDF document.
''' </summary>
''' <param name="inputPdfFilename">The filename of input PDF document.</param>
''' <param name="outputPdfFilename">The filename of output PDF document.</param>
Public Shared Function AddVltInfo(inputPdfFilename As String, outputPdfFilename As String) As Boolean
' open PDF document
Using document As New Vintasoft.Imaging.Pdf.PdfDocument(inputPdfFilename)
Try
' add VLT info
Dim count As Integer = Vintasoft.Imaging.Pdf.Tree.DigitalSignatures.PdfDocumentLtv.AddLtvInfo(document)
If count = 0 Then
System.Console.WriteLine("LTV information is not required for this document.")
Else
System.Console.WriteLine("LTV information is added.")
End If
Catch ex As System.Exception
System.Console.WriteLine("Error: " & ex.Message)
Return False
End Try
' save PDF document
If inputPdfFilename = outputPdfFilename Then
document.SaveChanges()
Else
document.Save(outputPdfFilename)
End If
Return True
End Using
End Function
/// <summary>
/// Adds long term validation (LTV) information to all signatures of specified PDF document.
/// </summary>
/// <param name="inputPdfFilename">The filename of input PDF document.</param>
/// <param name="outputPdfFilename">The filename of output PDF document.</param>
public static bool AddVltInfo(string inputPdfFilename, string outputPdfFilename)
{
// open PDF document
using (Vintasoft.Imaging.Pdf.PdfDocument document =
new Vintasoft.Imaging.Pdf.PdfDocument(inputPdfFilename))
{
try
{
// add VLT info
int count = Vintasoft.Imaging.Pdf.Tree.DigitalSignatures.PdfDocumentLtv.AddLtvInfo(document);
if (count == 0)
System.Console.WriteLine("LTV information is not required for this document.");
else
System.Console.WriteLine("LTV information is added.");
}
catch (System.Exception ex)
{
System.Console.WriteLine("Error: " + ex.Message);
return false;
}
// save PDF document
if (inputPdfFilename == outputPdfFilename)
document.SaveChanges();
else
document.Save(outputPdfFilename);
return true;
}
}
Inheritance Hierarchy
System.Object
 Vintasoft.Imaging.Pdf.Tree.DigitalSignatures.PdfDocumentLtv
Requirements
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5
See Also