Welcome Guest Search | Active Topics | Sign In | Register

Convert HTML to PDF: "Link" not worked correctly Options
Hung
Posted: Wednesday, December 21, 2011 5:47:59 AM
Rank: Newbie
Groups: Member

Joined: 12/21/2011
Posts: 8
Hi,

I'm evaluating your HTML to PDF components. Love the way it rendered image, selectable text, style. But I encounter a problem with "link". My test html is like below:

<script type="text/javascript" language="JavaScript">
function redirect(url, str)
{
window.location.href=url;
}
</script>
<div>
<a href="http://www.google.com">Click</a>
<a href="http://money.cnn.com/magazines/fortune/most-powerful-women/2011/snapshots/21.html">Click</a>

<a class="null" href="javascript:redirect('http://money.cnn.com/magazines/fortune/most-powerful-women/2011/snapshots/21.html', 'rightIframe')">Not worked!</a>


</div>


It render 3 "link" correctly in IE. But after convert to PDF, only 2 first links are "clickable". The last "Not worked!" was rendered as "text" instead of "link".

Do your "Convert HTML to PDF" support this kind of "link" ?

Hung
eo_support
Posted: Wednesday, December 21, 2011 8:56:38 AM
Rank: Administration
Groups: Administration

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

No HTML to PDF can support that kind of links. ; ) The reason is a PDF file does not have DHTML objects such as "window", thus as soon as it becomes PDF, "window.location.href" has no meaning. That's why PDF file can support direct links but not script links.

Our converter has a full JavaScript engine and it will run any JavaScript while loading the page (because those scripts may alter the page output). Once it finishes running those scripts, it takes a "snaptshot" of the page output and renders it as PDF. Once it becomes PDF, script will no longer work because all the underlying objects such as "window" in this case no longer exists.

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

Thanks!
Hung
Posted: Wednesday, December 21, 2011 10:37:57 PM
Rank: Newbie
Groups: Member

Joined: 12/21/2011
Posts: 8
Thank so much for your quick reply. It is very helpful :-)


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.