cangelis / l4pdf Goto Github PK
View Code? Open in Web Editor NEWYet another HTML to PDF converter for Laravel4 based on wkhtmltopdf
License: MIT License
Yet another HTML to PDF converter for Laravel4 based on wkhtmltopdf
License: MIT License
Could you make it campatible with Laravel 5? Thanks!
If the class is called several times using the Laravel facade (e.g. PDF::loadView(...)) in order to print different PDFs, each PDF generated also contains the content from the previous ones (e.g. when printing several invoices in a single run, invoice 1 is fine, invoice 2 is a composite of 1 and 2, invoice 2 is a composite of 1,2 and 3).
The problem is that the $htmlContent attribute isn't cleared between calls to generatePDF().
There are at least two possible ways to handle this (which is why this isn't a pull request!) You could:
There are probably others too.
After spending a long time trying to get wkhtmltopdf to install correctly on my vagrant vm, I am now getting the above error when using:
PDF::loadUrl('http://www.laravel.com')->download('laravel.pdf');
It's creating the pdf of the page with the same file name and this is located in the /vagrant/app/storage/ directory.
Aside from this problem I really like the package, great work.
Me again ๐, I am having varying success with this package...
This is the code I am using at the moment:
$job = Job::findOrFail($index);
$admin = Company::findOrFail(1);
return PDF::loadView('quotes.forward', compact('job', 'admin'))->save('/vagrant/public/test.pdf');
It will stream and download the output but when I try and save it I get the above message. I have tried changing the directory but it makes no difference. A blank file is created in the correct directory with the title matching the error (in this case /test.pdf8O1RWi)
I cannot work out what is causing the random string to be appended at the end of the filename or how to fix this problem.
The output pdf that it is producing when it streams/downloads is excellent.
Is it supports the Arabic language?
I'm receiving this error after installing 0.12 on ubuntu 13.10:
PDF could not be created: "Segmentation fault (core dumped)\n"
It worked good with 0.11on ubuntu 12.04.
What's wrong?
Had a bit of an issue today where l4pdf was constantly refusing to give back a pdf. Tracked it down to an exit code of 1 from wkhtmltopdf; the reason however is a bit interesting --
# wkhtmltopdf 5424552c6da9e465e9.html ./test.pdf
Loading pages (1/6)
QSslSocket: cannot resolve SSLv2_client_method ] 10%
QSslSocket: cannot resolve SSLv2_server_method
Warning: Failed to load file://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css (ignore)
Warning: Failed to load file://d1l6p2sc9645hc.cloudfront.net/tracker.js (ignore)
Warning: A finished ResourceObject received a loading progress signal. This migth be an indication of an iframe taking to long to load.
Warning: A finished ResourceObject received a loading finished signal. This migth be an indication of an iframe taking to long to load.
Counting pages (2/6)
Loading TOC (3/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Exit with code 1 due to http error: 1005
Essentially it's errorring out because of random css/js on a page (pretty typical css+jss I should say).
If that's what error code 1 means, it might be a good idea to only error on > 1 ?
Hi, i see you have a good html to pdf converter here,but cant really use it with Laravel. i installit well, but on use iget :PDFException in PDF.php line 146: PDF could not be created: "The system cannot find the path specified.\r\n" how so i configure executable path, and how doi even install it....no tutorial for this. Please Help. [email protected]
I'm trying to add a header with hebrew characters with headerCenter() method but the results is gibrish.
I was trying also with encoding('UTF-8') without success.
How can I configure wkhtmltopdf path in windows. I have my wkhtmltopdf in C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe
It is showing error: PDF could not be created: "The system cannot find the path specified.\r\n"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.