Welcome Guest Search | Active Topics | Sign In | Register

Performance Options
l592934
Posted: Wednesday, August 29, 2012 9:23:29 AM
Rank: Newbie
Groups: Member

Joined: 8/29/2012
Posts: 2
Hi,

We are evaluating your product to print plain ASP .NET MVC views as PDFs.

During debugging, I have noticed something strange: only the first PDF file gets generated within an acceptable time frame, it takes about 30 seconds (when I open the view, it is about one or two seconds, as it makes use of caching). Any subsequent PDF files are created a lot slower (and by slow I mean 2 minutes at least), which would be a pain for the users of our product.

This is how I use the library:

Code: C#
using ( var stream = new MemoryStream () )
{
    var options = new EO.Pdf.HtmlToPdfOptions ();
    options.PageSize = new SizeF ( 8.27f, 11.69f );
    options.OutputArea = new RectangleF ( 0.1f, 0.2f, 8.25f, 11.5f );

    EO.Pdf.HtmlToPdf.ConvertUrl ( url, stream, options );
    pdfFile = stream.ToArray ();
}


Can you spot the error here? Is this behavior somehow a limitation of the trial product? How could we get rid of it?

Thanks a lot,
Zsolt
eo_support
Posted: Wednesday, August 29, 2012 9:37:05 AM
Rank: Administration
Groups: Administration

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

Your code is perfectly fine and the amount of time it takes does not appear to be normal. The total amount of time = amount of time it gets the page from your server + the amount of time it convers the page. Most of the time when it takes unreasonably long, it's because it is unable to load certain resources from your server. For example, when your page contains an image, the converter will try to wait until that image finishes loading. However if that image never finishes loading, then it will take a long time (until the converter times out) for the converter to return.

I would recommend you try to convert a different Url just a test whether it has to do with your Web server. If it turns out to be related to your server, try to remove contents from your target Url block by block and see if there is any particular resource that's causing the delay. Once you identify the root of the delay, you can check your Web server logs to see if you can resolve that.

Thanks!
l592934
Posted: Wednesday, August 29, 2012 10:06:23 AM
Rank: Newbie
Groups: Member

Joined: 8/29/2012
Posts: 2
Thanks a lot for the quick feedback, I will look into this ;)


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.