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.