Welcome Guest Search | Active Topics | Sign In | Register

EO.PDF html link not working Options
CNAS Support
Posted: Thursday, May 24, 2018 5:35:53 AM
Rank: Newbie
Groups: Member

Joined: 5/24/2018
Posts: 1
final obstacle before buying the product Think

in the html that I'm trying to convert to PDF, I have the following code:

<td width="3" valign="top" class="t10" align="left"><a target="Test.pdf" href="Test.pdf">Test.pdf</a></td>

but, when I open the PDF after converting, and try to click the link, the PDF is trying to open a filename called "%00" instead of "Test.pdf".

If I open the html file, I can click on the link and the PDF "Test.pdf" is opened.

What am I doing wrong?
eo_support
Posted: Thursday, May 24, 2018 9:39:51 AM
Rank: Administration
Groups: Administration

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

If you use HtmlToPdf.ConvertHtml, make sure you set HtmlToPdf.Options.BaseUrl.

BaseUrl is used to expand partial Url into full Url. For example, if you set BaseUrl to "c:/Temp", it will expand "Test.pdf" to "c:/Temp/Test.pdf". However the "c:/Temp" part will not stay in the final PDF since it is the same location as the document itself. So to resolve your problem, you can set HtmlToPdf.Options.BaseUrl to any value --- but it must have a value.

BaseUrl is important in other cases when the full Url matters. For example, if you have an image tag in your HTML:

Code: HTML/ASPX
<img src="Test.gif" />


In this case you MUST set BaseUrl to a proper value so that the converter will know where to find "Test.gif". For example, if you meant to render the Test.gif in your "c:/Temp" directory, then you must set BaseUrl to "c:/Temp". If you meant "http://somesite.com/Test.gif", then you must set BaseUrl to "http://somesite.com". Without BaseUrl information the converter won't be able to render the image properly. The same for any other kind of dependency resource such as script files and CSS files.

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

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.