Print Page | Close Window

C++ example

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3695
Printed Date: 28 Mar 24 at 11:09AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: C++ example
Posted By: hcortesm
Subject: C++ example
Date Posted: 20 Apr 19 at 1:26AM
Hello, 

I'm so new programming and it's my fisrt time with Debenu QPL. Is there any example I can use to show me the use of the library in C++? I'm working in code blocks right now. The only examples I can find are VS ones.

Thanks



Replies:
Posted By: Ingo
Date Posted: 20 Apr 19 at 9:10PM
Hi,

using the advances search option above on this page i found this sample from Bob Hall:
http://www.quickpdf.org/forum/forum_posts.asp?TID=535&KW=C%2B%2B&PID=2335&title=visual-c-starter-example-code#2335

Here is the Debenu sample page for the first steps with the library:
https://www.debenu.com/products/development/debenu-pdf-library/help/samples/

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: hcortesm
Date Posted: 21 Apr 19 at 4:36AM
Thanks for your help. This example is for use under Visual C++ but is not working on code blocks, so I can not make it run. Keep searching. 

Cheers and thanks for the welcome.



Posted By: tfrost
Date Posted: 21 Apr 19 at 12:38PM
Post a bit of code here which fails, and tell us what error reports or failure you are seeing. Does it fail to build, fail to run, or not give correct output?  This is a users' forum so someone else here may be able to help (I am familiar with C++ but do not use it with QPDF).  Saying just "doesn't work" gives no opportunity for anyone to suggest what you might try next!


Posted By: rsi.thyde
Date Posted: 18 Nov 19 at 11:30PM
Greets - resurrecting this a bit; I'm looking for a CPP reference script (instantiate class, unlock api) for QuickPDF; the VS scripts are not GNU CPP, so are not actually that useful to getting GNU CPP going.

The platform target is Debian 9, GCC 6.3 (preferably, but not mandatory) and the library from FoxitQPLLinuxCPP1711.

I have a non-working snippet as my baseline, drawn from various cobbled sources:

#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include "Import/CPlusPlus/FoxitQPLLinuxCPP1711.h"
#include "Import/CPlusPlus/FoxitQPLLinuxCPP1711.cpp"

using namespace std;

int main()
{
  wstring pdfkey = "12345";
  wstring mymsg = "Loading result of key ";

  FoxitQPLLinuxCPP1711 qp = new FoxitQPLLinuxCPP1711();
  int result = qp.UnlockKey(pdfkey);

 wcout << mymsg << pdfkey << " ---- " << result << endl;
 return 0;
}

However, it is expecting, I believe, a specifically typed filename in the instantiation call based upon the errors:

testy.cpp:16:54: error: no matching function for call to ‘FoxitQPLLinuxCPP1711::FoxitQPLLinuxCPP1711()’
   FoxitQPLLinuxCPP1711 qp = new FoxitQPLLinuxCPP1711();
                                                      ^
In file included from testy.cpp:7:0:
Import/CPlusPlus/FoxitQPLLinuxCPP1711.cpp:30:1: note: candidate: FoxitQPLLinuxCPP1711::FoxitQPLLinuxCPP1711(const wstring&)
 FoxitQPLLinuxCPP1711::FoxitQPLLinuxCPP1711(const std::wstring& LinuxFileName)
 ^~~~~~~~~~~~~~~~~~~~
Import/CPlusPlus/FoxitQPLLinuxCPP1711.cpp:30:1: note:   candidate expects 1 argument, 0 provided
In file included from testy.cpp:6:0:
Import/CPlusPlus/FoxitQPLLinuxCPP1711.h:174:7: note: candidate: constexpr FoxitQPLLinuxCPP1711::FoxitQPLLinuxCPP1711(const FoxitQPLLinuxCPP1711&)
 class FoxitQPLLinuxCPP1711
       ^~~~~~~~~~~~~~~~~~~~
Import/CPlusPlus/FoxitQPLLinuxCPP1711.h:174:7: note:   candidate expects 1 argument, 0 provided

I'm not a stellar cpp/c# programmer, but have a pretty good idea where the semi-colons go. I am currently writing code as baseline using 3 different pdf generation libraries, across both c++ and php, and this is the only library I have yet to get to work right out of the box.
A console-based reference script would be appreciated if available!
Thanks!
TH.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk