Welcome Guest Search | Active Topics | Sign In | Register

htmltopdf and ashx handler´s Options
Nuno Nogueira
Posted: Tuesday, November 8, 2011 12:17:41 PM
Rank: Member
Groups: Member

Joined: 2/24/2011
Posts: 25
Hello.

Is possible to set BaseUrl to a ASHX image handler instead of a physical directory ?

Any short example ?

I try to set baseurl to same folder of ASHX handler, but image do not show, eo.PDF works with ASHX´s ?

Thanks.
eo_support
Posted: Tuesday, November 8, 2011 12:30:31 PM
Rank: Administration
Groups: Administration

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

BaseUrl is a HTML concept, not an ASP.NET concept. So it has nothing to do your ASHX. Whatever you do as soon as it works in your browser it should work with EO.Pdf.

Thanks
Nuno Nogueira
Posted: Tuesday, November 8, 2011 12:40:09 PM
Rank: Member
Groups: Member

Joined: 2/24/2011
Posts: 25
Hello.

Thanks for reply.

The handler works fine with browser, but htmltopdf do not working with the same ASHX handler. I using this:

<img src="/generichandler.ashx?PictureID=1">

Its show in browser, but not on htmltopdf.ConvertHtml.

When i set:

<img src="/img/img1.jpg">

Its works in browser.

But when i use the same src in htmltopdf, i also need set the BaseUrl property to work with htmltopdf.

Thanks.


eo_support
Posted: Tuesday, November 8, 2011 12:52:45 PM
Rank: Administration
Groups: Administration

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

It will work as soon as your set your BaseUrl correctly. To figure out the correct BaseUrl, save your page output into a regular HTML file, place that file into a separate folder unrelated to its original location, then add <base> element into your HTML file's header section. Once you get that working, use the same BaseUrl for HTML to PDF and it will work.

Alternatively, you can use ASPXToPDF control. That control will automatically set BaseUrl for you. Make sure you update to the latest build for both EO.Web and EO.Pdf if you useASPXToPDF.

Thanks
Exameron
Posted: Monday, October 22, 2012 6:31:35 PM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2012
Posts: 55
I'm having the same issue - was this ever resolved?

It's definitely pulling the full url https://domain.com/logo.aspx

ideas? Thanks!
Exameron
Posted: Monday, October 22, 2012 7:49:44 PM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2012
Posts: 55
Disregard the last post - images via ashx work just fine. It was a security issue.


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.