Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External css is not working for Tcpdf engine #65

Closed
cttech opened this issue Jul 19, 2014 · 3 comments
Closed

External css is not working for Tcpdf engine #65

cttech opened this issue Jul 19, 2014 · 3 comments

Comments

@cttech
Copy link

cttech commented Jul 19, 2014

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!!

@ceeram
Copy link
Member

ceeram commented Jul 19, 2014

IIRC external css is ont supported by tcpdf.

2014-07-19 11:55 GMT+02:00 cttech notifications@github.com:

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!!


Reply to this email directly or view it on GitHub
#65.

@cttech
Copy link
Author

cttech commented Jul 19, 2014

If I use Mpdf then I get the following warning and pdf is not generated..

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: DIV [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14242]
Notice (8): Undefined index: CLASS>>MAIN-CONTENT [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14245]
Notice (8): Undefined index: ID>>MAIN-CONTENT [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14280]
Notice (8): Undefined index: DIV>>CLASS>>MAIN-CONTENT [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14284]
Notice (8): Undefined index: DIV>>ID>>MAIN-CONTENT [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14288]
Notice (8): Undefined index: DIV [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14242]
..................................................................................................................................................
..................................................................................................................................................

One the other hand if I use DomPdf then css is not working as like Tcpdf.

@ceeram
Copy link
Member

ceeram commented Jul 19, 2014

Hence the advised engine is wkhtlm2pdf, although other engines should work
with the mentioned limitation of external css
Op 19 jul. 2014 17:09 schreef "cttech" notifications@github.com:

If I use Mpdf then I get the following warning and pdf is not generated..

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: DIV [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php,
line 14242]
Notice (8): Undefined index: CLASS>>MAIN-CONTENT
[APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14245]
Notice (8): Undefined index: ID>>MAIN-CONTENT
[APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14280]
Notice (8): Undefined index: DIV>>CLASS>>MAIN-CONTENT
[APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14284]
Notice (8): Undefined index: DIV>>ID>>MAIN-CONTENT
[APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php, line 14288]
Notice (8): Undefined index: DIV [APP\Plugin\CakePdf\Vendor\mpdf\mpdf.php,
line 14242]

..................................................................................................................................................

..................................................................................................................................................

One the other hand if I use DomPdf then css is not working as like Tcpdf.
I am not sure how can I generate proper pdf...


Reply to this email directly or view it on GitHub
#65 (comment).

@ADmad ADmad closed this as completed Mar 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants