Comments (10)
Hi,
Alhamdulillah, I got wkhtmltopdf running on ubuntu after installing wkhtmltopdf as follows:
apt-get install wkhtmltopdf
apt-get install xvfb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
chmod a+x /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf
[reference: http://fedir.github.io/web/blog/2013/09/25/install-wkhtmltopdf-on-ubuntu/]
and configure the bootstrap with
CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes' => true));
Configure::write('CakePdf', array(
'binary' => '/usr/local/bin/wkhtmltopdf', // set the correct path here
'engine' => 'CakePdf.WkHtmlToPdf',
'margin' => array(
'bottom' => 15,
'left' => 15,
'right' => 15,
'top' => 20
),
'encoding'=>'UTF-8',
'pageSize'=>'A4',
'download' => false
));
[reference: https://stackoverflow.com/questions/23978338/cakepdf-plugin-wkhtmltopdf-binary-is-not-found/25472021#25472021]
I cheat the CSS using standard html style.
--enjoy
from cakepdf.
I am sorry , it appears the problem was with version 0.9.9
i removed it and installed 0.11.0 rc1 and it works great
Thank you so much for this plugin 👍
from cakepdf.
I am having the same issue, but I do have version 0.11.0 rc1 installed: "wkhtmltopdf-0.11.0-rc1 osx".
from cakepdf.
incorrect encoding also could cause this problem, cakepdf uses utf8 by default.
Besides that, i cant tell why wkhtml2pdf returns no content.
from cakepdf.
Anything I can debug to get to the bottom of this issue?
from cakepdf.
CakePdf can only render if any content is being returned, its hard to tell why wkhtmltopdf is not returning any data.
You could perhaps try with very simple view and layout template, not images and external css.
also you can try wkhtmltopdf command from console, to check if it works when calling it directly.
from cakepdf.
You could drop by on irc #cakephp on freenode and ping me
from cakepdf.
I did try using the console and it works fine. I also tried a simple HTML view, nothing fancy, just text, and still cannot get past that error message. :-/
On Mar 17, 2013, at 1:32 PM, ceeram [email protected] wrote:
CakePdf can only render if any content is being returned, its hard to tell why wkhtmltopdf is not returning any data.
You could perhaps try with very simple view and layout template, not images and external css.
also you can try wkhtmltopdf command from console, to check if it works when calling it directly.—
Reply to this email directly or view it on GitHub.
from cakepdf.
I am not sure but if the console works fine maybe the problem is with your configuration
This is my configuration , its the default one actually nothing :
CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes' => true));
Configure::write('CakePdf', array(
'engine' => 'CakePdf.WkHtmlToPdf',
'margin' => array(
'bottom' => 15,
'left' => 50,
'right' => 30,
'top' => 45
),
'encoding'=>'UTF-8',
'pageSize'=>'A4',
'download' => true
));
You can also try tracing the contents, in PLUGIN_HOMe/cakePdf/Pdf/Engine/WkThmlToPdfEngine.php, when I was googling about this i saw some post about the command ($command .= " --print-media-type";) might cause the problem, but I can't find now, sorry
from cakepdf.
Try re-installing wkhtml , maybe it will help.
This is how i installed it (working under ubuntu server)
wget https://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2
tar -vxf wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2
mv wkhtmltopdf-i386 wkhtmltopdf
chmod a+x wkhtmltopdf
sudo mv wkhtmltopdf /usr/bin
from cakepdf.
Related Issues (20)
- CakePdf configuration ignored by the plugin HOT 2
- Add debug option for PDF rendering engine - fonts not rendering HOT 1
- CakePHP 4.x Compatibility HOT 3
- Adapt project description to mention CakePHP 4 HOT 1
- Stable release for CakePHP 4 HOT 2
- Its showing Failed to load PDF document HOT 1
- Error with Cakephp4 HOT 1
- $CakePdf->viewVars($this->_View->viewVars); problem
- wkhtmltopdf binary is not found or not executable - getBinaryPath()
- Include CSS Files in Command does not work HOT 2
- Error in documentation HOT 2
- parameters not passed to mPDF engenie HOT 3
- Using PHP8 impossible with current configuration HOT 2
- Missing CSS with wkhtmltopdf 0.12.6
- Custom Engine possible? (Trying weasyprint) HOT 1
- Problemas ao usar wkhtmltopdf HOT 3
- Windows IIS PHP 8.0.12 System error "'""c:\wkhtmltopdf\bin\wkhtmltopdf.exe" is not recognized as an internal or external command HOT 1
- Support for CakePHP version 4.3 HOT 1
- Loading fonts on CakePHP 4 from Google Fonts HOT 1
- Linux server cannot run direct /usr/bin/wkhtmltopdf
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cakepdf.