1 reply [Last post]
chrscote
chrscote's picture
Offline
newbie
Last seen: 2 years 16 weeks ago
Timezone: GMT-4
Joined: 2016-07-16
Posts: 2
Points: 4

I have the following CSS code in my page:

<style>
	@media print {
		@page {
			size: 11in 17in landscape;
			margin: 1in 1in 1in 1in;
		}
		body * {
			visibility: hidden;
		}
		#content * {
			visibility: visible;
		}
		#content {
			position: absolute;
			left: 0;
			top: 0;
		}
	}
</style>

However, when I print, either to PDF or to the printer, the page prints in portrait on normal 8.5x11 paper instead of the 11x17 landscape that I want. This CSS is at the very end of all other CSS, so nothing else is overwriting any of these items. Am I doing something wrong?

Chris

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 5 hours 56 sec ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9742
Points: 3821

print format

This is a user decision. See print preview and notice the portrait/landscape choice.

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.