How to rotate the first PDF page clockwise?

VeryPDF PDF Toolbox enables you to rotate specified PDF pages clockwise or counter clockwise in different programming languages like C#, ASP.NET, and VB.NET. The source code samples as follows can clearly show how to rotate the first page of PDF clockwise.

C# code:
1R:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Call_PDFToolBoxCom
{
    class Program
    {
        static void Main(string[] args)
        {
            string strExePath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            PDFToolBoxCom.PDFToolBoxCom p = new PDFToolBoxCom.PDFToolBoxCom();
            string strReturn = p.RunCMD(strExePath + @"\in.pdf -merge 1R 2-end -outfile "+ strExePath +@"\out.pdf");
            Console.WriteLine(strReturn);
            Console.WriteLine("Please enter any key to continue...");
            Console.ReadKey();
        }
    }
}

1E:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Call_PDFToolBoxCom
{
    class Program
    {
        static void Main(string[] args)
        {
            string strExePath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            PDFToolBoxCom.PDFToolBoxCom p = new PDFToolBoxCom.PDFToolBoxCom();
            string strReturn = p.RunCMD(strExePath + @"\in.pdf -merge 1E 2-end -outfile "+ strExePath +@"\out.pdf");
            Console.WriteLine(strReturn);
            Console.WriteLine("Please enter any key to continue...");
            Console.ReadKey();
        }
    }
}

VB_NET code:
1R:
Module Module1
    Sub Main()
        Dim p As PDFToolBoxCom.PDFToolBoxCom
        Dim strRet As String
        Dim strParam As String
        Dim strPath As String
        strPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase
        strParam = strPath + "pdf
toolbox
.exe " + strPath + "in.pdf" + " -merge 1R 2-end -outfile " + strPath + "out.pdf"
        Console.WriteLine(strParam)
        p = New PDFToolBoxCom.PDFToolBoxCom()
        strRet = p.RunCMD(strParam)
        Console.WriteLine(strRet)
        Console.WriteLine("Please enter any key to continue...")
        Console.ReadKey()
    End Sub
End
Module

1E:
Module Module1
    Sub Main()
        Dim p As PDFToolBoxCom.PDFToolBoxCom
        Dim strRet As String
        Dim strParam As String
        Dim strPath As String
        strPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase
        strParam = strPath + "pdftoolbox.exe " + strPath + "in.pdf" + " -merge 1E 2-end -outfile " + strPath + "out.pdf"
        Console.WriteLine(strParam)
        p = New PDFToolBoxCom.PDFToolBoxCom()
        strRet = p.RunCMD(strParam)
        Console.WriteLine(strRet)
        Console.WriteLine("Please enter any key to continue...")
        Console.ReadKey()
    End Sub
End
Module

ASP_NET code:
1R:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ASP_NET_Call_PDFToolBoxCom
{
    public partial class _Default : System.Web.UI.Page       
    {
        protected void Page_Load(object sender, EventArgs e)
        {}
        protected void Button1_Click(object sender, EventArgs e)
        {
            Console.WriteLine("UserName: {0}", Environment.UserName);
            PDFToolBoxCom.PDFToolBoxCom p = new PDFToolBoxCom.PDFToolBoxCom();
            string strPath = @"E:\bin\pdftoolbox.exe";
            strPath += @" in.pdf -merge 1R 2-end -outfile out.pdf";
            string strRet = p.RunCMD(strPath);
            Response.Write(strRet);
        }
    }
}

1E:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ASP_NET_Call_PDFToolBoxCom
{
    public partial class _Default : System.Web.UI.Page       
    {
        protected void Page_Load(object sender, EventArgs e)
        {}
        protected void Button1_Click(object sender, EventArgs e)
        {
            Console.WriteLine("UserName: {0}", Environment.UserName);
            PDFToolBoxCom.PDFToolBoxCom p = new PDFToolBoxCom.PDFToolBoxCom();
            string strPath = @"E:\bin\pdftoolbox.exe";
            strPath += @" in.pdf -merge 1E 2-end -outfile out.pdf";
            string strRet = p.RunCMD(strPath);
            Response.Write(strRet);
        }
    }
}

 

______________________
Lear more: VeryPDF PDF Toolbox Component for .NET.

VN:F [1.9.20_1166]
Rating: 7.0/10 (2 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
How to rotate the first PDF page clockwise?, 7.0 out of 10 based on 2 ratings

Related Posts

This entry was posted in VeryPDF Blog and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!