PdfConformityOperation Save Function. Write the conforming PDF document. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

Write the conforming PDF document.

 

   
Syntax  

[C#]
void Save(Doc doc, string path)
void Save(Doc doc, Stream stream)

[Visual Basic]
Sub Save(doc As Doc, path As String)
Sub Save(doc As Doc, stream As Stream)

Throws Exceptions may throw Exception()

 

   

Params
 
Name Description
doc The document.
path The destination file path.
stream The destination stream.

 

   

Notes
 

This method writes the document in a conforming PDF format according to the Conformance property. Any conformance error is reported in the Errors property after the method finishes.

 

   

Example
 

Here we save a document in PDF/A-1b format.

[C#]
Doc theDoc = ...;
string thePath = Server.MapPath("pdfa.pdf");
using(PdfConformityOperation theOperation = new PdfConformityOperation()) {
  theOperation.Conformance = PdfConformance.PdfA1b;
  theOperation.Save(theDoc, thePath);

  if(theOperation.Errors.Count>0) {
    Console.WriteLine("Errors:");
    for(int i = 0; i<theOperation.Errors.Count; ++i)
      Console.WriteLine(theOperation.Errors[i]);
  }
}

[Visual Basic]
Dim theDoc As Doc = ...
Dim thePath As String = Server.MapPath("pdfa.pdf")
Using theOperation As New PdfConformityOperation
  theOperation.Conformance = PdfConformance.PdfA1b
  theOperation.Save(theDoc, thePath)

  If theOperation.Errors.Count > 0 Then
    Console.WriteLine("Errors:")
    For i As Integer = 0 To theOperation.Errors.Count - 1
      Console.WriteLine(theOperation.Errors(i))
    Next
  End If
End Using