I have a asp.net app that writes a pdf to file. Then, later that file is opened into a window (standard acrobat reader) for viewing. No problems there.
The weird part...
The entire document loads as it should, but the Reader initially shows the last pag开发者_Python百科e in the document on the screen. The user must then scroll up to the first page. It doesn't happen all the time (about 50%) and occurs across several test computers.
Is there a switch in the code I'm suppose to use in creating the file or displaying the file to tell the reader to "start displaying the document on the first page?"
Environment particulars:
asp.net 3.5 vb, websupergoo's abcpdf.net pro 7 (assembly that creates the pdf file), Windows 2008 Server, IIS7
Thanks
Just FYI, I had this same issue and started using #page=1. However, be aware that this causes a bug in IE where after a user opens and closes 50-60 documents, Adobe Reader will stop responding. I had to take out the #page=1 bookmark parameter, and am now searching for another solution...
I had a similar problem and the #view=FitH parameter is what caused it. Removing that parameter fixed it for me. I still have no idea why.
May be helpful (client setting in reader): http://korayem.net/post/2007/12/Adobe-Reader-Tip-Open-a-PDFs-Last-Viewed-Page.aspx
I found the answer... at least a work around.
Since I'm using a response.redirect to call the pdf in a browser window, I programmatically added "#Page=1" to the end of the filename string. It opens to the first page every time. The "#Page=n" (where "n" is the number of the page, of course) opens to the page of choice.
Learn something everyday...
Check if you can remove the 'OpenAction' name and related array value from the PDF using the above mentioned pdf library. Looks like 'OpenAction' is pointing to the last page.
PDF 32000-1:2008 - Page 74:
OpenAction - array or dictionary
(Optional; PDF 1.1) A value specifying a destination that shall be displayed or an action that shall be performed when the document is opened. The value shall be either an array defining a destination (see 12.3.2, "Destinations") or an action dictionary representing an action (12.6, "Actions"). If this entry is absent, the document shall be opened to the top of the first page at the default magnification factor.
精彩评论