Re: Acrobat 5.0 Error

2002-03-11 Thread Matt Savino

I can't really tell from this example, but I know I ran into an issue
where I was trying to use a JSP page to generate either PDF or HTML. I
finally realized I was getting an error when the output was PDF which
was due to whitespace between the %><% tags. The JSP engine compiles
whitespace as System.out.println("   "), which naturally doesn't agree
with the byte array output stream Acrobat is expecting. I quickly
switched back to a servlet.

-Matt

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Acrobat 5.0 Error

2002-03-11 Thread David B. Bitton



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...
 
--
 
David B. Bitton[EMAIL PROTECTED]www.codenoevil.com
 
Diversa ab illis virtute valemus.

  - Original Message - 
  From: 
  Rachael Blank 
  To: '[EMAIL PROTECTED]' 
  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:
  
  
  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
   
  
-Original Message-From: David B. Bitton 
    [mailto:[EMAIL PROTECTED]]Sent: Monday, March 11, 2002 4:22 
PMTo: [EMAIL PROTECTED]Subject: Re: Acrobat 5.0 
Error
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:
 

</FONT></DIV>
<DIV><FONT size=2><!--</FONT></DIV>
<DIV><FONT size=2>    
window.location.href='<%=path%>'</FONT></DIV>
<DIV><FONT size=2>//--></FONT></DIV>
<DIV><FONT size=2>

 
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.
 
:)
 
--
 
David B. Bitton[EMAIL PROTECTED]www.codenoevil.com
 
Diversa ab illis virtute valemus.

  - Original Message - 
  From: 
  Rachael Blank 
  To: '[EMAIL PROTECTED]' 
  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.


RE: Acrobat 5.0 Error

2002-03-11 Thread Rachael Blank



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:


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
 

  -Original Message-From: David B. Bitton 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, March 11, 2002 4:22 
  PMTo: [EMAIL PROTECTED]Subject: Re: Acrobat 5.0 
  Error
  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:
   
  
  </FONT></DIV>
  <DIV><FONT size=2><!--</FONT></DIV>
  <DIV><FONT size=2>    
  window.location.href='<%=path%>'</FONT></DIV>
  <DIV><FONT size=2>//--></FONT></DIV>
  <DIV><FONT size=2>
  
   
  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.
   
  :)
   
  --
   
  David B. Bitton[EMAIL PROTECTED]www.codenoevil.com
   
  Diversa ab illis virtute valemus.
  
- Original Message - 
From: 
Rachael Blank 
To: '[EMAIL PROTECTED]' 
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.


Re: Acrobat 5.0 Error

2002-03-11 Thread David B. Bitton



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: