|
Rank: Newbie Groups: Member
Joined: 4/11/2013 Posts: 9
|
I am creating an application manual by pulling together web content off our website and creating page objects. I am first creating the main document containing technical pages (including bookmarks) by iterating through collection of pages and using convertHtml and adding to pdf doc instance for each page, then I want to loop through same collection of pages to create a TOC document to jump to any page, then merge the two documents. Is there a way to utilize the bookmark object for this, or can you suggest a better method? I have tried an <a> html element but confused on how this will work; the application manual will be downloaded and be standalone. Any help would be greatly appreciated.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
You can have the converter to automatically creates bookmarks for you based on H elements but that does not necessary have anything to do with TOC. The best way to have TOC to work is to convert everything inside the same document with A elements. If your TOC does not contain page number, then all you need to do is to format your TOC to contain A elements that points to the target location. If your TOC contains page number, then it's more complicated because you would not know the exact page numbers until the conversion is done. In that case you will need to perform two conversions ---- the first conversion is only used to find out the exact page number of a target location. Once you have that information, you will need to reformat the TOC with the actual page number, then you can run the converter again.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/11/2013 Posts: 9
|
Thanks for the quick response. However when I use an A element and click on the link in my TOC in my saved PDF file, a new pdf is launched and does not take me to the proper page in the pdf. ex. TOC link <a href="#testArea" target="_self"></a>, target <a id="testArea">testArea</a>. TOC and manual contents are in the same pdf doc.
|
|
Rank: Newbie Groups: Member
Joined: 4/11/2013 Posts: 9
|
Thanks for the quick response. However when I use an A element and click on the link in my TOC in my saved PDF file, a new pdf is launched and does not take me to the proper page in the pdf. ex. TOC link <a href="#testArea" target="_self"></a>, target <a id="testArea">testArea</a>. TOC and manual contents are in the same pdf doc.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi, Try to use "name" attribute instead of "id" attribute. For example:
Code: HTML/ASPX
<a href="#testArea">go to test area</a>
<a name="testArea"></a>
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/11/2013 Posts: 9
|
Just to be clear, the pdf will be downloaded and standalone not viewed in a browser. The code above code appears only to open a browser when clicking on a item in the TOC and still does not navigate to the proper page, opens to the top of the document in a browser. I would like a item in the TOC to work as a bookmark would, if an item is selected, the pdf would navigate to the proper page all within the generated pdf. Sorry I am asking so many questions... Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
That what the above code should do. Try to paste the above code into our demo app, then run it through Demos -> Basic -> Convert HTML, it will create a PDF file with a simple link. Click that link navigate to the target location in the PDF file. It has nothing to do with browser or anything else. Everything is inside the same PDF file.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/11/2013 Posts: 9
|
Ok, narrowed down the problem, demo works great but when I convert using my app I noticed a "W" over the hand tool when hovering over any link(link will open in browser). Not sure if this is an option to change before the conversion, or a setting in PDF reader? Thanks for your help.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
You will want to compare your code with the source code of the sample project. If it is a link inside the same document, it should not open it in another document. If the problem still occurs, you can try to isolate the problem into a test project and send the test project to us. We will be very happy to take a look and see what we can find. Please let us know if you have the test project and we will PM you as to where to send it.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/11/2013 Posts: 9
|
Thanks, links where in a different document, problem resolved. Thanks for your help!
|
|