Print Page | Close Window

Debenu & PHP-CPP on Linux examples?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3837
Printed Date: 25 Apr 24 at 9:04AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Debenu & PHP-CPP on Linux examples?
Posted By: michib
Subject: Debenu & PHP-CPP on Linux examples?
Date Posted: 31 Aug 20 at 10:39AM
Hi to all,

I'm actually evaluating Debenu (foxit quick) PDF SDK. I need to integrate inside a PHP project on Linux. 

I am actually trying to get a working extension with php-cpp. I'm wondering if anybody has some working procedure or example for it? 

thanks,
Michele



Replies:
Posted By: txt258
Date Posted: 31 Aug 20 at 5:57PM
We've the same issue :) 


Posted By: michib
Date Posted: 01 Sep 20 at 10:09AM
Oh great.. we're two yet Big smile

I'm trying to compile the php extension with php-cpp, I'll post more eventually.


Posted By: michib
Date Posted: 01 Sep 20 at 6:13PM
Hi to all,

I was able to successfully compile the extension... but unfortunately calling it does segfaults. Anyway, here is my procedure. 

Linux: CentOS Linux release 7.5.1804 (Core) 

== PHP-CPP: 2.2.0 ==
Downloaded: make, make install. This putted /usr/lib/libphpcpp.so
Tested libphpcpp with example 'simple' inside PHP-CPP package. This worked.

== Foxit == 
Copied the simple example.
main.cpp overwritten with Import/PHP/FoxitQPLLinuxMain1811.cpp from foxit devel zip.
Makefile modified in the relevant part:
COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -o
LINKER_FLAGS = -shared
LINKER_DEPENDENCIES = -lphpcpp -lQPLLinux

This produces: foxitquickpdf.so
It seems linked correctly: ldd foxitquickpdf.so 
linux-vdso.so.1 =>  (0x00007ffd5891d000)
libphpcpp.so.2.2 => /lib/libphpcpp.so.2.2 (0x00007f2d009d6000)
libQPLLinux.so => /lib/libQPLLinux.so (0x00007f2cff738000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f2cff431000)
libm.so.6 => /lib64/libm.so.6 (0x00007f2cff12f000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f2cfef19000)
libc.so.6 => /lib64/libc.so.6 (0x00007f2cfeb4c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2d00c80000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f2cfe948000)

/usr/lib/libQPLLinux.so -> /usr/lib/libFoxitQPL1811-linux-x64.so from foxit devel zip.

The trying with:
<?php

$QP = new FoxitQPL();
$k = $QP->Unlocked();
echo $k;

but it segfaults.

Any ideas?

thanks





Posted By: Ingo
Date Posted: 01 Sep 20 at 9:44PM
Hi Michi,

do you have a testkey or regkey from Debenu/Foxit tounlock the library?




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



Posted By: michib
Date Posted: 02 Sep 20 at 11:48AM
Hi Ingo,

Yet I have a trial key. I also tried putting 

$k = $QP->UnlockKey("jz45q97d5ap8ut6w77nr9rb8y");

but it also segfaults. Also var_dump($QP) segfaults. 

I think it's something relate to linking with Foxit provided .so lib for linux. I've noticed that even if I not specify -lQPLlinux as a linker option it gets compiled straight away... but how it could be so without reference to the .so library provided by Foxit?   

I noticed a warning:
[31-Aug-2020 23:14:50 UTC] PHP Warning:  Module 'qplphp' already loaded in Unknown on line 0

And here my backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff7ef2413 in FoxitQPL::StringParm(std::string, bool&) () from /opt/rh/rh-php72/root/usr/lib64/php/modules/foxitquickpdf.so
#2  0x00007ffff7f5966d in void Php::ZendCallable::invoke<FoxitQPL, &FoxitQPL::UnlockKey>(_zend_execute_data*, _zval_struct*) ()
   from /opt/rh/rh-php72/root/usr/lib64/php/modules/foxitquickpdf.so
#3  0x00007fffed2a2ef5 in xdebug_execute_internal () from /opt/rh/rh-php72/root/usr/lib64/php/modules/xdebug.so
#4  0x0000555555829880 in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER ()
#5  0x0000555555887115 in execute_ex ()
#6  0x00007fffed2a2531 in xdebug_execute_ex () from /opt/rh/rh-php72/root/usr/lib64/php/modules/xdebug.so
#7  0x000055555588f573 in zend_execute ()
#8  0x00005555557e6423 in zend_execute_scripts ()
#9  0x0000555555781f60 in php_execute_script ()
#10 0x0000555555891976 in do_cli ()
#11 0x000055555563f57e in main ()
(gdb) 


Here on the forum someone is able to contact developers inside Foxit Debenu team?

Michele


Posted By: michib
Date Posted: 02 Sep 20 at 12:14PM
Hi,

Just another matter of facts. I know notice that my license file, received on 29 august, says "valid until 21 aug 2020'. what????? I really start wondering if Foxit Quick pdf library is a real alternative to Foxit full...

Michele



Posted By: Ingo
Date Posted: 02 Sep 20 at 6:21PM
"...
Here on the forum someone is able to contact developers inside Foxit Debenu team?
..."

This here is a user-community which has less to do with Debenu/Foxit.
So there's no direct contact to the developers.

Here you should get the contact you need:
https://www.debenu.com/support/




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



Posted By: michib
Date Posted: 03 Sep 20 at 7:38AM
Hi ingo,

Thanks so much for you help!
I wrote to the official foxit support too; waiting for some feedback. 
I was wondering if - as usual elsewhere - some Foxit employee gives a sneak peak here... 

regards,
Michele


Posted By: tfrost
Date Posted: 03 Sep 20 at 10:17AM
http://quickpdf.org/forum/forum_posts.asp?TID=3819&PID=15291&title=delphi-104-release#15291


Posted By: michib
Date Posted: 03 Sep 20 at 12:22PM
Thanks tfrost!
I'll try to contact to leonardo_martello@foxitsoftware.com and see.

Miche


Posted By: michib
Date Posted: 03 Sep 20 at 6:54PM
Hi to all,

Foxit Software Support replied today. Thanks to Kevin N. I was able to obtain my first PDF! He fixed also my license number wrong expiration date. 

To solve the segfault ... You need to pass the path to the .so library to the QPL constructor to make it work, in my case installed in /usr/lib:

$QP = new FoxitQPL('/usr/lib/libQPLLinux.so');

libQPLLinux.so is the name assigned by ldconfig.

Michele


Posted By: Ingo
Date Posted: 03 Sep 20 at 7:17PM
BTW: Kevin Newman was the man who published the very first release of QuickPDF.



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



Posted By: txt258
Date Posted: 05 Sep 20 at 3:57PM
Originally posted by michib michib wrote:

Hi to all,

I was able to successfully compile the extension... but unfortunately calling it does segfaults. Anyway, here is my procedure. 

Linux: CentOS Linux release 7.5.1804 (Core) 

== PHP-CPP: 2.2.0 ==
Downloaded: make, make install. This putted /usr/lib/libphpcpp.so
Tested libphpcpp with example 'simple' inside PHP-CPP package. This worked.

== Foxit == 
Copied the simple example.
main.cpp overwritten with Import/PHP/FoxitQPLLinuxMain1811.cpp from foxit devel zip.
Makefile modified in the relevant part:
COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -o
LINKER_FLAGS = -shared
LINKER_DEPENDENCIES = -lphpcpp -lQPLLinux

This produces: foxitquickpdf.so
It seems linked correctly: ldd foxitquickpdf.so 
linux-vdso.so.1 =>  (0x00007ffd5891d000)
libphpcpp.so.2.2 => /lib/libphpcpp.so.2.2 (0x00007f2d009d6000)
libQPLLinux.so => /lib/libQPLLinux.so (0x00007f2cff738000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f2cff431000)
libm.so.6 => /lib64/libm.so.6 (0x00007f2cff12f000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f2cfef19000)
libc.so.6 => /lib64/libc.so.6 (0x00007f2cfeb4c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2d00c80000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f2cfe948000)

/usr/lib/libQPLLinux.so -> /usr/lib/libFoxitQPL1811-linux-x64.so from foxit devel zip.

The trying with:
<?php

$QP = new FoxitQPL();
$k = $QP->Unlocked();
echo $k;

but it segfaults.

Any ideas?

thanks





Thank you. Im going to try and see if I can get this to work.


Posted By: txt258
Date Posted: 27 Dec 20 at 2:18AM
Just wanted to let members know. I'm still not having much luck getting this installed on a Linux either on Centos and Ubuntu.


Posted By: Ingo
Date Posted: 27 Dec 20 at 3:53PM
Hi Tex,

what does "segfaults" mean?
Google isn't able to translate it.
Don't know if it matters but you know that QP is handling strings as unicode?



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




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