friendsofcake / cakepdf Goto Github PK
View Code? Open in Web Editor NEWCakePHP plugin for creating and/or rendering PDFs, supporting several popular PDF engines.
License: MIT License
CakePHP plugin for creating and/or rendering PDFs, supporting several popular PDF engines.
License: MIT License
Hi ceeram.
Thanks for this good plugin.
But I'm having slight trouble when I try to save the file into the server.
It successfully saved into the server using the $CakePdf->write($path) but the pdf generated does not have CSS and images in it.
Please help me to fix this problem.
Thanks in advance.
Hi @ceeram, thanks for your contribution, very good plugin!! About the static assets, I found that if we add an element on layout, we can avoid to extend the Helper class, this could be reached adding a line as below:
<base href="<?php echo $this->Html->url('/', true); ?>">
Ref of this element > https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
I think it would be nice if javascript-delay option can be set because sometimes it takes longer time to load javascript(such as MathJax).
I don't know if this is a problem with my set up of CakePDF, or if this is just impossible with the current plugin, but I cannot get any PDF to actually read/execute Javascript. If I have an html page with just html and php, the page will generate just fine; however, it will skip anything in Javascript tags. I really need to be able to use Javascript when the PDF is created so that I can create the images I need to be on the document. I am using wkhtmltopdf as the engine.
I apologize if this has been answered before, but in days of researching the problem and experimenting with possible solutions, I have found no information on getting Javascript to work. I would greatly appreciate any help in this matter. Thanks.
I just saw your plugin and it seems interesting, however, I noticed that you don't seem to 'tag' releases (e.g. tag them as 2.1, 2.2 etc.).
When creating projects, we try to include external libraries / plugin as SVN-external, connected to GitHub. This way we can easily update external libraries as well via SVN. However, to prevent 'unwanted' updates, we try not to use the 'master' branch for those externals, but connect the external to a specific version/tag. Would it be possible to 'tag' your releases?
(Of course it's possible to clone the repository and tag releases ourself.)
All was fine, and not I get Notice (8): Undefined variable: on all the variables on the template and nothing load from $this->fetch('content')
Here is what I got on the logs
2014-09-26 01:10:48 Error: [MissingHelperException] Helper class _ViewHelper could not be found.
Exception Attributes: array (
'class' => '_ViewHelper',
'plugin' => false,
)
Request URL: /back/histories/viewpdf/541c574b-d280-43b9-b3f6-61126baa322c.pdf
Stack Trace:
#0 /Applications/MAMP/htdocs/back/lib/Cake/View/HelperCollection.php(63): HelperCollection->load('_View')
#1 /Applications/MAMP/htdocs/back/lib/Cake/View/View.php(837): HelperCollection->__isset('_View')
#2 /Applications/MAMP/htdocs/back/app/View/Layouts/pdf/default.ctp(170): View->__get('_View')
#3 /Applications/MAMP/htdocs/back/lib/Cake/View/View.php(948): include('/Applications/M...')
#4 /Applications/MAMP/htdocs/back/lib/Cake/View/View.php(910): View->_evaluate('/Applications/M...', Array)
#5 /Applications/MAMP/htdocs/back/lib/Cake/View/View.php(542): View->_render('/Applications/M...')
#6 /Applications/MAMP/htdocs/back/lib/Cake/View/View.php(479): View->renderLayout('', 'default')
#7 /Applications/MAMP/htdocs/back/app/Plugin/CakePdf/View/PdfView.php(89): View->render(NULL, NULL)
#8 /Applications/MAMP/htdocs/back/lib/Cake/Controller/Controller.php(954): PdfView->render(NULL, NULL)
#9 /Applications/MAMP/htdocs/back/lib/Cake/Routing/Dispatcher.php(198): Controller->render()
#10 /Applications/MAMP/htdocs/back/lib/Cake/Routing/Dispatcher.php(165): Dispatcher->_invoke(Object(HistoriesController), Object(CakeRequest))
#11 /Applications/MAMP/htdocs/back/app/webroot/index.php(109): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#12 {main}
Any idea what is wrong, engime is WkHtmlToPdf
Thank You
Hi there,
I am using the latest CakePDF plugin with wkthmltopdf engine. In my case I have two wkhtmltopdf binaries, version 0.9.9 and 0.11.0 (I needed to use it without X11 and I have not removed the old version).
In my global configuration I have binary path defined to access new version. Everything is working when I am using first method from README "1: Render as pdf (including forced download) in the browser with PdfView".
If however I want to save it to disk on the server, the pdf does not get rendered with error "WKHTMLTOPDF didn't return any data Error: An Internal Error Has Occurred". I remember this error from time using 0.9.9. So I set the binary path directly in controller
$conf = array( 'binary' => '/usr/bin/wkhtmltopdf-amd64' );
$CakePdf = new CakePdf($conf);
and it is working. Every other setting from global configuration seems to be applied except binary.
hi,
we added support to php extension of libwkhtmltox. we extended the WkHtmlToPdfEngine.php. if you want i can send you the file or do an pull request. but i'm new to github and don't know how to do it ;)
to use libwkhtmltox as php extension we used an extended version of php-wkhtmltox from https://github.com/mreiferson/php-wkhtmltox and the current wkhtmltox 0.12 from https://github.com/antialize/wkhtmltopdf (+wkhtmltox-qt from gitorious.org/~antialize/qt/antializes-qt). we had to extend the php module with string input/output and error reporting. we added an issue/pull request there also.
greetings from germany
dominik
Hi
I am trying to use helpers in the view when using method 2 mentioned in the docs (save file on disk). Unfortunatley this doesn't work:
$CakePdf = new CakePdf();
$CakePdf->helpers('Html');
...
What I am doing wrong?
Beside of that using this method does ignore the settings made in "Configure" (path to binary) - I have to set it on construct:
$config = array('binary' => Configure::read('CakePdf.binary'));
$CakePdf = new CakePdf($config);
Thanks,
Frank
Hi
It would be faboulous if the plugin supports the options give by wkhtmltopdf. Especially the header and footer ones. Perhaps an option to set external html-files for both.
Thanks,
Frank
ceeram - I'm new to CakePHP and feel like I'm getting a good grasp on things, but I can't get this plugin to work, mainly from the lack of being able to follow the readme. Would it be possible to get a step-by-step setup. I have an app with an Observations controller that I would like to print out the observation responses in PDF format for the users.
in Config/bootstrap.php I added the following:
CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes' => true));
I'm unclear what to put in my observations controller to use the plugin, I have an viewPdf action that I want to call to render the pdf output, but not sure what to put in the function to call it - I looked at one of the test cases and used the following:
Configure::write('Pdf', array(
'engine' => 'WkHtmlToPdf',
'margin' => array(
'bottom' => 15,
'left' => 50,
'right' => 30,
'top' => 45
),
'orientation' => 'landscape',
'download' => true
));
$pdf = new CakePdf($config);
$path = CakePlugin::path('CakePdf') . 'Test' . DS . 'test_app' . DS . 'View' . DS;
App::build(array('View' => $path));
$pdf->viewVars(array('data' => 'testing'));
$pdf->template('testing', 'pdf');
$result = $pdf->output();
$expected = 'Data: testing';
$html = '<h2>Title</h2>';
$result = $pdf->output($html);
but I'm gettin Class CakePdf not found - any help would be appreciated.
Thank you
I have used configuration like
Configure::write('CakePdf', array(
'engine' => 'CakePdf.Tcpdf',
'options' => array(
'print-media-type' => true,
'outline' => true,
'dpi' => 96
),
'margin' => array(
'bottom' => 15,
'left' => 50,
'right' => 30,
'top' => 45
),
'orientation' => 'portrait',
'download' => true,
'permission' => true
));
After then I have added css with view file
echo $this->Html->css('company', array('fullBase' => true));
I have checked normal view and it's fine but when I am downloading pdf no css works!!
Hey guys,
I installed this plugin correctly and have red all the issues and comments now. But I cannot get it to work on Windows 7 with wkhtmltopdf. I used wkhtmltopdf from the console and it's working fine, but when I try to browse to my PDF file (which is working fine with domPdf) I get an error 500 and
Stack Trace
APP\Plugin\CakePdf\Pdf\Engine\WkHtmlToPdfEngine.php line 29 → WkHtmlToPdfEngine->_getCommand()
@return string raw pdf data
*/
public function output() {
$content = $this->_exec($this->_getCommand(), $this->_Pdf->html());
APP\Plugin\CakePdf\Pdf\CakePdf.php line 236 → WkHtmlToPdfEngine->output()
}
}
$output = $Engine->output();
APP\Plugin\CakePdf\View\PdfView.php line 97 → CakePdf->output(string)
$this->response->download($this->getFilename());
}
$this->Blocks->set('content', $this->renderer()->output($content));
return $this->Blocks->get('content');
'
<div id="content">
<div class="main-static">
10.09.2014 |
</div>
</section>
Hello,
I try to use CakePdf with Tcpdf engine. Get the pdf file is ok but the default layout is not used.
I think that the issue is due to path recognition but I am not sure ?
My application uses plugins so my Views are structured like this
App->Plugin->EduMan->View->Canvassings->view.ctp (to get normal html view) (OK)
App->Plugin->EduMan->View->Canvassings->pdf->view.ctp (to get pdf file) (OK but without using the layout)
CakePdf is in
App->Plugin->CakePdf
The default.ctp layout file is in
App->View->Layouts->pdf->default.ctp
What goes wrong with this structure
Thank for the time you use to answer me
Patrick
Seems like the composer name is in same cases not "name": "friendsofcake/cakepdf"
which it should be, but "cake-pdf" etc, README for example:
composer require friendsofcake/cake-pdf
This should be revised.
When using the recommeded wkthmltopdf engine I'm getting a PDF with a readable table of contents, but the pdf itself is composed of a bunch of black squares as if it can't find the correct font (I'm not using font's by the way) - any idea of what I'm missing?
Hi, thanks for your plugin, it's really nice.
hm sorry, did an error it's working.
hi,
many attempts of CakeException failed with a memory size exhausted problem..
when i create the missed files, it's okay.. but before i know which files is, .. i must debug on Cake-lib..
the last issue was the '/app/View/Errors/pdf/cake.ctp' is missing..
Using this configuration:
$this->pdfConfig = array(
'engine' => 'CakePdf.Tcpdf',
'options' => array(
'print-media-type' => false,
'outline' => true,
'dpi' => 96
),
'orientation' => 'landscape',
'pageSize' => 'LETTER',
'margin' => array(
'bottom' => 0,
'left' => 26,
'right' => 26,
'top' => 26
),
'download' => false,
'filename' => 'Certificate_'.$id,
);
the CakePdf object doesn't set this margins to the Tcpdf Engine.
Hi ;)
I would like to add footer to my pdf. Code below doesn't seem to work for me:
$CakePdf->footer("Left part", "Center", "Page x of X");
Used before:
$CakePdf->template('docs/view', 'default');
Can anyone help me with this, please?
Hi, firstly, thanks for making a great plugin. This isn't exactly an issue more that I can't get it to work and would really appreciate your help (I'm still a bit of a cake novice).
I've been trying to get this to work based on the details in the read me file but have hit a brick wall. I'm trying to create a pdf to be sent as an email attachment. I'm my controller I have this:
// Build PDF as attachment
$CakePdf = new CakePdf();
$CakePdf->template('view', 'default');
//get the pdf string returned
$pdf = $CakePdf->output();
// SMTP Options
$this->Email->smtpOptions = array(
// Only to be used internally
'port'=>'25',
'timeout'=>'30',
'host' => '192.2.200.9',
'username'=>'',
'password'=>''
);
$this->Email->template = 'newExpenseClaim';
$this->Email->from = 'Expense Tracker <[email protected]>';
$this->Email->to = '[email protected]'; // This needs to be a new mailbox, like [email protected] etc
$this->Email->subject = 'New Expense Claim Submitted - Please Review';
$this->Email->sendAs = 'both';
$this->Email->delivery = 'smtp';
$this->Email->attachment = $pdf;
// Set username & url in email
$this->set('user', $fu['User']['name']);
$this->set('ms', $ms);
$this->Email->send();
$this->set('smtp_errors', $this->Email->smtpError);
I seem to be failing on the first hurdle though as I get "Error: Class 'CakePdf' not found" when I run the code. I have everything set up OK in bootstrap etc as I am successfully showing views as PDFs but am struggling when trying to create one to attach to an email.
Would you mind pointing me in the right direction?
Many thanks in advance for your help.
I am getting this error when I set the engine to WkHtmlToPdf
Any ideas what did I do wrong ?
My configuration:
Configure::write('CakePdf', array(
'engine' => 'CakePdf.WkHtmlToPdf',
'margin' => array(
'bottom' => 15,
'left' => 50,
'right' => 30,
'top' => 45
),
'encoding'=>'UTF-8',
'download' => true
));
wkhtmltopdf version 0.9.9
Other engines are working fine but there are no images in the pdf file!
Hello!
I don't know if this is possible, but dompdf is now on github. Maybe "linking" the Vendor/dompdf folder to the project would be a good idea for keeping it up to date?
https://github.com/dompdf/dompdf
Thanks,
Bernhard
Hello @ceeram, firstly I'd like to thank you for your contribution.
I'm using WkhtmlToPdf to render my PDF's and I'm having a problem with my footer.
If i use the following config on my controller:
$this->pdfConfig = array(
'options'=>array(
'footer-html'=>Router::url('/', true).'Pages/display/pdf_footer'
),
'download'=>true
);
I can see in the downloaded file the footer and the images that should appear on it. But, if I change the config to:
$this->pdfConfig = array(
'options'=>array(
'footer-html'=>Router::url('/', true).'Pages/display/pdf_footer'
),
'download'=>false
);
The footer doesn't display at all, not even the text. And if I change this configuration key in my bootstrap.php it works as well, the problem is that I need different footers in each pdf.
// bootstrap.php
CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes'=>true));
Configure::write('CakePdf', array(
'engine' => 'CakePdf.WkHtmlToPdf',
'options' => array(
'print-media-type' => false,
'dpi' => 96
),
'margin' => array(
'bottom' => 50,
'left' => 50,
'right' => 30,
'top' => 45
),
'orientation' => 'portrait',
'download' => FALSE,
));
Some pics of my pdf's:
This one was downloaded
This one was set to be displayed inline.
Using:
Wkhtmltopdf v0.12
CakePHP v2.4.6
Ubuntu 12.04
Any help/feedback here would be nice. I'm debugging your classes for 3 days and I can't figure out what is happening.
If you need more code I can post here.
How do I organize the data on the screen, I have to use something like $tcpdf-> Cell (0,14, 'Hello World', 0,1, 'L') ???
Thanks
When using CakePdf from another plugin I get this error:
Layout file "../app/View/Themed/Capture/Plugin/CakeHelp/Layouts/pdf/bootstrap.ctp" is missing.
It should detect that im on a plugin and strip that part of the plugin, or at least if the file is not present should search the default layout inside the theme layout directory ( /app/View/Themed/Capture/Layouts/pdf/bootstrap.ctp ) and then the default file ( /app/View/Layouts/pdf/bootstrap.ctp ) before give error to behave like the normal workflow in cake.
Any direction where find this loading to send you a pull request?
I've set up CakePdf in my CakePHP application this evening. I have it generating PDFs in my browser using PdfView, however these PDFs are plain text. It seems like no CSS is being applied, nor do any images show up.
I have CSS files linked in my Layout file, plus I have an image inserted in an element used by that Layout file.
Now, I can only get the PDF to generate if I use relative paths to the files. If I use fullBase the PDF will take ages to load and eventually result in an Internal 500 Error. At which point I have to clear the cookies to my site and re-login.
Any ideas of what I can do to resolve the issue, or steps to debug the problem?
Shell error, return code: 1
Movement->find('first', array('recursive' => 2, 'conditions' => array('Movement.token' => $token, 'Movement.servidor_id' => $this->Auth->user('servidor_id'))))): $name = sprintf('contracheque-%s-%d', $this->Format->mesExtenso($result['Payroll']['mes']), $result['Payroll']['ano']); $this->pdfConfig = array( 'engine' => 'CakePdf.WkHtmlToPdf', 'orientation' => 'portrait', 'options' => array( 'print-media-type' => true, 'outline' => true, 'dpi' => 96, 'fullBase' => true ), 'margin' => array( 'bottom' => 15, 'left' => 50, 'right' => 30, 'top' => 45 ), 'download' => false, 'filename' => $name ); // Set $this->set( array( 'result' => $result ) ); else: throw new NotFoundException('Contracheque não encontrado.'); endif; } ```For usage need:
public $components = array('RequestHandler');
Do you think we could add something like __call(...) that when loaded an engine, and a method is called, it would be directed to the supported engine. Would open the box to allow other functionality of the loaded engines.
What do you think?
Hi,
I wanted to say that I find your plugin great.
Everything works perfectly.
Except when I want to protect my site with htaccess and htpasswd.
CSS and images no longer work.
Hi,
I have WkHtmlToPdf 0.12.0 installed on my Ubuntu 12 server. I can run it and create PDFs from the command line.
I've installed cakePDF in a new CakePHP 2.5.0 installation and followed the instructions but when I go to the URL to generate a PDF I get the following:
System error
Exit with code 1 due to http error: 1203
Stack Trace
APP/Plugin/CakePdf/Pdf/CakePdf.php line 236 → WkHtmlToPdfEngine->output()
APP/Plugin/CakePdf/View/PdfView.php line 97 → CakePdf->output(string)
CORE/Cake/Controller/Controller.php line 954 → PdfView->render(null, null)
CORE/Cake/Routing/Dispatcher.php line 198 → Controller->render()
CORE/Cake/Routing/Dispatcher.php line 165 → Dispatcher->_invoke(SeminarsController, CakeRequest)
APP/webroot/index.php line 108 → Dispatcher->dispatch(CakeRequest, CakeResponse)
Any suggestions?
Anybody considered to add PhantomJs as an engine for PDF rendering ?
Its open Source and multiplatform. It requires to be able to exec a binary ( in the line of
WkHtmlToPdf, so this shouldn't suppose a problem) and has the added benefit fo rendering also "screenshoots" of webpages,as its a full featured "headless" browser, based on WebKit engine.
I'm trying to use CakePdf inside my own plugin ,say MyPlugin and le path to le view template when using the template function is not correct.
When i'm using $CakePdf('test', 'default'), i'm getting a missing view error as the system is lookin for C:\wamp\www\myApp\app\View\Pdf\test.ctp
When i'm using $CakePdf('MyPlugin.test', 'default'), i'm still getting a missing view error as the system is lookin for C:\wamp\www\myApp\app\View\Plugin\MyPlugin\Pdf\test.ctp instead of C:\wamp\www\myApp\app\Plugin\MyPlugin\View\Pdf\test.ctp
Hi,
I am in a problem with CakePDF. I am using CakePHP 2.3.6. I setup everything alright, bootstrap & core files are ok.
Now, I want to generate many pdf files and download them. Downloading is ok, but when I download the files, I see that the generated pdf files say that "Undefined $data", where I send "$data" to the view file.
Here is my Controller code :
App::uses('CakePdf','CakePdf.pdf');
....................
public function createPdf($id){
$data=$this->DBTable->find('all',array('conditions'=>array('DBTable.id'=>$id)));
$CakePdf=new CakePdf();
$path=APP.DS.'pdf'.DS;
foreach($data as $key=>$var){
$CakePdf->template('create','default');
$this->set('var',$var);
$this->pdfConfig=array(
'orientation'=>'portrait',
'filename'=>$var['id'].".pdf"
);
$CakePdf->write($path.$var['id'].".pdf");
}
}
Here, I am downloading the files some other way, not related to this problem, because downloading is ok. When run this, all files are downloaded, and when I see the files, they say "Udefined var", looks like they didn't receive and variable called "$var".
I put the view file & the layout exactly where ceeram said.
What should I do now ? Please help me. @ceeram
This is in my bootstrap
CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes' => true));
Configure::write('CakePdf', array(
'engine' => 'CakePdf.Mpdf',
'orientation' => 'landscape'
));
However the page is always displayed in portrait. Even if I put the Mpdf custom pagebreak tag in the output
<pagebreak orientation="landscape" />
Me and another person seems to be having trouble getting this setup initially. I was wondering if the readme / instructions are correct for the latest version or if they need to be updated.
Here is a detail of our issues. https://groups.google.com/forum/?fromgroups#!topic/cake-php/LrJ95jo5jIQ
Thankyou
I have a project I'm working on and would like to use an existing PDF as a template to write on. I have come across a way to use FPDI with TCPDF to combine the HTML-to-PDF rendering of TCPDF with the template support of FPDI. I thought it would be neat to have FPDI included in this plugin and have a settings option when you define CakePdf config that points to a template PDF to use.
Just a thought.
Reference: http://www.setasign.de/products/pdf-php-solutions/fpdi/demos/tcpdf-demo/
Hi,
I follow the readme but I am not able to generate a PDF !
The PDF file is loading, but it is always empty, even if the view has data.
And if I try to put some text in the view file, the pdf returns an error.
Any idea about this kind of issue ?
Thanks by advance.
I've installed the plugin and can use PDFView to do an inline PDF or forced download. It looks WONDERFUL.
When I use the instructions for $CakePdf->write() it saves the PDF to the server but it loses some of the Bootstrap 3 formatting. I think it might have something to do with the width of the written PDF.
Has anyone run into a similar situation?
I'm having an issue with using CakePdf.DomPdf
engine with unicode chars. The problem is that DomPdf does not include unicode fonts like DejaVu.
If the CakePdf would include DomPdf as a Packager dependency, the problem would be solved with a newer version of DomPdf. You must have modified DomPdf as a drop-in replacement for /Plugin/CakePdf/Vendor/dompdf
does not seem to work.
Anywhere I'm rendering 2 "f" characters together, the end of the line/element seems to get an unknown character.
If I translate the double-"f" in the layout, it fixes it.
// bug with double-"f" characters... WTF?
$html = preg_replace('#ff#', 'ff', $html);
This might be something funky in my application, or WkHtmlToPdfEngine
, or CakePdf
, or gremlins... not sure... I'm looking to see where it might be coming from on my end... I can not find anything in beforeRender or afterRender or anything...
Have you ever heard of or seen this type of thing before?
Using the version of bootstrap that comes with nodesagency's twitter bootstrap (2.1) causes memory issues using a newer version fixes the problem.
I know this is not an issues with this plug-in but it may help someone else some headache of figuring it out.
The included version in the repo is a bit old (5.4), it could be updated with the latest (5.7.3 at this time).
I am unable to perform page break, how to use page break with wkhtmltopdf Engine....
Hi.
I want to add html page header/footer to my pdf. Right now I hardcode the html table in the view..
But I want to have the header/footer printed automatically at all page.
I read somewhere that for wkhtmltopdf we can use --header-html test.html .......
But how to do it in CakePdf?
Thanx for the help.!
Hi:
Since I've not been able to get Wkhtmltopdf to work, I tried using MPDF. I downloaded the latest version, and placed in /App/Vendor/CakePdf.Mpdf/. When trying to render the view, I get the following error messages:
Notice (8): Undefined index: BODY [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14242]
Notice (8): Undefined index: BODY>>ID>> [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14288]
Notice (8): Undefined offset: -1 [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14421]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14939]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14940]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14941]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14939]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14940]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14941]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14939]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14940]
Notice (8): Undefined index: MARKS [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14941]
Notice (8): Undefined index: H1 [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14242]
Notice (8): Undefined index: H1>>ID>> [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14288]
Notice (8): Undefined index: H1 [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14242]
Notice (8): Undefined index: H1>>ID>> [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 14288]
Notice (8): Undefined property: mPDF::$hasOC [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 27777]
Notice (8): Undefined property: mPDF::$hasOC [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 27879]
Notice (8): Undefined property: mPDF::$hasOC [APP/Plugin/CakePdf/Vendor/mpdf/mpdf.php, line 8772]
Here is my bootstrap config:
CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes' => true));
Configure::write('CakePdf', array(
'engine' => 'CakePdf.Mpdf',
'margin' => array(
'bottom' => 15,
'left' => 50,
'right' => 30,
'top' => 45
),
'orientation' => 'portrait',
'download' => true
));
Any ideas where to start?
hi guys,
i included CakePdf with WkHtmltoPdf Configuration
Configure::write('Pdf', array(
'engine' => 'CakePdf.WkHtmlToPdf',
'binary' => '/usr/local/bin/wkhtmltopdf',
'orientation' => 'potrait',
'margin' => array(
'bottom' => 15,
'left' => 50,
'right' => 30,
'top' => 45
),
'download' => true
));
yes, wkhtmltopdf (0.10.0 rc2) is installed on '/usr/local/bin/wkhtmltopdf'..
my error.log says:
2012-08-24 12:02:13 Error: [CakeException] Shell error, return code: 1
#0 /app/Plugin/CakePdf/Pdf/CakePdf.php(234): WkHtmlToPdfEngine->output()
#1 /app/Plugin/CakePdf/View/PdfView.php(100): CakePdf->output('..')
#2 /lib/Cake/Controller/Controller.php(957): PdfView->render(NULL, NULL)
#3 /lib/Cake/Routing/Dispatcher.php(193): Controller->render()
#4 /lib/Cake/Routing/Dispatcher.php(161): Dispatcher->_invoke(Object(RankingsController), Object(CakeRequest), Object(CakeResponse))
#5 /app/webroot/index.php(96): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#6 {main}
the web response from my script says
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261900 bytes) in /lib/Cake/Model/Model.php on line 2563
any idea?
For the 3.0 branch you say in the installation instructions to install as follows:
"require": {
"friendsofcake/CakePdf": "3.0.x-dev"
}
However the package doesn't exist? The only one I can see is @ceeram own package which now directs to the FriendsofCake GitHub page??
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.