Welcome Guest Search | Active Topics | Sign In | Register

Response time when rendering through MVCToPdf Options
rpittman
Posted: Wednesday, March 25, 2015 1:44:54 PM
Rank: Newbie
Groups: Member

Joined: 3/17/2015
Posts: 8
I have been working on evaluating the MVCToPDF product. I have been pretty successful in producing the PDF report that I need. However, I have ran into a big issue in terms of performance. When I render a PDF with no images, response time is very good. However when I try to render a PDF with ten images, it is taking over two minutes. It comes back with the expected results but takes way too long.

I have tried several settings. I have included what I am currently using, but changing these has had no effect.

EO.Pdf.HtmlToPdf.Options.OutputArea = new System.Drawing.RectangleF(0.25f, 0.25f, 8f, 10.5f);
EO.Pdf.HtmlToPdf.Options.MaxLoadWaitTime = 180000;
EO.Pdf.HtmlToPdf.Options.RetrieveNodeText = false;
EO.Pdf.HtmlToPdf.Options.PreserveHighResImages = false;
EO.Pdf.HtmlToPdf.Options.SaveImageAsJpeg = true;
EO.Pdf.HtmlToPdf.Options.JpegQualityLevel = 50;
EO.Pdf.HtmlToPdf.Options.FooterHtmlFormat = string.Format("PDF Inspection Report created on: {0:MM/dd/yyyy hh:mm}", DateTime.Now);
MVCToPDF.AutoFormsAuthentication = true;
MVCToPDF.RenderAsPDF();

Is there anything that I can do to improve performance? Would I be better off using the HTMLToPDF feature?
eo_support
Posted: Wednesday, March 25, 2015 1:52:12 PM
Rank: Administration
Groups: Administration

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

Such significant delay is usually caused by a DNS configuration issue on your Web server. See here for more details:

http://www.essentialobjects.com/doc/4/web/troubleshoot.aspx

Thanks!
rpittman
Posted: Wednesday, March 25, 2015 2:00:49 PM
Rank: Newbie
Groups: Member

Joined: 3/17/2015
Posts: 8
I can see how this condition would prevent my page from loading the images or other files but I am not clear on why it would cause it to take a much longer time.
rpittman
Posted: Thursday, March 26, 2015 9:57:02 AM
Rank: Newbie
Groups: Member

Joined: 3/17/2015
Posts: 8
I have some additional information concerning my response time problem that I hope will help find a solution.

The images that are being rendered on the page come out of Sharepoint. The URL that gets these images points to a MVC action that I have created that opens the Sharepoint file and returns a File Stream back through the Action Result. It seems as though when I use this method, the images get returned and put into the PDF, but they take a very, very long time. If I don't render the page as PDF, (using the Autoconvert = false), the page comes up in a browser window in less than one second.

Again, the images are on the page so I do not think I am having the IP problem that was suggested earlier. I am running this on a local IIS and have even used localhost:port and get the same result.

Could the problem be with the FileStream being returned through the Action Result response?
eo_support
Posted: Thursday, March 26, 2015 9:58:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Is your image dynamically generated?
rpittman
Posted: Thursday, March 26, 2015 10:09:48 AM
Rank: Newbie
Groups: Member

Joined: 3/17/2015
Posts: 8
No, it is not. However, the image(s) that is selected will be different each time. The image could be thought of as something like a product image. If the user is looking at item A, it selects the image for item A.

I do it this way because the Sharepoint where the image resides is not a public facing site. I check to make sure the user has permission to see the particular file before returning it to them. Basically the action works as a proxy. I have experimented with changing the link to the URL of the Sharepoint server. This works much better and the PDF is created in a few seconds.

I would prefer to not go the route of using the sharepoint server directly for the PDF version because it would not allow me to use the page for PDF and HTML delivery.
eo_support
Posted: Thursday, March 26, 2015 10:24:36 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Have you tried the access the Url locally as suggested in the above link? You can also check your web server log to see the time the request to the Url is hit and the time it takes ("time taken" field) to serve image request. It is very uncommon that an image would take minutes to convert.

Thanks!
rpittman
Posted: Thursday, March 26, 2015 10:55:48 AM
Rank: Newbie
Groups: Member

Joined: 3/17/2015
Posts: 8
I have run it on the server and get the same results.

I don't think the problem has to do with the EO PDF conversion.

I am starting to think that it has something to do with when the internal browser is reading the stream that I am posting out of the action result. I have read that the FileStream uses 4K buffers to write the stream. My test shows that I only have the response time issue when I am coming from the MVC action. It converts quickly when the image is a URL that points directly at Sharepoint.
eo_support
Posted: Thursday, March 26, 2015 5:07:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
No problem. Please keep us updated.

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.