Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate PDF from HTML with CSS bootstrap classes [duplicate]

I have a table with classes bootstrap3 css and I want to generate a PDF from this table...

What is the best way to do this?

I need that keep my style css My table:

        <table id="tabelaVisitaSickbay" class="table table-striped table-hover table-bordered">
            <tbody>
            <tr>
                <th colspan="2">Visits to the SickBay</th>
            </tr>
            <tr>
                <td>Botafogo Pre-Nursery and Nursery</td>
                <td id="visitaBotaPrenurseryAndNursery" class="atendimentoVisitSickBay"></td>                   
            </tr>
        </tbody>

Thanks for help & pointers in advance.

like image 560
felipe muner Avatar asked Dec 18 '15 12:12

felipe muner


People also ask

How do I embed a PDF in Bootstrap?

This is a simple example using <object> to embed a PDF file into an HTML page, but the PDF display window does not match the viewport of the browser. And here's the Bootstrap solution: Wrap <iframe>/<object>/.. by <div class="embed-responsive embed-responsive-*by*">. Of which: (*) is a number.

Can you combine Bootstrap with CSS?

Yes. You will want to put your additions in a separate file and link it below the bootstrap. css link. Then you can add your own classes and/or overwrite the Bootstrap classes in your own file.


1 Answers

You can try something like this:

http://codecanyon.net/item/awesome-conversion-script/6462891

or

http://www.sitepoint.com/convert-html-to-pdf-with-dompdf/

like image 133
CodePull Avatar answered Oct 26 '22 19:10

CodePull