Replies: 3 comments 10 replies
-
That is nice. I think I'll put it into the documentation (I need to add some comments for me first). One small remark. The speedata Publisher has a crappy, a bit too tolerant XML parser. I have edited the code because |
Beta Was this translation helpful? Give feedback.
-
I took too much for granted, since there is no way to get the total number of pages from a PDF in a filter. |
Beta Was this translation helpful? Give feedback.
-
I came across Speedata Publisher and this thread searching for a way to print A4 booklets with a bleedless spine cover. <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<SetGrid height="1pt" width="1pt"/>
<Pagetype name="full" width="420mm" height="297mm" test="true()">
<Margin left="0mm" right="0mm" top="0mm" bottom="0mm"/>
</Pagetype>
<SetVariable variable="cover" select="'cover.pdf'" />
<SetVariable variable="pdfdoc" select="'content.pdf'"/>
<SetVariable variable="numpages" select="floor(sd:number-of-pages($pdfdoc) div 4) * 2"/>
<Record element="data">
<PlaceObject row="0pt" column="0pt">
<Image file="{$cover}" width="420mm"/>
</PlaceObject>
<ClearPage openon="right"/>
<Loop select="$numpages" variable="runpage">
<SetVariable variable="shift" select="floor($runpage div 3)"/>
<SetVariable variable="leftpage" select="sd:alternating('left', {($numpages*2)-$runpage+1}, {$runpage})"/>
<SetVariable variable="rightpage" select="sd:alternating('right', {$runpage}, {($numpages*2)-$runpage+1})"/>
<PlaceObject column="{$shift}pt" row="0pt">
<Image file="{$pdfdoc}" width="210mm" height="297mm" clip="yes" page="{$leftpage}"/>
</PlaceObject>
<PlaceObject column="{(sd:tounit('pt','210mm')-$shift)}pt" row="0pt">
<Image file="{$pdfdoc}" width="210mm" height="297mm" clip="yes" page="{$rightpage}"/>
</PlaceObject>
<ClearPage/>
</Loop>
</Record>
</Layout> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@pgundlach,
I think this would be a way of using Publisher to generate booklets:
It would be also useful to be able to remove pages and to add single blank pages after and before any pages.
With a filter, it would be easy to create a table with the right page order, but I don't know how to pass the table to the layout and how to loop the page order.
I have just discovered that
<ForAll>
is my friend here (after converting the table to a data source).This is just a comment. It might make a good recipe for the documentation.
Beta Was this translation helpful? Give feedback.
All reactions