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
|
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!
|
Rank: Newbie Groups: Member
Joined: 12/21/2011 Posts: 8
|
Thank so much for your quick reply. It is very helpful :-)
|