C# Acrobat以全屏模式打开

C# Acrobat以全屏模式打开,c#,.net,asp.net,vb.net,acrobat,C#,.net,Asp.net,Vb.net,Acrobat,我在asp.net的iframe中显示PDF时遇到问题。当pdf显示时,它显示时没有允许用户缩放和打印的Acrobat工具栏。这给我们的客户带来了很大的麻烦,因为他们无法阅读PDF的大小。如果您尝试将Acrobat设置为不在浏览器中显示PDF并浏览到该页面,则会收到一条消息,说明它正试图以全屏模式打开该页面。有没有办法让我的代码不这样做?以下是我用于将PDF流式传输到浏览器的代码: Public Shared Sub StreamPdfToBrowser(ByVal doc As Documen

我在asp.net的iframe中显示PDF时遇到问题。当pdf显示时,它显示时没有允许用户缩放和打印的Acrobat工具栏。这给我们的客户带来了很大的麻烦,因为他们无法阅读PDF的大小。如果您尝试将Acrobat设置为不在浏览器中显示PDF并浏览到该页面,则会收到一条消息,说明它正试图以全屏模式打开该页面。有没有办法让我的代码不这样做?以下是我用于将PDF流式传输到浏览器的代码:

Public Shared Sub StreamPdfToBrowser(ByVal doc As Document)
    Dim Ctx As HttpContext = HttpContext.Current
    '// Clear any part of this page that might have already been buffered for output.
    Ctx.Response.Clear()
    Ctx.Response.ClearHeaders()

    '// Tell the browser this is a PDF document so it will use an appropriate viewer.
    Ctx.Response.ContentType = doc.DisplayFileType

    Ctx.Response.ContentType = "application/pdf"
    Ctx.Response.AddHeader("content-type", "application/pdf")

    '// IE & Acrobat seam to require "content-disposition" header being in the response. If you don't add it, the doc still works most of the time, but not always.
    '// this makes a new window appear: 
    Response.AddHeader("content-disposition","attachment[inline]; filename=MyPDF.PDF");
    Ctx.Response.AddHeader("Content-Length", doc.DisplayFile.Length)
    Ctx.Response.AddHeader("Content-Disposition", "inline; filename=E-Sign Specification Report.pdf")

    '// TODO:  Added by KN to possibly fix UA issue
    Ctx.Response.ContentType = "application/pdf"
    Ctx.Response.AddHeader("content-type", "application/pdf")

    '// Write the PDF stream out
    Ctx.Response.BinaryWrite(doc.DisplayFile)

    '// Send all buffered content to the client
    Ctx.Response.End()
End Sub

在AdobeAcrobat中启动PDF,转到文件、属性并单击初始视图选项卡。在这里,您可以设置当人们打开此特定PDF时的默认视图,听起来好像选中了“全屏模式下打开”。

我尝试将生成的PDF选项设置为不使用全屏模式,但它没有改变所有内容。是否仍然需要从Response.Write中强制此选项?创建PDF后,请在Acrobat中打开它。是否选中全屏选项?我没有Acrobat的完整版本,因此无法查看。你能在Acrobat Reader中看到这一点吗?