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
bootstrap not working #66
Comments
Are you sure that Yii includes layout on Does
produce an entire HTML including layout or only the view portion? |
hi,
|
Judging by some simple try/error testing, there are problems with bootstrap coming from pseudo device-width of the document, print media styles and page margins.
I will close this issue now with resolution "bootstrap not supported out-of-the-box". You could use some custom style to make the columns fit when exporting to PDF. Given some enthusiasm, maybe the community will be able to look into this sometime in the future. |
Bootstrap is external to the default styles for fpdf, which is why classes bootstrap your pdf not work, if you want to customize the look of your pdf need to use a piece of own stylesheets, add after creating your mpdf and use your classes stylesheets. In short bootstrap not work to generate PDF with mpdf. public function actionPrint_death_certificate1() |
Any update on this issue? Bootstrap grid still not supported on mpdf? I am having the same problem and I really don't want to create a different template just for printing with mpdf, no way to replace all the col-xs-* bootstrap grid with tables. |
Any update on this issue? Bootstrap grid still not supported on mpdf? |
No, bootstrap grid is still not supported and nobody is working on the support. |
Same issue, no clear solutions... maybe with custom stylesheet |
I think i found a workaround First we Override the bootstrap css (i use a 10px top-margin for the row but this is not necessary) :
a then we set the columns like this
|
This works for me
|
For the most part that helped, not all of my Bootstrap styled HTML is being displayed in the Bootstrap styled grid. |
Reading this, it looks like that an alternative css style for export as pdf is the way to improve the situation. If you can come up with some general recommendations for Bootstrap, I think it is worth a help page at https://mpdf.github.io/ |
@synnoc IMHO |
This comment has been minimized.
This comment has been minimized.
This actually worked |
I figured out that the issue is caused by the printing styles of bootstrap. Specifically the following line:
When i add this to my stylesheet the PDF renders fine.
Hope it helps somebody. Cheers :) |
Fast Forward 2022, and the problem is now even worse. Tried everything mentioned here on a stylesheet of Bootstrap v3.3.4 and none of them worked. I think I am gonna have to switch to another service to make my pdfs. |
which one would that be - dompdf? |
@pfpro It is right in the readme https://github.com/mpdf/mpdf#about-css-support-and-development-state |
hi,
i am using mpdf in yii2. This is my controller code
my view
now i get a pdf with heading1 and heading2 in two different lines. Bootstrap is not working. Am i missing something?
when i tried this one it is working and heading1 and heading2 is coming in one line. In pdf it is not working
The text was updated successfully, but these errors were encountered: