I suspect that the orinal pdf is tagged. PdfCopy doesn't keep tagging. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of [EMAIL PROTECTED] > Sent: Thursday, February 16, 2006 10:22 PM > To: [email protected]; [EMAIL PROTECTED]; > Paulo Soares > Cc: Sue Lynch > Subject: [iText-questions] Issue of iText version 1.3.6 > opening a document in Acrobat Stardard version 7.0 and above > > Hi, > I am facing a problem when i merge the document using > iText,it does not > display the option "Open Table in Spreadsheet"( > Print Screen A)).But when i avoid using > iText code it display the option "Open Table in Spreadsheet"( > Print Screen B). > > Version Used > Adobe Acrobat Standard (7.0 and over) > iText.jar version 1.3.6 > JDK 1.4 > > Code > > public void mergePdf(OutputStream out, DocumentRequestValue request) > throws PdfGenerationException { > List documents = request.getDocuments(); > DocumentValue docVal = null; > > PdfReader reader = null; > Document document = null; > PdfWriter writer = null; > > try { > // if empty document set don't do anything > if (documents.size() < 1) > throw new PdfGenerationException( > "empty document set for request: " > + request.getRequestId()); > > // log document access > DocumentRequestDAO requestDAO = new > DocumentRequestDAO(); > request.setAccessSite("AI"); > try { > requestDAO.logRequest(request); > } catch (DAOException daoe) { > logger.error(daoe); > throw new PdfGenerationException(daoe); > } > > docVal = (DocumentValue) documents.get(0); > > if(documents.size() == 1){ > > out.write(getPdf(docVal)); // display > the "Open > Table in Spreadsheet" > > > }else{ > > > // create a pdf reader that reads actual file > reader = new PdfReader(getPdf(docVal)); > > // create a pdf document that will be used to > retrieve pdf details > document = new > Document(reader.getPageSizeWithRotation(1)); > > // create a pdf writer to write file > writer = PdfWriter.getInstance(document, out); > > // add some meta info > document.addAuthor("Prudential Finantial"); > document.addCreator("Prudential Finantial"); > document.addSubject( > "iText Library - Copyright (C) > 1999-2004 by > Bruno Lowagie and Paulo Soares. All Rights Reserved. "); > document.addTitle("Download Pdf"); > > > // open the document once > document.open(); > > // don't know what this does > // somekind of page writer > PdfContentByte cb = writer.getDirectContent(); > //Does not display the "Open Table in Spreadsheet" > > int docIndex = 0; > > // loop on documents > while (true) { > // this is copied from itext > examples, it is > weird > // don't know if it is all needed > > // get number of pages in current doc > int pages = reader.getNumberOfPages(); > > // loop on each page in document > int i = 0; > PdfImportedPage page; > while (i < pages) { > i++; > > document.setPageSize(reader.getPageSizeWithRotation(i)); > document.newPage(); > > // get page from reader > page = > writer.getImportedPage(reader, > i); > int rotation = > reader.getPageRotation(i); > > // think this for pages > that aren't > landscape > // adds actual page to output > if (rotation == 90 || > rotation == 270) > { > cb.addTemplate( > page, > 0, > -1f, > 1f, > 0, > 0, > > reader.getPageSizeWithRotation(i).height()); > } else { > > cb.addTemplate(page, 1f, 0, 0, > 1f, 0, 0); > } > } > > // update index, if just > processed last doc > then stop > ++docIndex; > if (docIndex == documents.size()) > break; > > // get next document for next > pass through > loop > // > // creating a new reader automatically > updates document > docVal = (DocumentValue) > documents.get(docIndex); > reader = new PdfReader(getPdf(docVal)); > } > } > // closing document automatically closes > reader/writer > //document.close(); > } catch (IOException ex) { > logger.error("IOException from iText", ex); > throw new PdfGenerationException(ex, > "IOException from > iText"); > } catch (DocumentException ex) { > logger.error("DocumentException from iText", ex); > throw new PdfGenerationException( > ex, > "DocumentException from iText"); > } finally { > // closing document automatically closes > reader/writer > if (document != null) { > document.close(); > } > } > } > > Can you provide us with solution or with some fix.And does > the "Open Table > in Spreadsheet" in Acrobat 7.0 and above is supported by the > latest version > of iText.jar. > > > > > > Diagram A) > > (Embedded image moved to file: pic20324.pcx) > > > > Diagram B) > > (Embedded image moved to file: pic27465.pcx) > > > Regards > > > Ivan Jathanna > Tel. no. - 7635536164 >
------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
