How rotate a PDF document using VC++?

Question: How can I rotate a PDF document using VC++? I hope I can find a solution on VeryPDF?

Answer: According to your needs, maybe you can have a free trial of software: VeryPDF Advanced PDF Tools SDK, by which you can rotate PDF easily from PHP. Excepting rotating PDF, this software also can help you edit PDF description, PDF custom description, PDF OpenAction options, PDF page view options, PDF metadata contents, and so on. And by the SDK version, you can call this software from programming languages like C#, VB .NET, MS Visual Basic, Borland Delphi, VBA (MS Office products such as Access) and C++ via COM, C and C++ via native C. Please check more detail information of this software on homepage. In the following part, let us check how to use this software.

Step 1. Free download Advanced PDF Tools SDK

  • The SDK version is professionally developed for software developers or programmers, as this software allows software developers integrate the codes and APIs of this program into their own software on different platforms such as Visual C++ and others. It will be more convenient to develop software based on our software.
  • When downloading finishes, there will be a zip file. Please extract it to some folder then you can find .dll,  related elements and other competent.

Step 2. Rotate PDF using VC++ code.

  • When you use this software, please refer to the usage and example of this software.
  • If you choose the command line version, you also can rotate PDF by command line. Here are some parameters and examples for your reference:
  • Set PDF page rotation and information
    Set page rotation by parameter “-f ”.
    pdftools -i "C:\input.pdf" -o "C:\output.pdf" -f "90"    
    where 90 is the degree of rotation, which can be replaced by other degree such as 180, 270, -90, -180,etc.

  • When you call this software from VC++ code, please refer to the following code templates:
  • #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <time.h>
    #include <io.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <conio.h>
    #include <ctype.h>
    #include <windows.h>
    __declspec(dllexport) int WINAPI VeryPDF_PDFTools(LPCTSTR lpCommand);
    void main()
    {
            char szCommandLine[1024];
            char *lpLicenseKey = "XXXXXXXXXXXXXX";
            sprintf(szCommandLine,"pdftools.exe \"-$\" \"%s\" -x \"0 0 612 792\" -j \"612 792 true\" -i \"%s\" -o \"%s\"",
            lpLicenseKey, "C:\\test.pdf", "C:\\_test.pdf");
            int nRet = VeryPDF_PDFTools(szCommandLine);
    }

If you need to check more examples and parameters, please check them on Advanced PDF Tools COM Component User Manual. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in Advanced PDF Tools 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!