Print button orientation = landscape
Print button orientation = landscape
jvcunha
Posts: 81Questions: 10Answers: 1
Hi,
always portrait print? landascape not working in print button?
buttons: [
{
extend: 'print',
text: '<img src="images/printer24x24.png" alt="">',
titleAttr: 'Imprimir',
columns: ':not(.select-checkbox)',
orientation: 'landscape'
}
]
Replies
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page, if you can't provide a link to your own page can be found here.
Thanks,
Allan
Send link in PM, thanks
Hi, you can have a landscape orientation by adding this :
Hope this is why you want and it may help !
Hi zayders, thanks for solution. Its perfect !
Very clever - thanks for posting that!
Allan
So, is this the solution, or is this supposed to be fixed in the code for the print button? PDF works with the normal setting, but Print is still broke with the latest code I just got.
Yes - this is the solution. The Print button doesn't offer a landscape option.
Allan
Thank you for this Solution. Unfortunately this solution not working in IE11.
Just curious has a solution been created since your post? Also, I'm new at all this and I was wondering how do I add in the other buttons for excel, copy, csv, and pdf? And is their anything more to add for pdfs since their is no Landscape layout option either?
All the Buttons docs can be found here which will explain how to install and use the other button types you listed:
https://datatables.net/extensions/buttons/
This example shows how to use landscape with PDFs.
Kevin
The solution from @zayders works for me too. Unfortunately until now it looks like we don't have a simple key/value pair solution to define landscape for "print" button option.
You can use the
orientation
for defininglandscape
orportrait
, as shown in the firm code snippet,Colin