Forum How do I...?

Changing page orientation on the fly.

ddeyen
Is there a way in prince or in my XML that I can declare a particular page to landscape to show an image in its proper orientation. then go back into portrait?

so it would go like this.

portrait
portrait
portrait
landscape
portrait
portrait
landscape
etc.
mikeday
Named pages can achieve this:
@page bigpage {
    size: landscape
}
img.big { page: bigpage }

This will put images with a class of "big" on landscape pages.
ddeyen
that worked great i can switch the orientation on the fly however the images dont appear to be scaling to fit the page. is there some trick to that?
mikeday
Try setting the image width to 100%.
ddeyen
mikeday wrote:
Try setting the image width to 100%.


That did not work. Any other ideas?
mikeday
Try adding a border on the image and on its containing block to see exactly what space they are taking up. It's possible that the block the image is in doesn't take up the whole page width, so you'll need to make that block 100% and then the image 100% within it.