using System;
using System.IO;
using SautinSoft;
using SautinSoft.Pdf;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
// Load an existing PDF document
PdfDocument document = new PdfDocument();
document.Load("input.pdf");
// Rotate the first page by 90 degrees
PdfPage page = document.Pages[0];
page.Rotation = PdfRotation.Rotate90;
// Save the modified document
document.Save("output.pdf");
// Open the modified document
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("output.pdf") { UseShellExecute = true });
}
}
}
The PDF .Net product includes a code example for rotating a page in a PDF document. This example demonstrates how to use the library to programmatically rotate a page within a PDF file.
The product supports various platforms, including Windows, Linux, macOS, and Docker, and is compatible with .NET 8, 7, 6, 5, Standard 2, Core 2x & 3x, and Framework 4.6.2+.