ngx-print
ngx-print copied to clipboard
Is there any possibility to set the orientation to landscape?
Is there any possibility to set the orientation to landscape? It would be good, if there would be a possibility to set the orientation. Maybe via parameter but it is up on you.
Is there any way to do it with a workaround right now? Maybe some css @page @media?
Kind regards, Manuel
I had the same request, but solved for me with the following.
- When I do not apply css using [useExistingCss]="true", the Layout dropdown option (portrait or landscape) is present when trying to print.
- My css contains a @media print{@page {size: landscape}} line, but it seems to be ignored by ngx-print.
- If I use {size: landscape !important}, it will print in landscape. 4. If I use {size: auto !important}, the Layout option is provided.
For 1 and 2 above, the print screen will briefly flash a screen including the Layout option, but it is removed within a second. This behavior occurs in both Chrome and Edge.
Chrome Version 99.0.4844.82 (Official Build) (64-bit)
Microsoft Edge Version 99.0.1150.46 (Official build) (64-bit)
Hey 👋 To do this I combined the two options in this way:
[printStyle]="{ '@page': { size: 'landscape !important' } }"
[useExistingCss]="true"