Closed pr-apes closed 1 year ago
Your second layout is invalid XML.
I get the following output (1st page)
1.4142851389653 0.70707099470169 1.4142851389653 0.70707099470169 1.4142851389653 0.70707099470169 1.4142851389653 0.70707099470169 1.4142851389653 0.70707099470169 1.4142851389653 0.70707099470169
Which looks correct?
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<SetVariable variable="pdfdoc" select="'out.pdf'"></SetVariable>
<Record element="data">
<PlaceObject>
<Textblock>
<Loop select="sd:number-of-pages($pdfdoc)" variable="runpage">
<Paragraph>
<Value select="sd:aspectratio(concat($pdfdoc, ':', $runpage, ':mediabox'))" />
</Paragraph>
</Loop>
</Textblock>
</PlaceObject>
<ClearPage />
<Loop select="sd:number-of-pages($pdfdoc)" variable="runpage">
<PlaceObject column="105mm" row="148.5mm" hreference="center" vreference="middle">
<Image file="{$pdfdoc}" page="{$runpage}"
rotate="{if (not(sd:aspectratio(concat($pdfdoc, ':', $runpage ':mediabox')) > 1)) then '0' else if (sd:odd($runpage)) then '-90' else '90'}" />
</PlaceObject>
<ClearPage />
</Loop>
</Record>
</Layout>
Many thanks for spotting the error, @pgundlach.
The issue was trickier: I wrote sd:aspectratio(concat($pdfdoc, ':', $runpage ':mediabox'))
, which should read sd:aspectratio(concat($pdfdoc, ':', $runpage, ':mediabox'))
.
It was missing a comma in concat()
. This fixes the sample. I have to look further, since the actual document is still not working fine.
@pgundlach,
I have the following layout for a source file:
The output is processed with the following layout:
I'm afraid that the main conditional for the rotation doesn't work when the page is portrait. It handles all pages as landscape.
I'm afraid this might be a bug in Publisher (and I would say this worked fine before). Could you check this?
Many thanks for your help.