Check the samples below to learn how to rotate a PDF document by degrees in C#, VB.NET, and VBScript using ByteScout PDF Extractor SDK.
Select your programming language:
using System.Diagnostics; using Bytescout.PDFExtractor; namespace RotateDocument { class Program { static void Main(string[] args) { string inputFile = "sample1.pdf"; using (DocumentRotator rotator = new DocumentRotator("demo", "demo")) { rotator.Rotate(inputFile, "result.pdf", RotationAngle.Deg90); } Process.Start("result.pdf"); } } }
Imports Bytescout.PDFExtractor Imports System.Diagnostics Class Program Friend Shared Sub Main(args As String()) Dim inputFile As String = "sample1.pdf" Using rotator As New DocumentRotator("demo", "demo") rotator.Rotate(inputFile, "result.pdf", RotationAngle.Deg90) End Using Process.Start("result.pdf") End Sub End Class
' Create Bytescout.PDFExtractor.DocumentRotator object Set rotator = CreateObject("Bytescout.PDFExtractor.DocumentRotator") rotator.RegistrationName = "demo" rotator.RegistrationKey = "demo" rotator.Rotate "..\..\sample1.pdf", "result.pdf", 0 ' 0 - rotate 90 deg, 1 - rotate 180 deg, 2 - rotate 270 deg Set rotator = Nothing