Vip,

Acrobat provides an FDF Toolkit (version 5) where you select the target
frame for your pdf file. You can put a fictitious frame name  in the
SetTargetFrame() method then return a null (instead of an actionforward) to
the actionservlet. Since the frame is non-existent, the resulting pdf file
will be displayed in a new browser. This works for me but your users need
to have Acrobat Reader version 5.0 or else it won't work. Previous reader
versions ignore the SetTargetFrame(). Another way to do this is in
HTML:FORM where you use the TARGET attribute to direct the output pdf to a
non-existent frame.

Here's an example of using the FDF toolkit.

     try {

           FDFDoc outputFDF = null;

               /* Create a new FDF. */
          outputFDF = new FDFDoc();


           outputFDF.SetValue("test", "Thanks George!");
          outputFDF.SetFile("http://w1124960/PDFs/GenerateFDF.pdf";);

          outputFDF.SetTargetFrame("Right");

          response.setContentType("application/vnd.fdf");

          // 2
           OutputStream out = response.getOutputStream();

               // 3

          outputFDF.Save(out);
          System.out.println("Saved FDF output");

           out.close();

          } catch(FDFException e) {
               /* We handle an error by emitting an html header */
               response.setContentType("text/html");
               PrintWriter out = response.getWriter();
               System.out.println("Caught FDF exception");
               System.out.println(e.toString());
               e.printStackTrace(out);
          }

Hope this helps






"Galbreath, Mark" <[EMAIL PROTECTED]> on 04/30/2002 09:52:58 AM

Please respond to "Struts Users Mailing List"
      <[EMAIL PROTECTED]>

To:   "'Nekkalapudi, Viplava'" <[EMAIL PROTECTED]>
cc:   "Struts (E-mail)" <[EMAIL PROTECTED]>
Subject:  RE: some PDF stuff


I wish I could help you, Vip, but I don't have any experience with Java and
PDFs.  There are people on the list, however, who are doing this stuff and
can probably help you, so I'm cc'ing the group.  Otherwise, I know a lot of
people are doing this (and I probably will be too, soon), so try a Google
search on the keywords in your message.

Mark

-----Original Message-----
From: Nekkalapudi, Viplava [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 12:40 PM
To: Galbreath, Mark
Subject: some web stuff



 Hi,
      Sorry to mail you directly (please let me know if you mind).
      I have seen your replies in the struts mailing lists regarding some
problems which I have right now.
      I hope you have some idea on these.
      There are two different issues, I want to clarify before I implement
differently.

    1.  We just started using iText to generate reports.
         Right we open PDF's in the browser window (My acrobat reader is
set
up like that).
         Is there a way to open PDF in a separate acrobat window,
         by not changing the acrobat reader 'Preferences/General/Options'?.
         Means Can we control this from servlet? We are using Struts.
         I don't know the settings on the client machine, and I want to
ignore whatever set
         on the client machine.

    2.  I have set up the my action servlet  "nocache" property to "true"
in
the web.xml.
         So that the browser avoids caching the pages. This can be set up
from the browser on individual machines
         also. But adding this property to the action servlet control the
browser settings.
         The problem now is, whenever I open a PDF file, close the PDF
file,
and
         select other button to open different page fails and opening the
same PDF again.
         The button should go to different action mapping. But browser is
caching the PDF file.
          How to avoid caching of PDF files and not only HTML files.

         Thanks in advance.

-- Vip




--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>






**********************************************************************
Please Note:
The information in this E-mail message, and any files transmitted
with it, is confidential and may be legally privileged.  It is
intended only for the use of the individual(s) named above.  If you
are the intended recipient, be aware that your use of any confidential
or personal information may be restricted by state and federal
privacy laws.  If you, the reader of this message, are not the
intended recipient, you are hereby notified that you should not
further disseminate, distribute, or forward this E-mail message.
If you have received this E-mail in error, please notify the sender
and delete the material from any computer.  Thank you.
**********************************************************************



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to