Landscape page formatting in pdf Chemistry

dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Landscape page formatting in pdf Chemistry

Post by dbutch » Fri Dec 13, 2019 6:35 am

I have a couple of issues with the formatting on landscape pages. I have set wide tables with an outputclass = 'wide' and likewise applied the same to some figures. Using the following CSS, the pages are set to landscape:

Code: Select all

*[outputclass = 'wide'] {
    page: wide-page;
}
*[orient = 'land'] {
    page: wide-page;
}
@page wide-page{
    size: A4 landscape;
    margin-left: 1.5cm;
    margin-right: 1.5cm;
	page-break-after: avoid;
	page-break-before: avoid;
}
In cases that the wide table or figure is the only content of the section, the header for the section is at the top of the previous portrait page, with a blank page below it, and then the table or figure is on the next (landscape) page.
Is there a way in these situations to keep the section header with the figure or table on the landscape page? At present there is a lot of blank space showing in the document.

The second issue is with figures showing on landscape pages. For some reason the caption for the figure is showing on the next page, thus the figure is the only content on the landscape page. I have tried a few different approaches including:

Code: Select all

*[class ~= "topic/fig"] {
 page-break-inside:avoid;
 page-break-before:avoid;}
Is there any way to force the caption to stay with the figure?

As a side note on the above: when a table has an attribute orient = land, the landscape page headers behave differently to pages where outputclass = 'wide' is used, even though it has the same rule:

Code: Select all

*[orient = 'land'] {
    page: wide-page;
The header content is different from the rest of the document and is rotated down the right side of the page vertically - as if a portrait page has just been rotated 90 deg.

Thanks

Dan
Posts: 453
Joined: Mon Feb 03, 2003 10:56 am

Re: Landscape page formatting in pdf Chemistry

Post by Dan » Fri Dec 13, 2019 4:00 pm

Hello,

For landscape tables, please read this topic:
https://www.oxygenxml.com/doc/versions/ ... aid-title3

The other issues may be already fixed on the development stream. In case you want to test the fixes, please write us on support (support@oxygenxml.com) in order to receive access to the nightly build.

Many regards,
Dan

dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Re: Landscape page formatting in pdf Chemistry

Post by dbutch » Tue Dec 17, 2019 6:24 am

Hi Dan,

I've reviewed the topic you referenced but couldn't see a fix to avoid the blank space between the topic title and the table. Is that correct?
In some cases I may be able to set the entire topic to outputclass = 'wide' which may resolve the issue. I would then need to apply another rule to start that particular topic on a new page. Any recommendations for this?

I now understand the reason the @orient = 'land' page headers are behaving as they are: [PLUGIN_DIR]css/print/p-pages-and-headers.css. Please excuse my lack of knowledge on this but it should be straight forward to overrule shouldn't it? My attempts to define the landscape page headers don't appear to be working as expected:

Code: Select all

@page landscape-page, chapter:left:right {
	size: A4 landscape;
	
	    @top-left {
	        content: none
	    }
	    @top-center {
	        content: string(maptitle);
	    }
	    @top-right {
	        content: none
	    }	
	    @right-bottom {
	        content: none
	    }
	}
Thanks.

Dan
Posts: 453
Joined: Mon Feb 03, 2003 10:56 am

Re: Landscape page formatting in pdf Chemistry

Post by Dan » Wed Dec 18, 2019 12:01 pm

Hello,
I've reviewed the topic you referenced but couldn't see a fix to avoid the blank space between the topic title and the table.
Please send us a sample (PDF and .style.xml file from the output folder) to the support@oxygenxml.com email address. We will try to see the exact situation.

To override the content defined in the page rules from the plugins/com.oxygenxml.pdf.css/css/print/p-pages-and-headers.css, you need to just copy the selectors from that CSS and change the generated text.

Many regards,
Dan

dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Re: Landscape page formatting in pdf Chemistry

Post by dbutch » Mon Feb 03, 2020 5:07 am

Please send us a sample (PDF and .style.xml file from the output folder) to the support@oxygenxml.com email address. We will try to see the exact situation.
Hi Dan, I have finally sent the files over to the support address.

julien_lacour
Posts: 100
Joined: Wed Oct 16, 2019 3:47 pm

Re: Landscape page formatting in pdf Chemistry

Post by julien_lacour » Tue Feb 04, 2020 10:30 am

The outputclass solution works as expected:
Moving the outputclass onto either the <topic>, or the <figure> worked as desired. In each case it will depend on the content, so for some documents setting outputclass = wide on the figure, instead of the image, will work to keep the caption with the figure(image) instead of on the next page.
It's also possible to move the @outputclass on the containing paragraph or inside a div element.

Regards,
Julien

Post Reply