There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-7f836856-6464-488f-a330-eceec158bb5d XWIKI-17105 Open

Export as PDF in landscape mode

 
View issue   ·   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-d078a0c5-f9c0-4684-ba52-09fb98383b3d Raphaël Jakse on 23/May/24 11:41
 

In the meantime, as a workaround, content that should be in landscape mode can probably be 90° rotated using CSS in a media print declaration. This declaration can be put in the PDF template or elsewhere. You probably want to put page breaks around this content.

For instance (this is untested though):

@media print {
    .landscape-content {
        break-before: page;
        break-after: page;
        transform: rotate(90deg); /* or rotate: -90deg */
    }
}

And then you can put your content inside a div of class landscape-content:

In HTML:

<div class="landscape-content">
    <p>content to be rotated.</p>
</div>

In XWiki syntax:

(% class="landscape-content" %)
Content to be rotated
(%%)

The drawback is that the concerned pages will look rotated on screen, but most PDF viewers can rotate individual pages and even save the result.