Welcome Guest Search | Active Topics | Sign In | Register

Next Page Link Action Options
Exameron
Posted: Thursday, November 2, 2017 7:47:34 PM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2012
Posts: 55
I know how to create ahref anchor links within the html to link within the pdf. Is there a way also to have a link that when clicked just moves to the next page? (The functionality exists within most PDF viewers, but I'd like to have it connected to a link within the content itself.

I can't find anything in the documentation that talks about this.

Thanks.
eo_support
Posted: Friday, November 3, 2017 7:59:39 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

There are no built in support for this. If you control paging yourself, you can easily use a anchor to achieve that. If you do not control paging yourself, then you will need to write code to do so and the complexity of the code would depend on the complexity of your situation. For example, if you just want to add a "next page" link at a fixed location of each page that points to the next page, then it's relatively easy to do with AcmLink element. If you are not familiar with the ACM interface, you can take a look of here:

https://www.essentialobjects.com/doc/pdf/acm/overview.aspx

Thanks!
Exameron
Posted: Sunday, November 5, 2017 6:07:15 PM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2012
Posts: 55
Yes, all I want to do is create a "next page" link. I have a basic understanding of the ACM Interace. Is there a way of creating the link to the next page with something like CurrentPage.Index +1 ?

And set the AcmLink target to that?

Thanks!
eo_support
Posted: Monday, November 6, 2017 2:17:14 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

That's not exactly how it works. Here are the basic steps:

1. Render your main contents with HTML to PDF. This will give you a PdfDocument object;
2. Build an ACM content tree with the following structure:

Code:
AcmContent <--- root content
    AcmLink            <--- link on the first page
    AcmPageBreak       <--- force a page break
    AcmLink            <--- link on the second page
    AcmPageBreak       <--- force a page break
    ......
    AcmLink            <--- link on the second last page
    AcmPageBreak       <--- force a page break
    AcmContent         <--- dummy content on the last page

3. Set each AcmLink's TargetContent to the next AcmLink, except for the last one. Since the last page does not need a link, you would replace it with a dummy AcmContent that does not generate any visible output;

4. Create an AcmRender passing the existing PdfDocument as output document;

5. Call the AcmRender's Render method to render the above content tree;

Once you get the basic working, you can then look into page/formatting options as to where to position the link as well as styles (font, color, etc) for the link.

Hope this get you started. Please feel free to let us know if you still have any questions

Thanks!


Exameron
Posted: Monday, November 6, 2017 5:11:46 PM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2012
Posts: 55
Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.