How to modify PDF document properties from Visual C++?

Question:I have purchased a number of eBooks in PDF format and unfortunately the publishers have not set the Title, Author and Subject properties. You can see this on a document by accessing the file Properties dialog and selecting the PDF tab. This is a real pain when attempting to use the PDF eBook on an eReader device. So I guess if there is a solution on VeryPDF? If no library is available I'd appreciate any other technique.

Answer: According to your needs, maybe you can have a free trial of this software: VeryPDF Advanced PDF Tools SDK. By this software, you can edit PDF description, PDF custom description, PDF OpenAction options, PDF page view options, PDF metadata contents, and so on.  Meanwhile, the SDK version software allows you to call it together from 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 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

  • All the VeryPDF software are free downloading and free trial , so you can download it to your computer and then have a free trial. This software can work under all the Window system both of 32-bit and 64-bit.
  • When downloading finishes, there will be a zip file, please extract it to some folder then you can find elements in it and know how to use this software according to the code

Step 2. Modify PDF document properties from Visual C++

  • Here is some code of calling Advanced PDF Tools SDK from Visual C++ for modifying PDF document properties.

VC++ Example:
#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);

VB Example 2:
Private Sub VBCOMTest_Click()
        Dim nRet As Long
        Dim strCmd As String
        strCmd = "pdftools.exe" & " -x ""0 0 612 792"" -j ""612 792 true"""
        strCmd = strCmd & " -$ XXXXXXXXXXXXXXX"
        strCmd = strCmd & " -i C:\test.pdf"
        strCmd = strCmd & " -o C:\_test.pdf"
        Set PDFToolsCOM = CreateObject("PDFTools.PDFToolsCOM")
        nRet = PDFToolsCOM.com_VeryPDF_PDFTools(strCmd)
        Set PDFToolsCOM = Nothing
        MsgBox (Str(nRet))
End Sub

If you need to check more examples of calling this software from other applications, please check more on homepage. I can list all of them. 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

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!