Mr. Bruno,
I am sorry if I am unable to express my querry.
I am giving the whole code that I am using for this document

public ActionForward downloadPDF(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        String issueDate = request.getParameter("issueDate");
        CareerLetterIssue careerLetterIssue = careerLetterIssueManager
                .getCareerLetter(issueDate);
         /**
         * collection of pages contained in this letter
         */
        List pages = careerLetterIssue.getPages();
        Document document = new Document(PageSize.A4);
        OutputStream out = response.getOutputStream();
        PrintWriter pdf = response.getWriter();
        document.open();
        response.reset();
        response.setContentType("application/pdf");
        //        setting the content type
        response.setHeader("Content-disposition", "attachment; filename=\""
                + issueDate + ".pdf\"");
        response.setHeader("Cache-Control",
                "must-revalidate, post-check=0, pre-check=0");
          response.setHeader("Pragma", "no-cache");
        response.setHeader("Expires", "0");

        /*8
         * data holds blob retrieved as byte array
         */
        byte data[] = null;

        for (int i = 0; i < pages.size(); i++) {
            CareerLetter cl = (CareerLetter) pages.get(i);
            String pageNumStr = cl.getPageNum();
            data = "">                     issueDate);
            Image pdfImage = Image.getInstance(data);
          
            document.add(pdfImage);
            if (i < pages.size() - 1) {
                document.newPage();
            }

        }

        pdf.flush();
        document.close();
        response.flushBuffer();
        out.close();
        return null;

    }

The program is running fine.
I am able to download this pdf and save it.
I am using Evence Document Viewer
I am able to view them for a single time.
When I am at(say) page no. 5, all the images from page no. 3 to page no. 1 are dis-appearing.

Can you please suggest me some other way of writing images to my pdf.
Please help..
Bruno Lowagie <[EMAIL PROTECTED]> wrote:
yash wrote:

>Hi all
> I have a programme to generate pdf consisting of some images with one
>image per page. These images are appearing correctly for the first time
>but when i use back button, all the images from the (current page -
>2)th page are disappearing.
>
> (Of course) they are appearing the next time i open the PDF file. They
>appear and once I go forward, the previous images are dissappeared.
>
> I am seeking help from someone in iText community .
>
>
I assume you realize that this isn't an iText related problem.
iText creates the PDF correctly; otherwise the images would
have been blank to start with. The problem is browser/plug-in related.

>If I am using another version of add that is
>
>document.add(Image.getInstance(2000, 1500, 3, 4,
>Image.getInstance(byteArray)));
>
>
If a problem isn't iText related, changing the code won't help.
Except maybe if you add the images 'inline' instead of as
'Image XObjects', but I can't guarantee this will give you
a better result.

>Please help
>
>
You should disable the back button, or, as I suggested a few
days ago in answer to another question, serve the PDF as
'attachment' instead of 'inline'. When you serve the PDF as
attachment, the PDF isn't shown in the Adobe Reader browser
plug-in, but in a separate Adobe Reader window (not a browser
window). The keywords to search for are: "Content-Disposition"
and "attachment" (versus "inline")
best regards,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


Here's a new way to find what you're looking for - Yahoo! Answers
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to