Do your documents employ any encryption? Also, why
aren't you opening the new window with the url to the servlet in the first
place?
Also, I'm confused as to the use of the cookie (personnaly,
i'm fond of cookie monster myself). I can see that you are "serving" the
pdf from within the servlet. Try, just for kicks, saving it to disk, and
then sending down that Jscript. If anything, I'd be curious to see what
happens.
I code web for a living, so, any questions, feel
free...
--
Diversa ab illis virtute valemus.
----- Original Message -----
Sent: Monday, March 11, 2002 5:22
PM
Subject: RE: Acrobat 5.0 Error
David,
Thank you for the
advice. We are handling
the PDFs a little
differently, however, and are running on
Apache.
In the JSP file that displays content in the browser, we have the following
link within a form
named documentmanagementsearchnavigation:
<a href="#"
><img
src="javascript:void(0);" width="29" height="60" border="0" alt="Print
Unprinted Approved Documents in the list."></a>
Here
is the batchPrintDocument function in the javascript
file:
function batchPrintDocument( form
) { var option =
"HEIGHT=400,WIDTH=700,scrollbars=1,status=1,menubar=1";
newWindow = window.open("BatchPrint.html", "BatchPrintDocumentWindow",
option); result =
getCookieData(); if (result ==
"") {
result = 0; document.cookie = "app=" +
result; }
else {
result = parseInt(result) + 1;
document.cookie = "app=" + result;
} var source =
"Servlet?actiontotake=batchprintdocument.pdf&cookie="+result;
newWindow.location = source;
newWindow.focus();
return false;
}
We
define the batchprintdocument.pdf action in the Servlet. The batch
function in the servlet actually builds one large document that consists
of many smaller documents. For instance, a user can print one individual
report or click on the batch print icon to print all of the reports. She
is able to print one doc OK, but receives the error when printing batch
printing all documents even when there is only 1 or 2 docs to be batch
printed.
This
feature is working well, except on her computer. We suspect it
is her configuration.
Thanks
again!!
Rachael
How is the PDF being served to the user? Is it
coming from an ASP page and being Response.BinaryWrite'ed? The best
work around that I'm using for this problem is this:
I persist the file on the server, then send this to the
browser:
<html><head>
<script language="javascript">
<!--
window.location.href='<%=path%>'
//-->
</script>
</head><body></body></html>
This way, IE will go fetch the file itself. If you
are using IIS, save the docs in their own folder, then go into the IIS
setting, and enable content expiration (it's on the HTTP Headers tab) just
for that folder and set it to expire immediately. If you don't do
this, IE will keep pulling the PDF from it's cache if you re-use
filenames.
:)
--
Diversa ab illis virtute valemus.
----- Original Message -----
Sent: Monday, March 11, 2002 3:28
PM
Subject: Acrobat 5.0 Error
Hello!
Thanks in
advance for your time and help.
I know this is
not exactly an FOP issue, but will be very helpful to the folks who
are already in a production environment.
I have a user
running WIN NT and views FOP-generated PDFs in Acrobat 5.0 within Internet
Explorer.
When she opens
the PDF, she receives the error:
File does not
begin with :%PDF...
She receives a
dialog box then clicks OK and gets a blank screen. In our offices,
we are able to view the same documents in Acrobat 5.0 with no
problem.
At this time, I think it is a problem on
the user's PC. I am
hoping someone has seen this type of problem before. I am able to
see that, on my computer, the PDF starts with :%PDF. Why is
her Acrobat interpreting it differently?
Thanks!
Rachael
P.S. I
also had her try the option to NOT view it in the browser. I
had no success with this
either.
|