-
Hi @pgundlach, I am trying to integrate your Single Pass TOC example on my code but I lack the necessary skills to understand your abstraction... 🤦♂️ 1.
|
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 12 replies
-
<data>
<chapter title="The first chapter" paragraphs="13"/>
<chapter title="The second chapter" paragraphs="5"/>
<chapter title="The last chapter" paragraphs="3"/>
</data> So this is dummy data in the sense that it not meaningful, but actual data. It creates three marks (chapter1, chapter2, and chapter3). These are used in step 3 ( Third question:
Please keep on asking questions. |
Beta Was this translation helpful? Give feedback.
-
Hi @pgundlach I am still stuck here, I wonder if I can record at Thanks... 🙏 |
Beta Was this translation helpful? Give feedback.
-
In the example you mention in the first post, I add a page type: <Pagetype name="mypage" test="false()">
<PositioningArea name="text">
<PositioningFrame height="{sd:number-of-rows() - 2}" width="{sd:number-of-columns() }" column="1" row="1" />
</PositioningArea>
<AtPageCreation>
<PlaceObject column="2mm" row="2mm">
<Textblock>
<Paragraph>
<Value>Page type mypage</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</AtPageCreation>
</Pagetype> and right before the InsertPages, I switch to that page type:
Perhaps this works in your case as well. |
Beta Was this translation helpful? Give feedback.
-
Hi Patrick I am still struggling with this, and lack of time is making everything more complicated. So far it looks like what I am doing is correct, I am not sure if I am actually recording because what I need is on the <!-- SECTION OPENING -->
<Pagetype name="sectionstart" test="false()">
<Margin left="20mm" right="20mm" top="20mm" bottom="20mm" />
<AtPageCreation>
<PlaceObject allocate="yes" column="0mm" row="0mm">
<Image file="{$sectiontitleimage}" width="210mm" height="282mm" bleed="auto" />
</PlaceObject>
<PlaceObject row="12mm" column="77mm">
<Box height="42mm" width="56mm" graphic="agl-logo-bkg" />
</PlaceObject>
<PlaceObject row="12mm" column="77mm">
<Image width="46mm" file="assets/rdp.pdf" margin-top="5mm" margin-right="5mm" margin-bottom="5mm" margin-left="5mm" />
</PlaceObject>
<PlaceObject column="10mm" row="66mm">
<Textblock width="190mm" minheight="4mm">
<!-- MARK "SECTIONS"-->
<Action>
<Mark select="$secname"/>
</Action>
<Message select="concat('TOC: ', $secname)" />
<Paragraph color="darkaglgray" fontfamily="opensecnamebig" textformat="centered">
<Value select="$secname" />
</Paragraph>
<Paragraph color="white" fontfamily="opensecname" textformat="centered">
<Value select="$yr" />
<Value> Catalog</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</AtPageCreation>
</Pagetype> I can see the messages I put on Now I am going to create an box outside the page to see if I can recording the markers in another way... 🤔 I'll keep you posted! 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi Patrick, I decided to go one step at the time, and I am testing if I understood and capable to save a page and move this page at the very beginning. This is my current code: <Record element="catalog">
<ProcessNode select="section" />
<!-- SAVE PAGE TEST -->
<ClearPage pagetype="toc-page" />
<InsertPages name="toc" pages="1" />
<SavePages name="toc">
<PlaceObject column="1" row="10">
<Table padding="4pt">
<Columns>
<Column width="7cm" />
</Columns>
<Tr>
<Td>
<Paragraph fontfamily="subtitle">
<Value>FIRST PAGE</Value>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</SavePages>
<ClearPage />
</Record> In my code this Possible reasons:
Also I can't see in the Please let me know if you want inspect the code, thanks! 🙏 |
Beta Was this translation helpful? Give feedback.
-
I am unable to reproduce the problem since I don't have the data file, but your code looks okay to me. There is currently no logging information about SavePages/InsertPages. The following layout creates three pages 1: Some text In this special case it does not make sense to have InsertPages and SavePages next to each other, you could just add the contents here. See the example below where you create information (here an assignment to a variable, but usually to build a table of contents) after inserting the first page. <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Pagetype name="toc-page" test="false()">
<AtPageCreation>
<PlaceObject column="0mm" row="0mm">
<Textblock>
<Paragraph>
<Value>toc-page</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</AtPageCreation>
</Pagetype>
<Record element="data">
<!-- SAVE PAGE TEST -->
<PlaceObject>
<Textblock>
<Paragraph>
<Value>Some text</Value>
</Paragraph>
</Textblock>
</PlaceObject>
<SetVariable variable="greeting" select="'world'"></SetVariable>
<ClearPage pagetype="toc-page" />
<InsertPages name="toc" pages="1" />
<SavePages name="toc">
<PlaceObject column="1" row="10">
<Table padding="4pt">
<Columns>
<Column width="7cm" />
</Columns>
<Tr>
<Td>
<Paragraph fontfamily="text">
<Value select="concat('hello, ', $greeting)"></Value>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</SavePages>
<ClearPage />
<PlaceObject>
<Textblock>
<Paragraph>
<Value>more stuff</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record>
</Layout> <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Pagetype name="toc-page" test="false()">
<AtPageCreation>
<PlaceObject column="0mm" row="0mm">
<Textblock>
<Paragraph>
<Value>toc-page</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</AtPageCreation>
</Pagetype>
<Record element="data">
<!-- SAVE PAGE TEST -->
<ClearPage pagetype="toc-page" />
<InsertPages name="toc" pages="1" />
<PlaceObject>
<Textblock>
<Paragraph>
<Value>Some text</Value>
</Paragraph>
</Textblock>
</PlaceObject>
<SetVariable variable="greeting" select="'world'"></SetVariable>
<SavePages name="toc">
<PlaceObject column="1" row="10">
<Table padding="4pt">
<Columns>
<Column width="7cm" />
</Columns>
<Tr>
<Td>
<Paragraph fontfamily="text">
<Value select="concat('hello, ', $greeting)"></Value>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</SavePages>
<ClearPage />
<PlaceObject>
<Textblock>
<Paragraph>
<Value>more stuff</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record>
</Layout> Not sure if it becomes clearer. Can you reproduce the examples? I am still uncertain what you want to achieve. Do you want to create a table of contents or something similar? |
Beta Was this translation helpful? Give feedback.
-
Oh my gosh... 🤦♂️ It took me three weeks to understand that I was convinced that For three weeks you have been thinking that I was just a poor fool man... I am very, very sorry... 🤦♂️ I realized it when I was attempting to move the page on another position so I made:
On my little brain I was thinking: I generate the Please don't ban me from this place! 🙏 |
Beta Was this translation helpful? Give feedback.
-
Good news I am fully recovered from the trauma... 😅 And after thinking, working and testing, now I am able to put the TOC as first page (now I found the trick) and I was able to apply its own master. Next I am going to populate the TOC using the entries from the section master rather than processing the entries into a node, I haven't started it yet, but I believe I will find how to do it! Thank you very much Patrick for this amazing software and for your continuous help... 🙏 |
Beta Was this translation helpful? Give feedback.
-
Hi @pgundlach, I made the homework but my ability to abstract reached its limit, so now I have a code that does almost what I want the way I want, although still ugly, but I can't loop across the section name therefore it repeats always the last record: Here is the block: <!-- TOC -->
<Record element="catalog">
<ClearPage pagetype="toc-page" />
<InsertPages name="toc" pages="1" />
<SetVariable variable="greeting" select="'TOC'" />
<ProcessNode select="section" />
<SavePages name="toc">
<PlaceObject column="6cm" row="6cm">
<Table padding="4pt">
<Columns>
<Column width="7cm" />
</Columns>
<Tr>
<Td>
<Paragraph fontfamily="subtitle">
<Value select="concat('hello: ', $greeting)" />
</Paragraph>
</Td>
</Tr>
<ForAll select="section">
<Tr>
<Td>
<Paragraph fontfamily="subtitle">
<Value select="concat('Name: ', $secname), ' — ', {sd:pagenumber($secname)}" />
</Paragraph>
</Td>
</Tr>
</ForAll>
</Table>
</PlaceObject>
</SavePages>
<Message select="concat('Testing1:, ', $greeting)" />
<Message select="concat('Testing2:, ', $secname)" />
</record> What is the correct way to loop across the section name? Thanks... 🙏 |
Beta Was this translation helpful? Give feedback.
should work in the page type. (The focus is in the element
<section>
because of the ForAll, therefore you can access the attributes with@
.)