Create pdf file from report

5 posts by 3 authors in: Forums > CMS Builder
Last Post: July 1, 2021   (RSS)

By andreasml - June 29, 2021

Hi

I would like to create a pdf from a report. I have installed the Create PDF plugin, but I do not know how to proceed. Could you give some advice?


Kind regards

Andreas Lazaris

By andreasml - July 1, 2021

Hi Jerry

Thank for your response. 

It seems that there is a problem of installation. When I run the Test Server Requirements, the test does not pass and a lot of errors appear as following: 

  • PDF Conversion ProgramThis plugin is using: /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/wkhtmltopdf/wkhtmltopdf-0.12.5-1.ubuntu18.04_bionic_amd64
    Plugins settings: CREATEPDF_BINARY_FILE: auto-detected
    If all the test below don't pass you can try: download updated binaries and testing all binaries
Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF_pluginsMenu.php on line 176
  • Failed! Run external program on serverTesting shell_exec() with command: pwd
    Result:
    Error: No output returned from command!
Warning: exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF_pluginsMenu.php on line 107 Warning: join(): Invalid arguments passed in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF_pluginsMenu.php on line 108
  • Failed! Test running PDF conversion program on serverTesting pdf binary with command: /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/wkhtmltopdf/wkhtmltopdf-0.12.5-1.ubuntu18.04_bionic_amd64 -V
    Result: 0 bytes returned
    Output:
    Error: No output returned from command! (Exit code: -1)
  • Passed! Create and remove temp file on serverCreating temp file: /var/www/vhosts/vascularregistry.gr/httpdocs/registry/createPDF_e6fcfc357a8e945b8caa03022a2ac06e.tmp
    Removing temp file: /var/www/vhosts/vascularregistry.gr/httpdocs/registry/createPDF_e6fcfc357a8e945b8caa03022a2ac06e.tmp
  • Passed! Test downloading content from remote URLDownloading content from url with: getPage('http://www.google.com/');
    Result: HTTP status code 302 (view source, html)
  • Passed! Test downloading content from this serverDownloading content from url with: getPage('http://vascularregistry.gr/');
    Resolve hostname 'vascularregistry.gr' to IP address: 185.138.42.30
    Result: HTTP status code 301 (view source, html)
    Check that this is returning your website's homepage!
Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 169 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Warning: exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 171 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 175
  • Failed! Test converting a web page to a PDFCreated PDF with: HTML from: https://www.google.com/
    Result: 0 byte PDF returned
    Error: Conversion program returned errors:
    Temp file didn't get created, check for: 1) wkhtmltopdf errors and 2) make sure server is able to connect to itself internally!
  • Visually review PDF output (link)Visually inspect the PDF below, correct any error message, then make sure the graphics and fonts display as expected:

Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 169 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Warning: exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 171 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 175 Temp file didn't get created, check for: 1) wkhtmltopdf errors and 2) make sure server is able to connect to itself internally!

Then, I try the Test all binaries and again all binaries fail. The message I get for every binary is about the same and it is as following:

Warning: exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF_pluginsMenu.php on line 107 Warning: join(): Invalid arguments passed in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF_pluginsMenu.php on line 108 Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 169 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Warning: exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 171 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 175 Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 169 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Warning: exec() has been disabled for security reasons in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 170 Notice: Undefined variable: outputArray in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 171 Notice: Undefined variable: returnCode in /var/www/vhosts/vascularregistry.gr/httpdocs/registry/plugins/createPDF/createPDF.php on line 175

  • Failed! wkhtmltopdf-0.12.6-1.centos8.x86_64
  • Program version reported: (Error: Exit code -1)
  • Create PDF of non-secure page http://www.example.com/ - Errors: Temp file didn't get created, check for: 1) wkhtmltopdf errors and 2) make sure server is able to connect to itself internally!
  • Create PDF of secure page https://www.google.com/ - Errors: Temp file didn't get created, check for: 1) wkhtmltopdf errors and 2) make sure server is able to connect to itself internally!

Any ideas on how to carry on?

Kind regards, 

Andreas Lazaris

By gkornbluth - July 1, 2021

Hi Andreas,

Sorry, understanding these kinds of errors is a bit over my head.

Are you running the latest version of the Plugin?

Other than that, I'd reach out to support and I'm sure that someone will be able to help.

Good luck,

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By daniel - July 1, 2021

Hi Andreas,

The createPDF plugin uses some PHP functions (exec() and shell_exec()) that are disabled on some hosts/installations as a security measure - that appears to be the case here. Depending on your host and setup you may be able to re-enable them; here are some instructions if you have access to php.ini: https://www.cyberciti.biz/faq/linux-unix-apache-lighttpd-phpini-disable-functions/ (these instructions are to disable the functions, but can be used to reverse the process)

Let me know if that helps!

Thanks,`

Daniel
Technical Lead
interactivetools.com