There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-5c45541f-7207-419b-b30e-1cd2a93f5172 XWIKI-17105 Open

Export as PDF in landscape mode

 
View issue   ·   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-1f4995fd-19fa-4a55-b3f0-627ac6d23ae3 Raphaël Jakse on 23/May/24 12:21
 
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
, and you may have to adjust the size and positioning of the block ):

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

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

In HTML:

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

In XWiki syntax:

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

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.