1
asp.net의 iframe에 PDF를 표시하는 데 문제가 있습니다. pdf가 나타나면 사용자가 확대/축소 및 인쇄 할 수있는 Acrobat 도구 모음없이 표시됩니다. 이는 PDF 크기의 문서를 읽을 수 없기 때문에 고객에게 큰 번거 로움을줍니다. Acrobat에서 PDF를 브라우저에 표시하지 않고 해당 페이지를 탐색하도록 설정하면 전체 화면 모드로 열려고한다는 메시지가 나타납니다. 어떻게하면 코드에서 이렇게 할 수없는 아이디어가 있습니까? 어도비 아크로뱃의 PDF는, 파일 속성 및 초기보기 탭을 클릭로 이동Acrobat 전체 화면 모드로 열기
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
전체 화면 모드를 사용하지 않도록 PDF 옵션을 설정했지만 모든 것을 변경하지는 않았습니다. 이 옵션을 Response.Write에서 강제로 제거 할 수 있습니까? – bechbd
PDF를 만든 후 Acrobat에서 엽니 다. 전체 화면 옵션이 선택되어 있습니까? –
전체 버전의 Acrobat이 없으므로 볼 수 없습니다. 어떻게 든 Acrobat Reader에서 이것을 볼 수 있습니까? – bechbd