我使用的对象标签来显示PDF的HTML,但我做的MVC是这样的:显示PDF在网络
<object data="/JDLCustomer/GetPDFData?projID=<%=ViewData["ProjectID"]%>&folder=<%=ViewData["Folder"] %>"
type="application/pdf" width="960" height="900">
</object>
和控制器/动作是
public void GetPDFData(string projID, Project_Thin.Folders folder)
{
Highmark.BLL.Models.Project proj = GetProject(projID);
List<File> ff = proj.GetFiles(folder, false);
if (ff != null && ff.Count > 0 && ff.Where(p => p.FileExtension == "pdf").Count() > 0)
{
ff = ff.Where(p => p.FileExtension == "pdf").ToList();
Response.ClearHeaders();
Highmark.BLL.PDF.JDLCustomerPDF pdfObj = new JDLCustomerPDF(ff, proj.SimpleDbID);
byte[] bArr = pdfObj.GetPDF(Response.OutputStream);
pdfObj = null;
Response.ContentType = "application/" + System.IO.Path.GetExtension("TakeOffPlans").Replace(".", "");
Response.AddHeader("Content-disposition", "attachment; filename=\"TakeOffPlans\"");
Response.BinaryWrite(bArr);
Response.Flush();
}
}
问题是,因为我先从服务器下载数据,然后返回字节数据,下载需要一些时间,所以我想展示某种进度来显示处理。
请帮我解决这个问题。
AFAIK我们不应该使用此论坛来插入我们自己的产品。 – azarc3 2013-10-30 18:37:12
我认为我在写作时(3年前!)让我的产品晶莹剔透,这与产品常见问题解答(FAQ)一致。更多关于meta [这里]的主题(http://meta.stackexchange.com/questions/15787/how-do-i-mention-my-own-products-in-answers)。除此之外,我认为我在答案中提供了足够多的相关信息,这不是一个促销活动。另请注意,该产品一年前已开源。所有的代码都可以在codeplex [here](https://pdfwebviewer1.codeplex.com/)和[here](http://webviewer2.codeplex.com/)上找到。 – 2013-10-30 19:09:57