Plugins - Create PDF - Test Failed! is using https
6 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: April 30, 2018 (RSS)
When running the "Test Server Requirements" it returns the following error.
Failed! Test downloading content from this serverDownloading content from url with: getPage('http://www.domain.com/');
Resolve hostname 'www.domain.com' to IP address: 12.345.678.910
Error: Received HTTP status code '301' (should be 200 or 302)! (view source, html)
The following shell commands may help you debug connection issues from your server:wget --spider -T2 -O- http://www.perfectoptical.com/ 2>&1curl --head -v -m2 http://www.domain.com/ 2>&1
When I update the code from "http://" to "https://" in __createPDF_tests_download_remoteUrl the in the createPDF_pluginsMenu.php file all pass.
Basically we need https detection logic.
Regards,
By Dave - April 27, 2018
Hi Brownleather,
Is it working aside from that? I think the issue is we're not detecting 301 as a valid return code but it is. I can update the code for that with the next release.
Let me know, thanks!
interactivetools.com
It turns out that its was the temp directory...
I added temp directory setting before the createPDF_fromOutput call and all is working!
$GLOBALS['CREATEPDF_TEMPDIR_PATH'] = '/home/account_name/public_html';
createPDF_fromOutput('attachment', 'statement-'.$statement_key.'.pdf');
By Dave - April 27, 2018
Ok, great. Glad to hear your got it working!
interactivetools.com
What approach would recommend using for generating a large PDF (say one thousand pages)?
Thanks
By Dave - April 30, 2018
It's going to take a lot of memory, I'd recommend seeing if you could generate them individually and then merge them. You might need to try a few additional command line binaries for that.
Ref: https://stackoverflow.com/questions/2507766/merge-convert-multiple-pdf-files-into-one-pdf
interactivetools.com