Welcome Guest Search | Active Topics | Sign In | Register

Links in pdf (table of contents) Options
user1111
Posted: Friday, July 6, 2012 6:14:23 AM
Rank: Newbie
Groups: Member

Joined: 6/27/2012
Posts: 5
Hello,

How can i add links into my pdf? I want to make a table of contents on my first page of the pdf and from this page to navigate to other pages of the same pdf.

Thank you!
eo_support
Posted: Friday, July 6, 2012 9:50:58 AM
Rank: Administration
Groups: Administration

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

You just use <a> element in your HTML. They will be automatically converted to PDF links. When you create table of contents, you may need to run the conversion twice ---- the first time to get the page numbers of each table of contents entry. You will then reformat your HTML to "fill in" the page numbers and run the conversion again.

The get the page number, you will need to use the HtmlToPdfResult object returned from your ConvertUrl/ConvertHtml call, then call one of the GetElementByXXX function to get a reference of the target element in your HTML, then use the Location property of the returned HtmlElement object to get the page location (page index and location within the page).

Thanks!
user1111
Posted: Monday, July 9, 2012 4:22:49 AM
Rank: Newbie
Groups: Member

Joined: 6/27/2012
Posts: 5
After the ideea with <a> i am trying to do this:
on my first page i put a link like this : <a href='#A'>Go to A</a>
and in the page i want to convert into a pdf a link like this : <a name='A'>I'm here</a>

but it doesn't work.


Here is how i use EO.Pdf:
EO.Pdf.HtmlToPdf.ConvertHtml("<a href='#tips'>Visit the Useful Tips Section</a>", doc);
EO.Pdf.HtmlToPdf.ConvertUrl(".....distribution_policy.aspx?ProfileId=" + Session["IdProfile"], doc);

In the page distribution_policy i have a link like <a name='A'>I'm here</a>.
What i am doing wrong?


Do you have any tips?

Thank you!
eo_support
Posted: Monday, July 9, 2012 9:47:47 AM
Rank: Administration
Groups: Administration

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

Automatic link conversion only works with a single conversion. It won't work between conversions.

Thanks!
user1111
Posted: Monday, July 9, 2012 1:59:41 PM
Rank: Newbie
Groups: Member

Joined: 6/27/2012
Posts: 5
I understand.

In my project i need to do the following:
- to make a pdf that contains more .aspx distinct pages
- after this conversion is done i want to have on the first page a table of contents.
From what you written this thing isn't possible automatically.

I tried the automatic conversion of links that you suggested, but even in the same page it doesn't work( i'm sure that i'm doing something wrong). If i have a link at the begining of the page that should link me to the end of the same page it opens the browser and redirect me to the end of the .aspx page.
What i want is to 'stay' in the pdf document. How can i do that? Can you provide me a sample code? Or redirect me to an example?

If i know to do that then i can combine all my aspx page into one.
My problem is that i don't know how to remain in the pdf document.


I hope I was specific enough :)
Thanks!
eo_support
Posted: Monday, July 9, 2012 2:15:02 PM
Rank: Administration
Groups: Administration

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

Link conversion is automatic within the same document and you should not need to do anything special to keep them inside the same document. You can verify this by running our demo application, then go to All Demos -> Html to PDF -> Basic -> Auto Paging sample. That sample converts a wikipedia page that contains a lot of internal links. If you see it behaves differently, please try to create a test project demonstrating the problem and send the test project to us. We will be happy to look further once we have that. Let us know once you have such a project so that we can give you the email address.

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.