ASP.NET - problem executing on the server - Asked By Paddy Mac on 21-Jan-10 05:38 PM

Hi,

I'm trying to create PDF's on the fly using a 3rd-party product 'PDFVision'.  My problem is that it runs perfectly well on my laptop, but on the server the JavaScript is not executed ... I think.

Basically the 3rd Party tool converts a url to a PDF and saves the file. This is the code:

 Dim p As New SautinSoft.PdfVision()
 p.ConvertHtmlToPdf("http://www.google.com", Server.MapPath("~\pdfs") + "\sample.pdf")


When executing the above code on my laptop the target URL is converted to a PDF, all CSS and JS is executed (I need this for a Google Map).  When executing on the server the target URL is converted to a PDF but just the CSS is excuted and not the JS, therefor no Google Map.

I've tried the help with the 3rd party tool but the support isn't great.  Can someone please suggest what it might be to get me going? I'm thinking permissions? 

Thanks

I look at the server's virus protection too - Robbe Morris replied to Paddy Mac on 21-Jan-10 05:47 PM

It may see a low priviledged account (asp.net anonymous account Network Service) writing .js files to disk and the virus protection software is removing them.  If it is writing out the css files in the same location, I "believe" that rules out NTFS drive permissions.

Thanks Robbe - Paddy Mac replied to Robbe Morris on 21-Jan-10 05:52 PM

I'll check that!

I've tried - Paddy Mac replied to Robbe Morris on 21-Jan-10 06:13 PM

entering an 'ignore' exception in the anti-virus for the entire website directory. Should this rule out the anti-virus idea?
I must add - Paddy Mac replied to Paddy Mac on 21-Jan-10 06:17 PM

I've tried browsing the URL directly on the server using IE and the JS is not executed. Can someone please help?

Thanks!

ConvertHtmlToPdf - Hamit YILDIRIM replied to Paddy Mac on 21-Jan-10 06:22 PM
Hi Paddy,

What is the Operational System of your Laptop. If it is Mac than this is normal case, Interesting Disc fragmentation
else you can try to use another browser teste it with firefox -> firebug

Good Works..
excuse me I want to say Dom fragmentation - Hamit YILDIRIM replied to Hamit YILDIRIM on 21-Jan-10 06:28 PM
end of post
I'm using - Paddy Mac replied to Hamit YILDIRIM on 21-Jan-10 06:30 PM

a Vista Laptop and I have tested locally with IE and FireFox with both having the same results. 

Versions of the IE - Hamit YILDIRIM replied to Paddy Mac on 21-Jan-10 06:35 PM
Can you give me the versions of the IE both Pc and loptap
here you go - Paddy Mac replied to Hamit YILDIRIM on 21-Jan-10 06:44 PM
end of post
here you go... - Paddy Mac replied to Paddy Mac on 21-Jan-10 06:45 PM

My laptop is IE 8 and the server is IE 7

Should this make a difference?

getDOMElementById - Hamit YILDIRIM replied to Paddy Mac on 21-Jan-10 07:07 PM
Yes I've got many error with those versions. Micsrosoft made many security change in the IE8. I have wrote some tools for getting same results. I found that this different behaviors are sourcing from the DOM fragmentation generaly. There I have wrote a function that is fragmentating them. 

function getDOMElementById(id) {
    if (isDefined(typeof document.getElementById)) {
        return document.getElementById(id);
    } else if (isDefined(typeof document.all)) {
        return document.all[id];
    } else {
        throw new Error("Can not find a method to locate DOM element.");
        return null;
    }
}


I think if you install IE7 to the loptap it will work

Good works..
I'll try - Paddy Mac replied to Hamit YILDIRIM on 21-Jan-10 07:13 PM

it on another PC which has IE7 tomorrow morning and get back to you.

Thanks for the help!

I've tried - Paddy Mac replied to Paddy Mac on 22-Jan-10 03:20 AM

This on another PC with IE 7 but the result is the same - but i can see why this would have an impact.

I think it's to do with the configuration of the webserver.

Can any suggest another solution? Would it be a firewall issue from the webserver?

Thanks

generate a PDF for a given URL - mv ark replied to Paddy Mac on 31-Jan-10 09:53 PM
A free & effortless way to generate a PDF for a given URL is to use Web2PDF Online - http://savepageaspdf.pdfonline.com/

http://savepageaspdf.pdfonline.com/ is a free service that accepts a URL & generates a PDF file for it.

It also keeps track of all the PDF conversion activities in your site, providing you with a metric to measure the importance of your site contents.

Source: http://mvark.blogspot.com/2008/06/how-to-convert-authenticated-protected.html
Max replied to Paddy Mac on 17-Aug-10 05:33 AM
Hi,

My name is Max from SautinSoft, I see that you had problem with our component PDF Vision .Net - HTML to PDF generation.

The problem is that the component requires Full Trust level, it will not work in Medium Trust level or shared hosting. Because it uses the WebBrowser class inside which doesn't work without Full Trust at server.

I can recommend another component for Medium Trust Level - PDF Metamorphosis .Net, but it would be good not for complex web-pages.

If someone will have questions email me to support@sautinsoft.com.

Max