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:
- When you call this software from VC++ code, please refer to the following code templates:
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.
__declspec(dllexport) int WINAPI VeryPDF_PDFTools(LPCTSTR lpCommand);
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.