Here we save a document in PDF/A-1b format.
using var doc = new Doc();
doc.Read(Server.MapPath("mypics/Acrobat.pdf"));
string path = Server.MapPath("pdfa_save.pdf");
using (var theOperation = new PdfConformityOperation()) {
theOperation.Conformance = PdfConformance.PdfA1b;
theOperation.Save(doc, path);
if (theOperation.Errors.Count > 0) {
Console.WriteLine("Errors:");
for (int i = 0; i < theOperation.Errors.Count; ++i)
Console.WriteLine(theOperation.Errors[i]);
}
}
Using doc As New Doc()
doc.Read(Server.MapPath("mypics/Acrobat.pdf"))
Dim thePath As String = Server.MapPath("pdfa_save.pdf")
Using theOperation As New PdfConformityOperation()
theOperation.Conformance = PdfConformance.PdfA1b
theOperation.Save(doc, thePath)
If theOperation.Errors.Count > 0 Then
Console.WriteLine("Errors:")
Dim i As Integer = 0
While i < theOperation.Errors.Count
Console.WriteLine(theOperation.Errors(i))
System.Threading.Interlocked.Increment(i)
End While
End If
End Using
End Using