React-to-print: print orientation

Created on 25 Apr 2020  路  5Comments  路  Source: gregnb/react-to-print

How do I set for portrait or landscape mode in default?

question

Most helpful comment

I found a way to force the orientation. Inside my refed component I added this block

<style type="text/css" media="print">{"\
   @page {\ size: landscape;\ }\
"}</style>

All 5 comments

I don't believe there is a way to do that. The settings in the print preview dialog are determined by your browser, and there is no standard way that I know of to set them across all browsers. If you know of such a mechanism please let me know!

@manfye Did you resolve this problem?

I found a way to force the orientation. Inside my refed component I added this block

<style type="text/css" media="print">{"\
   @page {\ size: landscape;\ }\
"}</style>

Thanks for posting that @bashleigh!

No problem!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

avniraiyani picture avniraiyani  路  3Comments

404sand808s picture 404sand808s  路  7Comments

quadh picture quadh  路  5Comments

hoangdoan267 picture hoangdoan267  路  8Comments

abdurrehman1998 picture abdurrehman1998  路  8Comments