Write the conforming PDF document.




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()



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




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.




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

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) {
    for(int i = 0; i<theOperation.Errors.Count; ++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
    For i As Integer = 0 To theOperation.Errors.Count - 1
  End If
End Using