Landscape Orientation When Download Table HTML to PDF Using TableHTMLExport Plugin

Aghnat Atqiya

I am trying to download PDF table HTML using TableHTMLExport plugin.

I can download all data in table with this code:

<table class="table downloadPDF" id="example">
        <thead>
            <tr>
                <th>Column 1</th>
                <th>Column 2</th>
                <th>Column 3</th>
                <th>Column 4</th>
                <th>Column 5</th>
                <th>Column 6</th>
                <th>Column 7</th>
                <th>Column 8</th>
                <th>Column 9</th>
                <th>Column 10</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Value 1</td>
                <td>Value 2</td>
                <td>Value 3</td>
                <td>Value 4</td>
                <td>Value 5</td>
                <td>Value 6</td>
                <td>Value 7</td>
                <td>Value 8</td>
                <td>Value 9</td>
                <td>Value 10</td>
            </tr>
        </tbody>
    </table>
    <button id="pdf" class="btn btn-danger">TO PDF</button>

<script>
    $('#pdf').on('click', function () {
      $(".downloadPDF").tableHTMLExport({type:'pdf', filename:'tst.pdf' });
    })
</script>

But I can't see all value of column in PDF result because my columns is to many and paper orientation is portrait. How to change paper orientation to landscape when download from HTML to PDF?

Aghnat Atqiya

I decide to change TableHTMLExport plugin with TableExport plugin. I think TableExport plugin is more powerfull and easy to use because it has many libraries. I also can print PDF with landscape orientation when use this plugin.

TableExport plugin: documentation TableExport, repository TableExport

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Download a div in a HTML page as pdf using javascript

How to add scrolling to the view when screen orientation is changed to landscape?

How to get a landscape orientation for only some pages while converting html to pdf in itext 7?

Preserve HTML font-size when iPhone orientation changes from portrait to landscape

Pdf in Landscape using pdfBox

Using UIImagePickerController in landscape orientation

UIWindow with wrong size when using landscape orientation

How to get landscape orientation when converting IPython notebook to PDF?

Hiding a view when orientation changes to landscape in autolayouts

Not able to set Landscape orientation in mPdf - niklasravnsborg/laravel-pdf

Fragment not using landscape layout when orientation is changed

Problems with landscape orientation when converting sheets in an Excel workbook to pdf files VBA

How to set a variable to false when ipad orientation is changed from landscape to portrait and vice versa using javascript and react?

Change orientation of landscape pages only in PDF

Xfinium: How to generate PDF with landscape orientation

Why some of the column in html table collapsing when rendered to pdf using xhtml2pdf in django?

HTML: How to download a pdf file using a link

Using a script to split PDF, but not working with landscape PDF

How to specify in razor pdf landscape orientation in .cshtml

Map behavior changes when changed to landscape orientation using fragments

Orientation landscape not working properly in landscape

HTML canvas breaking when keyboard is shown at landscape orientation

Different screen orientation on different devices when landscape mode

Create and download PDF using html2pdf with AngularJS

How to continue a landscape orientation for a particular div tag while converting html to pdf in itext 7?

Force Landscape when orientation is locked

UIDevice orientation returns portrait when device launches as landscape

Export html into pdf landscape mode

App force change orientation landscape to portrait when start purchase flow