Rotate PDF via JavaScript via C++

Change PDF page orientation. Use Aspose.PDF for JavaScript via C++ to modify PDF documents programmatically

Rotate PDF Pages with JavaScript via C++

Do you need to rotate PDF? In order to rotate PDF file, we’ll use Aspose.PDF for JavaScript via C++ is a easy and secure toolkit used to work with PDF directly in the web browser. To install and use Aspose.PDF for JavaScript via C++ extract files from the ZIP archive.

How to Rotate PDF documents


You need Aspose.PDF for JavaScript via C++ to try the code in your environment.

  1. Load the PDF with an instance of Document.
  2. Move page upper in order to compensate changing page size.
  3. Set old and new page height.
  4. Setting the page rotation angle.
  5. Save the output PDF file.

If you want to rotate PDF files for your tasks, this solution can help. With this powerful Aspose.PDF JavaScript via C++ library, you can update or change the page orientation of pages while keeping its quality. This professional tool uses JavaScript via C++ to rotate PDF effectively. The following example demonstrates how to rotate PDF document in JavaScript via C++:

Rotate PDF - JavaScript via C++

This sample code shows how to Rotate PDF Pages - JavaScript via C++

Input file:

File not added

Output format:

PDF

Output file:


    var ffileRotateAllPages = function (e) {
        const file_reader = new FileReader();
        file_reader.onload = (event) => {
        /*Rotate PDF-pages PDF-file and save the "ResultRotation.pdf"*/
        const json = AsposePdfRotateAllPages(event.target.result, e.target.files[0].name, Module.Rotation.on270, "ResultRotation.pdf");
        if (json.errorCode == 0) document.getElementById('output').textContent = json.fileNameResult;
        else document.getElementById('output').textContent = json.errorText;
        /*Make a link to download the result file*/
        DownloadFile(json.fileNameResult, "application/pdf");
        };
        file_reader.readAsArrayBuffer(e.target.files[0]);
    };

About Aspose.PDF for JavaScript via C++ API

Aspose.PDF for JavaScript via C++ allows developers manipulate them PDF files directly in the Web. This JavaScript Solution is built on the use of WebAssembly technology and is based on Aspose.PDF for .NET Lightweight. You can easily use aspose-pdf for JavaScript via C++ from and then follow the installation instructions. The Aspose.PDF for JavaScript supports a wide variety of functions such as:

  • Optimize PDF document.
  • Add a stamp to PDF file.
  • Merge PDF files.
  • Split PDF to two files.
  • Convert PDF to DOCX, XLSX, JPEG, PNG, TIFF, BMP, SVG, SVG(ZIP), XPS, TXT, and etc.

You can find more information about Aspose.PDF for JavaScript via C++ API on our documentation on how to use API.