.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfDocumentProcessor.SaveDocument(String) Method

Saves the current document to the specified file path.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.1.dll

Declaration

public void SaveDocument(
    string path
)

Parameters

Name Type Description
path String

A String value, specifying the location of the saved document.

Remarks

The PDF Document API component locks a file while a document is saved (since the SaveDocument method uses the detachStream parameter set to false). To unlock the file, call another overloaded SaveDocument method with the detachStream parameter enabled.

Important

The PdfDocumentProcessor removes existing signatures from a document when it is saved. However, if you use PdfDocumentProcessor to apply a signature, it is retained.

The code sample below rotates document pages and saves the result:

View Example

using DevExpress.Pdf;

namespace PdfPageRotationExample
{
  class Program
  {
      static void Main(string[] args)
      {
        using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
        {
          pdfDocumentProcessor.LoadDocument("..\\..\\docs\\TextRotate.pdf");
          int angle = 0;
          foreach (PdfPage page in pdfDocumentProcessor.Document.Pages) {
              angle = (angle + 90) % 360;
              page.Rotate = angle;
          }
          pdfDocumentProcessor.SaveDocument("..\\..\\docs\\Rotated.pdf");
        }
     }
  }
}
See Also