Kugarek
Kugarek

Reputation: 69

How to insert page break in Aspose.PDF XSLT

I am writing XSLT to be used with XML in Aspose.PDF to generate the PDF, how do I insert the page break in the Aspose.PDF XSLT?

I have tried #$NP but it doesn't seem to be working, or my syntax is not correct.

<TextFragment>
    <TextSegment>#$NP</TextSegment>
</TextFragment>

I have also tried to split the document by having a multiple page tags.

 <Page>...</Page> 

But that also didn't seem to work, and Aspose was actually throwing an error when I tried that, so what would be the correct way?

I would like to be able to insert the page break after each section of the PDF. Also any links to some advanced Aspose.PDF XSLT examples will be appreciated.

Upvotes: 1

Views: 590

Answers (1)

For the old Aspose.PDF versions, please, try this way:

<Text>
   <Segment>
     <!--Page Breaker-->
     #$NP
   </Segment>
</Text>

For the latest Aspose.PDF versions, please, try this way:

<Page>
   <TextFragment>
      <TextSegment>
         First page.
      </TextSegment>
   </TextFragment>
</Page>
<Page>
   <TextFragment>
      <TextSegment>
         Second page.
      </TextSegment>
   </TextFragment>
</Page>

Hope it helps. Otherwise, feel free to ask me.

Note: I am working as Developer Evangelist at Aspose.

Upvotes: 2

Related Questions