PDF Rotator

No downloads or installation required!

Rotate a PDF using our free online app or learn how it works with our embedded iText 7 Sandbox.


Use the free online PDF Rotator app

Click the box below to upload a PDF, or drag and drop a PDF into the box.

You can then choose the rotation direction and angle you want. If you have uploaded a PDF with multiple pages, you can choose if you want to rotate a specific page.

Click Rotate PDF and then download the resulting PDF.

Or play in the iText 7 Sandbox

In this Sandbox you can see how the the rotation code works in iText 7, and experiment with changing the code yourself.

Click Upload File and make sure the file name of the PDF you upload matches the name you specify in private static final String ORIG. Then click Execute to run your code. To remove an uploaded file, click the x displayed next to the file name.

You can click the switch at the top of the Sandbox to change between the embedded Java and C# compiler.

import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfPage; import com.itextpdf.kernel.pdf.PdfReader; import com.itextpdf.kernel.pdf.PdfWriter; import java.io.IOException; public class PDFRotator { private static final String ORIG = "/uploads/rotate.pdf"; private static final String OUTPUT_FOLDER = "/myfiles/"; private static final int ROTATION_DEGREES = 90; public static void main(String[] args) throws IOException { PdfDocument pdfDocument = new PdfDocument(new PdfReader(ORIG), new PdfWriter(OUTPUT_FOLDER + "Rotated.pdf")); for (int p = 1; p <= pdfDocument.getNumberOfPages(); p++) { PdfPage page = pdfDocument.getPage(p); int rotate = page.getRotation(); if (rotate == 0) { page.setRotation(ROTATION_DEGREES); } else { page.setRotation((rotate + ROTATION_DEGREES) % 360); } } pdfDocument.close(); } }
using iText.Kernel.Pdf; namespace PDFRotator { public class PDFRotator { private static string ORIG = "/uploads/rotate.pdf"; private static string OUTPUT_FOLDER = "/myfiles/"; private static int ROTATION_DEGREES = 90; static void Main(string[] args) { PdfDocument pdfDocument = new PdfDocument(new PdfReader(ORIG), new PdfWriter(OUTPUT_FOLDER + "Rotated.pdf")); for (int p = 1; p <= pdfDocument.GetNumberOfPages(); p++) { PdfPage page = pdfDocument.GetPage(p); int rotate = page.GetRotation(); if (rotate == 0) { page.SetRotation(ROTATION_DEGREES); } else { page.SetRotation((rotate + ROTATION_DEGREES) % 360); } } pdfDocument.Close(); } } }
문의

문의가 해결되지 않았습니까? 

저희가 도와드리겠습니다. 연락해 주시면 빠르게 답변해 드리겠습니다.

문의하기
최신 정보를 받아보세요

11,000명 이상의 가입자와 함께 새로운 제품, 업데이트, 팁, 기술 솔루션 및 기회에 대한 최신 정보를 받아보시면서 iText PDF 전문가가 되어보세요.

지금 구독하기