Hi Itext:
Here is the dictionanary of annot annot[/Type, /Border, /Dest, /Subtype, /Rect] I wrote the following code to change the links with http://msn.com . It works fine but its changing the architecture of PDF and creating issue when i am using this PDF in SWFTools for conversion . ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// PdfReader reader=new PdfReader("c:\\temp\\UserGuide.pdf"); reader.consolidateNamedDestinations(); Document doc=new Document(reader.getPageSizeWithRotation(1)); PdfCopy copy=new PdfCopy(doc, new FileOutputStream("c:\\temp\\UserGuideCopied.pdf")); doc.open(); for (int i=1; i <= reader.getNumberOfPages() ;i++) { PdfDictionary pageDic = reader.getPageN(i); // Gets all the annots in the page if (pageDic.get(PdfName.ANNOTS) != null) { PdfArray annots = (PdfArray)PdfReader.getPdfObject(pageDic.get(PdfName.ANNOTS)); ArrayList arr = annots.getArrayList(); for (int j = 0; j < arr.size(); ++j) { PdfDictionary annot = (PdfDictionary)PdfReader.getPdfObjectRelease((PdfObject)arr.get(j)); // if finds a link... System.out.println("annot"+annot.getKeys()); if (PdfName.LINK.equals(annot.get(PdfName.SUBTYPE))) { System.out.println("In the Condition of Link Page:"+ i); PdfAction action = new PdfAction("http://www.msn.com"); annot.remove(PdfName.DEST); annot.putEx(PdfName.DEST, new PdfAction("http://www.msn.com")); } } } copy.addPage(copy.getImportedPage(reader, i)); } copy.close(); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// please tell me what to modify? :,( 1T3XT info wrote: > > Vj Ali wrote: >> Hi Itext, >> Is there any way to change the internal destinations of the links to some >> external url destination for example "http://<pageno>.com" and opens it >> as >> the external link. > > Yes, but it would take to long to explain. > I could write an example, but I don't have the time to do this for free. > -- > This answer is provided by 1T3XT BVBA > http://www.1t3xt.com/ - http://www.1t3xt.info > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.itextpdf.com/book/ > Check the site with examples before you ask questions: > http://www.1t3xt.info/examples/ > You can also search the keywords list: > http://1t3xt.info/tutorials/keywords/ > > -- View this message in context: http://old.nabble.com/Split-PDF-File-with-Working-Links-tp28238502p28483341.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
