• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Blank PDF displayed on IE once every 5 to 6 attempts

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using Active X controls to display PDF on Internet Explorer.
I have a servlet which serves this PDF.
Below is the code snipped from the JSP which displays this PDF.



<object id="demo" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="750" height="530">
<param name="SRC" value="servlet/com.abc.abc.DisplayPDFServlet?<%=System.currentTimeMillis()%>">
</object>



The issues is every few attempts the page loads up with a blank view. On some investigation I realized that IE is placing a call to server but is not downloading all the bytes of the PDF. A sysout in the servlet confirmed that entire byte array content had been passed as response.

Does anybody have an hint on how to solve this issue?


Vikas
[ June 20, 2006: Message edited by: Vikas Gujjar ]
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Notes on Microsoft Internet Explorer

Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times. These are well-known limitations of Internet Explorer and are not a problem of the servlet. However, Internet Explorer can still be used to download the PDF so that it can be viewed later. Here are some suggestions in this context:

* Use an URL ending in .pdf, like http://myserver/servlet/stuff.pdf. Yes, the servlet can be configured to handle this. If the URL has to contain parameters, try to have both the base URL as well as the last parameter end in .pdf, if necessary append a dummy parameter, like http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf. The effect may depend on IEx version.
* Give IEx the opportunity to cache. In particular, ensure the server does not set any headers causing IEx not to cache the content. This may be a real problem if the document is sent over HTTPS, because most IEx installations will by default not cache any content retrieved over HTTPS. Setting the Expires header entry may help in this case:
response.setDateHeader("Expires", System.currentTimeMillis() + cacheExpiringDuration * 1000);
Consult your server manual and the relevant RFCs for further details on HTTP headers and caching.
* Cache in the server. It may help to include a parameter in the URL which has a timestamp as the value min order to decide whether a request is repeated. IEx is reported to retrieve a document up to three times, but never more often.



source: http://xmlgraphics.apache.org/fop/0.20.5/servlets.html#ie
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
see this too http://forum.java.sun.com/thread.jspa?threadID=586671&start=15
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vikas,
We are successful in rendering pdf into browser for quite sometime. Had a problem with IE5 which sends multiple requests. But with IE6 with SP2, it is been solved.
This is the code we use to render pdf content into browser. Working fine with Firefox too.

* data[] is the content of PDF file
 
Vikas Gujjar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issues persists in spite of attempting all combinations of response header.
Our team also made an interesting observation, when ever the blank page is displayed without the PDF the response header also contains a line like

Set-Cookie: SMSESSION=<some really long value>

Additionally,
we are using a model dialog box to display the PDF.

This issue is not observed on all machines though the machines we have are of similar configurations i.e. Win2K/Adobe 6(Reader/Professional)/IE 6 SP1

Vikas
 
Vikas Gujjar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We managed to finally figure out the issue.

Its a known issue with Adobe 6.0. We had to download a patch for Adobe 6.0 to get it working.

Vikas
 
What are you doing in my house? Get 'em tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic