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(); } } }
Disclaimer:

iText does not analyze the content of your uploaded or processed files. Users bear sole responsibility for the usage and content of their own files. All uploaded and processed files are deleted from our servers after users leave the page, or automatically after a period of 3 hours.



Contact

Vous avez d'autres questions ?

Nous y répondrons avec plaisir. Contactez-nous et nous reviendrons vers vous sous peu.

Contactez-nous
Restez à jour

Rejoignez plus de 11 000 abonnés et devenez un expert iText PDF en vous tenant au courant de nos nouveaux produits, mises à jour, conseils, solutions techniques et événements.

Abonnez-vous