snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.01k stars 3.17k forks source link

[Feature Request] Generate PDF in Landscape Orientation and Column Width Issues #10025

Open GlasierXplor opened 3 years ago

GlasierXplor commented 3 years ago

Server:

Is your feature request related to a problem? Please describe. When exporting Assets to a PDF, the generated PDF will always be in portrait, and all columns in fixed width (distributed evenly). All overflown text will be simply cut off. Especially when generating asset reports, some columns will have important information cut off.

Describe the solution you'd like While I think a lot can live with the fixed column widths, I think it will be really helpful if all PDF report generation will have it automatically in the landscape orientation, so that most (if not all) columns and their contents will be displayed in the output.

On a lower priority in my opinion, the columns could be set to auto-fit (between a minimum width and a maximum width value?). At the same time if possible, have text wrap over multiple rows in case the maximum width value has been reached.

Describe alternatives you've considered Alternatively, (through some searching) I think SnipeIT has some templates that the PDF export relies on? But I cannot find conclusive documentation/posts/issues regarding customising the PDF, or I could self-edit the PDF export function call (which I am hesitant to do so lest I break stuff).

welcome[bot] commented 3 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

snipe commented 3 years ago

IIRC, that's handled via the bootstrap-tables JS export plugin. I'm not sure there's much we can do to configure that, but I'll look into it

GlasierXplor commented 3 years ago

Hi thanks for the information. I have clawed through the docs for the plugin you stated. The github page has the following example, which uses jsPDF as the backend, accepts orientation and auto-tables as parameters. Hopefully this helps (though I do understand it may not be an open-and-shut thing).

https://github.com/hhurz/tableExport.jquery.plugin

// PDF export using jsPDF only

$('#tableID').tableExport({type:'pdf',
                           jspdf: {orientation: 'p',
                                   margins: {left:20, top:10},
                                   autotable: false}
                          });
GitHub
GitHub - hhurz/tableExport.jquery.plugin: jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF
jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF - GitHub - hhurz/tableExport.jquery.plugin: jQuery plugin to export a html table to JSON, XML, CSV, T...