[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Slow PDF viewing from ASP website

Posted on 2009-03-31
Medium Priority
Last Modified: 2012-05-06
I have an ASP.NET website that generates a PDF using Active Reports' PDFExport.  The PDF then opens in a new window.

Unfortunately this process is very slow and is being used in a hospital environment where quick results are needed.  I am looking for any suggestions on how to get this PDF displaying as quickly as possible (even in the same window/page?).

I am also looking at the possibility of skipping the view stage altogether and taking the user straight to the print dialog.  I've done this before in WinForms, but can I pull it off in web?

Included below is the current code.
this.pdfExport1.Security.Encrypt = true;
this.pdfExport1.Security.Permissions = DataDynamics.ActiveReports.Export.Pdf.PdfPermissions.AllowPrint;
this.pdfExport1.Export(rpt.Document, m_stream);
m_stream.Position = 0;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline; filename=MyExport.pdf");

Open in new window

Question by:corebiz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
LVL 23

Expert Comment

ID: 24029361
hi corebiz,
Is the PDF generation process happening in the new window, or in the page that spawns the new window?
Is it taking time actually generating the PDF or just when it comes to showing it?
What is the size of an average PDF?

Author Comment

ID: 24029440
I'm not a master at these things, but I'm fairly confident the generation is happening in the existing/old window, and once ready is opening in a new window.

I have two different pages generating PDF's.  The one generates a one-page PDF that generates reasonably quickly and the delay is purely in opening the new window or the gadget that shows the PDF (adobe or foxit reader).

The other generates a multi-page PDF, which is running extraordinarily slowly (4 minutes for 10 pages), so it surely must be my fault somewhere.  This one is not going to a new window but is popping up for download, although I'd like it to jump directly to a print dialogue.
LVL 23

Expert Comment

ID: 24029492
What are the sizes of the 2 different types (single page and 10 page PDF's)
If you are confident that the generation of the 1page PDf is ok, you have to remember, that when it is opened in a new windows, the PDF is downloaded to the client in its entirety to allow them to view it. So prompt or shown the same thing will happen
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.


Author Comment

ID: 24029746
The single page is only 22k.  The 10 page is taking 4 minutes when I view it live, but on my development machine it takes 20 seconds to generate 129 pages into a 304kb file.  The latter is tolerable, the former not.
LVL 23

Expert Comment

ID: 24030610
how is th PDF being populated when it is generated, from a database?
You say its ok on your local machione, are you using a local database to do this or linking to your live one?
If yo are using SQL Server check the indexes on the table used to populate the fields in your PDF document.

Author Comment

ID: 24031254
I can certainly investigate that kind of thing.  What I'm more interested in is quick ways to display PDF's in a webpage.  Can you give any insight on this or are you aware of any controls that can dock into an ASP.Net page to display PDFs?
LVL 23

Expert Comment

ID: 24035027
Im not aware of any. Have a look here, you may be able to take something from it to help:
To be honest, if they are small, they shouldnt take that long to load at all. Obviously they are taking a long time to process on your live server and this is a problem in itself

Accepted Solution

corebiz earned 0 total points
ID: 24075506
For anyone with the same problem, see the response I got from the ActiveReports guys:

LVL 23

Expert Comment

ID: 24084931
Thanks for sharing, glad you got it sorted :)

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question