Mpdf icon indicating copy to clipboard operation
Mpdf copied to clipboard

image doesn't work fine, and external files too

Open elbasri opened this issue 11 years ago • 9 comments

hey segy, firstly, thanks a lot for this beauty work :) i test it on my localhost (using xampp) and work great :) but isnt in the webserver, i test the mpdf directly on my webspace and work fine, but your plugin (in cakephp) doesnt ! this is the issues: -css files doesnt work, until change the including methode from : Html->css('screen.css');?> to and i dont know why !!!! -images doesnt work too until change from the helper methode html->image('img/images/image.jpg') ?> to !! and doesnt work too when add "/" like: all those problems happen whene i use the plugin on the webserver,but in my local server (on my pc) all is work fine ! im trying many methodes and diffirents versions of mpdf (the recent version too 6) without any new !

hope that you have any idea thanks :)

elbasri avatar Feb 28 '15 19:02 elbasri

Hi devnasser

Try this in the view of your pdf file.

webroot."img/cake.icon.png"; ?>

ghost avatar Jul 17 '15 19:07 ghost

Hey, thanks for reply... its work fine :) good day

2015-07-17 20:03 UTC+01:00, Juan09130424 [email protected]:

Hi devnasser Try this in the view of your pdf file.

webroot."img/cake.icon.png"; ?>

Reply to this email directly or view it on GitHub: https://github.com/segy/Mpdf/issues/10#issuecomment-122374321

elbasri avatar Jul 20 '15 07:07 elbasri

Hey im using the Mpdf but i facing some problems, please can you help me out. The view after creating the PDF its totally different that the original... The menu for example is being displayed when its suppose to not... Here i put my example... Thaks and i really aprreciate your help guys!!

Controller -> Users

public function add(){ // Code related to controller $this->Mpdf->init(); $this->Mpdf->setFilename('Factura.pdf'); $this->Mpdf->setOutput('I'); }

add.ctp //Code related to he view

layout="PDF"; ?>

layouts/PDF.ctp

fetch('content'); ?>

This is the original view

orignal

This is the one after rendered to pdf

rendered

Thanks guys!

HugoRojas avatar Sep 29 '16 16:09 HugoRojas

Hi The problem is because mpdf dont soport all css when display pdf. For example i think that you use navbar and i supouse that mpdf not support this style.

You can to use other mpdf plugin , like dompdf that support more style .

2016-09-29 11:05 GMT-05:00 HugoRojas [email protected]:

Hey im using the Mpdf but i facing some problems, please can you help me out. The view after creating the PDF its totally different that the original... The menu for example is being displayed when its suppose to not... Here i put my example... Thaks and i really aprreciate your help guys!!

Controller -> Users

public function add(){ // Code related to controller $this->Mpdf->init(); $this->Mpdf->setFilename('Factura.pdf'); $this->Mpdf->setOutput('I'); }

add.ctp //Code related to he view

layout="PDF"; ?>

layouts/PDF.ctp

fetch('content'); ?>

This is the original view

[image: orignal] https://cloud.githubusercontent.com/assets/10120792/18961981/867cea74-8634-11e6-953e-1ee138a3a8fe.PNG

This is the one after rendered to pdf

[image: rendered] https://cloud.githubusercontent.com/assets/10120792/18961993/92d70002-8634-11e6-9372-6ad81df73af0.PNG

Thanks guys!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250511398, or mute the thread https://github.com/notifications/unsubscribe-auth/AL-HkaIBiDoPvF_Ilvj2MLeT6P4Mtjb7ks5qu-G8gaJpZM4DnfTS .

ghost avatar Sep 29 '16 17:09 ghost

Thanks for the answer, i already using another plugin which uses dompdf and its working but i just have a confussion about the css files located in View/Layouts/pdf/default.ctp because i can't get to load the view as the original one.

Could you please help me to find out my issue, it won't take more than 10 minutes.

We can use Skype and share my screen in you want.

I really appreciate it man. Thank you so much

2016-09-29 12:47 GMT-05:00 Juan09130424 [email protected]:

Hi The problem is because mpdf dont soport all css when display pdf. For example i think that you use navbar and i supouse that mpdf not support this style.

You can to use other mpdf plugin , like dompdf that support more style .

2016-09-29 11:05 GMT-05:00 HugoRojas [email protected]:

Hey im using the Mpdf but i facing some problems, please can you help me out. The view after creating the PDF its totally different that the original... The menu for example is being displayed when its suppose to not... Here i put my example... Thaks and i really aprreciate your help guys!!

Controller -> Users

public function add(){ // Code related to controller $this->Mpdf->init(); $this->Mpdf->setFilename('Factura.pdf'); $this->Mpdf->setOutput('I'); }

add.ctp //Code related to he view

layout="PDF"; ?>

layouts/PDF.ctp

fetch('content'); ?>

This is the original view

[image: orignal] <https://cloud.githubusercontent.com/assets/10120792/18961981/867cea74- 8634-11e6-953e-1ee138a3a8fe.PNG>

This is the one after rendered to pdf

[image: rendered] <https://cloud.githubusercontent.com/assets/10120792/18961993/92d70002- 8634-11e6-9372-6ad81df73af0.PNG>

Thanks guys!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250511398, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL-HkaIBiDoPvF_ Ilvj2MLeT6P4Mtjb7ks5qu-G8gaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250540174, or mute the thread https://github.com/notifications/unsubscribe-auth/AJpuWNyCQAbekWqXSBYM3yswWPYMj2zQks5qu_mlgaJpZM4DnfTS .

HugoRojas avatar Sep 29 '16 17:09 HugoRojas

i cant to speak english very well . I am mexican. but is because pdf no support some css that you use.

2016-09-29 12:55 GMT-05:00 HugoRojas [email protected]:

Thanks for the answer, i already using another plugin which uses dompdf and its working but i just have a confussion about the css files located in View/Layouts/pdf/default.ctp because i can't get to load the view as the original one.

Could you please help me to find out my issue, it won't take more than 10 minutes.

We can use Skype and share my screen in you want.

I really appreciate it man. Thank you so much

2016-09-29 12:47 GMT-05:00 Juan09130424 [email protected]:

Hi The problem is because mpdf dont soport all css when display pdf. For example i think that you use navbar and i supouse that mpdf not support this style.

You can to use other mpdf plugin , like dompdf that support more style .

2016-09-29 11:05 GMT-05:00 HugoRojas [email protected]:

Hey im using the Mpdf but i facing some problems, please can you help me out. The view after creating the PDF its totally different that the original... The menu for example is being displayed when its suppose to not... Here i put my example... Thaks and i really aprreciate your help guys!!

Controller -> Users

public function add(){ // Code related to controller $this->Mpdf->init(); $this->Mpdf->setFilename('Factura.pdf'); $this->Mpdf->setOutput('I'); }

add.ctp //Code related to he view

layout="PDF"; ?>

layouts/PDF.ctp

fetch('content'); ?>

This is the original view

[image: orignal] <https://cloud.githubusercontent.com/assets/ 10120792/18961981/867cea74- 8634-11e6-953e-1ee138a3a8fe.PNG>

This is the one after rendered to pdf

[image: rendered] <https://cloud.githubusercontent.com/assets/ 10120792/18961993/92d70002- 8634-11e6-9372-6ad81df73af0.PNG>

Thanks guys!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250511398, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL-HkaIBiDoPvF_ Ilvj2MLeT6P4Mtjb7ks5qu-G8gaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250540174, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AJpuWNyCQAbekWqXSBYM3yswWPYMj2zQks5qu_mlgaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250542543, or mute the thread https://github.com/notifications/unsubscribe-auth/AL-HkdKAJmyG71CCoBttkPdCy-uXSktMks5qu_uvgaJpZM4DnfTS .

ghost avatar Sep 29 '16 18:09 ghost

Genial yo tambien hablo espanol, bueno agradeceria mucho tu ayuda ya cambie de motor ahora uso dompdf solo tengo una duda

2016-09-29 13:46 GMT-05:00 Juan09130424 [email protected]:

i cant to speak english very well . I am mexican. but is because pdf no support some css that you use.

2016-09-29 12:55 GMT-05:00 HugoRojas [email protected]:

Thanks for the answer, i already using another plugin which uses dompdf and its working but i just have a confussion about the css files located in View/Layouts/pdf/default.ctp because i can't get to load the view as the original one.

Could you please help me to find out my issue, it won't take more than 10 minutes.

We can use Skype and share my screen in you want.

I really appreciate it man. Thank you so much

2016-09-29 12:47 GMT-05:00 Juan09130424 [email protected]:

Hi The problem is because mpdf dont soport all css when display pdf. For example i think that you use navbar and i supouse that mpdf not support this style.

You can to use other mpdf plugin , like dompdf that support more style .

2016-09-29 11:05 GMT-05:00 HugoRojas [email protected]:

Hey im using the Mpdf but i facing some problems, please can you help me out. The view after creating the PDF its totally different that the original... The menu for example is being displayed when its suppose to not... Here i put my example... Thaks and i really aprreciate your help guys!!

Controller -> Users

public function add(){ // Code related to controller $this->Mpdf->init(); $this->Mpdf->setFilename('Factura.pdf'); $this->Mpdf->setOutput('I'); }

add.ctp //Code related to he view

layout="PDF"; ?>

layouts/PDF.ctp

fetch('content'); ?>

This is the original view

[image: orignal] <https://cloud.githubusercontent.com/assets/ 10120792/18961981/867cea74- 8634-11e6-953e-1ee138a3a8fe.PNG>

This is the one after rendered to pdf

[image: rendered] <https://cloud.githubusercontent.com/assets/ 10120792/18961993/92d70002- 8634-11e6-9372-6ad81df73af0.PNG>

Thanks guys!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250511398, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL-HkaIBiDoPvF_ Ilvj2MLeT6P4Mtjb7ks5qu-G8gaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250540174, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AJpuWNyCQAbekWqXSBYM3yswWPYMj2zQks5qu_mlgaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250542543, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL- HkdKAJmyG71CCoBttkPdCy-uXSktMks5qu_uvgaJpZM4DnfTS>

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250556268, or mute the thread https://github.com/notifications/unsubscribe-auth/AJpuWDg8YAx8_UUmPZf1XTqd44hILEa9ks5qvAeDgaJpZM4DnfTS .

HugoRojas avatar Sep 29 '16 18:09 HugoRojas

El problema de los renderizadores de pdf es que no soportan la mayoria de los estilos , por ejemplo no soportan bootstrap ni nada por el estilo , lo que e echo es un layout para los css y declarar todos los estilos en el head del layout y hacer los estilos con instruciones basicas. background border todo eso y poco a poco lo vas checando que renderize correctamente.

Lee esta documentacion https://mpdf.github.io/css-stylesheets/supported-css.html

https://github.com/dompdf/dompdf/wiki/CSSCompatibility

2016-09-29 13:52 GMT-05:00 HugoRojas [email protected]:

Genial yo tambien hablo espanol, bueno agradeceria mucho tu ayuda ya cambie de motor ahora uso dompdf solo tengo una duda

2016-09-29 13:46 GMT-05:00 Juan09130424 [email protected]:

i cant to speak english very well . I am mexican. but is because pdf no support some css that you use.

2016-09-29 12:55 GMT-05:00 HugoRojas [email protected]:

Thanks for the answer, i already using another plugin which uses dompdf and its working but i just have a confussion about the css files located in View/Layouts/pdf/default.ctp because i can't get to load the view as the original one.

Could you please help me to find out my issue, it won't take more than 10 minutes.

We can use Skype and share my screen in you want.

I really appreciate it man. Thank you so much

2016-09-29 12:47 GMT-05:00 Juan09130424 [email protected]:

Hi The problem is because mpdf dont soport all css when display pdf. For example i think that you use navbar and i supouse that mpdf not support this style.

You can to use other mpdf plugin , like dompdf that support more style .

2016-09-29 11:05 GMT-05:00 HugoRojas [email protected]:

Hey im using the Mpdf but i facing some problems, please can you help me out. The view after creating the PDF its totally different that the original... The menu for example is being displayed when its suppose to not... Here i put my example... Thaks and i really aprreciate your help guys!!

Controller -> Users

public function add(){ // Code related to controller $this->Mpdf->init(); $this->Mpdf->setFilename('Factura.pdf'); $this->Mpdf->setOutput('I'); }

add.ctp //Code related to he view

layout="PDF"; ?>

layouts/PDF.ctp

fetch('content'); ?>

This is the original view

[image: orignal] <https://cloud.githubusercontent.com/assets/ 10120792/18961981/867cea74- 8634-11e6-953e-1ee138a3a8fe.PNG>

This is the one after rendered to pdf

[image: rendered] <https://cloud.githubusercontent.com/assets/ 10120792/18961993/92d70002- 8634-11e6-9372-6ad81df73af0.PNG>

Thanks guys!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250511398, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL-HkaIBiDoPvF_ Ilvj2MLeT6P4Mtjb7ks5qu-G8gaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250540174, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AJpuWNyCQAbekWqXSBYM3yswWPYMj2zQks5qu_mlgaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250542543, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL- HkdKAJmyG71CCoBttkPdCy-uXSktMks5qu_uvgaJpZM4DnfTS>

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250556268, or mute the thread <https://github.com/notifications/unsubscribe-auth/AJpuWDg8YAx8_ UUmPZf1XTqd44hILEa9ks5qvAeDgaJpZM4DnfTS>

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250557949, or mute the thread https://github.com/notifications/unsubscribe-auth/AL-HkfBPpcFk7_xyjJMMw7cQS5adBGCkks5qvAkEgaJpZM4DnfTS .

ghost avatar Sep 29 '16 18:09 ghost

Si, lo voy a leer man... De hecho queria usar este

http://codepen.io/supah/pen/jqbMYG

y nada me explota, me sale esto

[image: Imágenes integradas 1]

2016-09-29 13:59 GMT-05:00 Juan09130424 [email protected]:

El problema de los renderizadores de pdf es que no soportan la mayoria de los estilos , por ejemplo no soportan bootstrap ni nada por el estilo , lo que e echo es un layout para los css y declarar todos los estilos en el head del layout y hacer los estilos con instruciones basicas. background border todo eso y poco a poco lo vas checando que renderize correctamente.

Lee esta documentacion https://mpdf.github.io/css-stylesheets/supported-css.html

https://github.com/dompdf/dompdf/wiki/CSSCompatibility

2016-09-29 13:52 GMT-05:00 HugoRojas [email protected]:

Genial yo tambien hablo espanol, bueno agradeceria mucho tu ayuda ya cambie de motor ahora uso dompdf solo tengo una duda

2016-09-29 13:46 GMT-05:00 Juan09130424 [email protected]:

i cant to speak english very well . I am mexican. but is because pdf no support some css that you use.

2016-09-29 12:55 GMT-05:00 HugoRojas [email protected]:

Thanks for the answer, i already using another plugin which uses dompdf and its working but i just have a confussion about the css files located in View/Layouts/pdf/default.ctp because i can't get to load the view as the original one.

Could you please help me to find out my issue, it won't take more than 10 minutes.

We can use Skype and share my screen in you want.

I really appreciate it man. Thank you so much

2016-09-29 12:47 GMT-05:00 Juan09130424 [email protected]:

Hi The problem is because mpdf dont soport all css when display pdf. For example i think that you use navbar and i supouse that mpdf not support this style.

You can to use other mpdf plugin , like dompdf that support more style .

2016-09-29 11:05 GMT-05:00 HugoRojas [email protected]:

Hey im using the Mpdf but i facing some problems, please can you help me out. The view after creating the PDF its totally different that the original... The menu for example is being displayed when its suppose to not... Here i put my example... Thaks and i really aprreciate your help guys!!

Controller -> Users

public function add(){ // Code related to controller $this->Mpdf->init(); $this->Mpdf->setFilename('Factura.pdf'); $this->Mpdf->setOutput('I'); }

add.ctp //Code related to he view

layout="PDF"; ?>

layouts/PDF.ctp

fetch('content'); ?>

This is the original view

[image: orignal] <https://cloud.githubusercontent.com/assets/ 10120792/18961981/867cea74- 8634-11e6-953e-1ee138a3a8fe.PNG>

This is the one after rendered to pdf

[image: rendered] <https://cloud.githubusercontent.com/assets/ 10120792/18961993/92d70002- 8634-11e6-9372-6ad81df73af0.PNG>

Thanks guys!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250511398, or mute the thread <https://github.com/notifications/unsubscribe- auth/AL-HkaIBiDoPvF_ Ilvj2MLeT6P4Mtjb7ks5qu-G8gaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250540174, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AJpuWNyCQAbekWqXSBYM3yswWPYMj2zQks5qu_mlgaJpZM4DnfTS> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250542543, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL- HkdKAJmyG71CCoBttkPdCy-uXSktMks5qu_uvgaJpZM4DnfTS>

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250556268, or mute the thread <https://github.com/notifications/unsubscribe-auth/AJpuWDg8YAx8_ UUmPZf1XTqd44hILEa9ks5qvAeDgaJpZM4DnfTS>

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250557949, or mute the thread <https://github.com/notifications/unsubscribe-auth/AL-HkfBPpcFk7_ xyjJMMw7cQS5adBGCkks5qvAkEgaJpZM4DnfTS>

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/segy/Mpdf/issues/10#issuecomment-250559661, or mute the thread https://github.com/notifications/unsubscribe-auth/AJpuWKTZoORNVpfFhufulWhNYpHPPnYsks5qvAqIgaJpZM4DnfTS .

HugoRojas avatar Sep 29 '16 19:09 HugoRojas