|
Hello,
When I attach a file (pdf/word/png) It works fine and via the attachment pane I can open all these files by clicking on it. However when cliking in the text on the "link" it only works for pdf files. All other files do not open by clicking the link. No error message is given nothing happens I searched the web , the book without finding a solution Can somebody help my code (a method I wrote) public static Paragraph add_attachement_to_paragraph_gotoaction(String filename,String dirpath,String description ,PdfWriter fdfwr) throws IOException { PdfTargetDictionary target; PdfDestination dest; Chunk chunk; PdfAction action = null; PdfFileSpecification fs; Paragraph p; dest =new PdfDestination(PdfDestination.FIT); dest.addFirst(new PdfNumber(0)); fs = PdfFileSpecification.fileEmbedded(fdfwr,dirpath + "\\" + filename, filename, null); fs.addDescription(description,false); fdfwr.addFileAttachment(fs); target = new PdfTargetDictionary(true); target.setEmbeddedFileName(description); action = PdfAction.gotoEmbedded(null, target, dest, true); chunk = new Chunk(" " +filename); chunk.setAction(action); p = new Paragraph("",verysmallblue); p.setSpacingAfter(5f); p.add(chunk); p.add("."); return p; } |
|
Hi Herman,
You've posted your question already 3 times on this list, in less that 3 hours. Please wait for an answer, I'm sure it will come soon. If you want to add extra information to your question, please reply to your own thread instead of creating a new one. Cheers, alexis On 31 May 2012 11:37, bou <[hidden email]> wrote: Hello, ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ iText-questions mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php |
|
In reply to this post by bou
Correct, the GoToE action (which is what you are using) only works with
PDF files. You will need to use a Launch action for the other formats. Leonard On 5/31/12 5:37 AM, "bou" <[hidden email]> wrote: >Hello, > > >When I attach a file (pdf/word/png) It works fine and via the attachment >pane I can open all these files by clicking on it. > >However when cliking in the text on the "link" it only works for pdf >files. >All other files do not open by clicking the link. No error message is >given >nothing happens > >I searched the web , the book without finding a solution >Can somebody help > > > >my code (a method I wrote) > >public static Paragraph add_attachement_to_paragraph_gotoaction(String >filename,String dirpath,String description ,PdfWriter fdfwr) throws >IOException { > > PdfTargetDictionary target; > PdfDestination dest; > Chunk chunk; > PdfAction action = null; > PdfFileSpecification fs; > Paragraph p; > dest =new PdfDestination(PdfDestination.FIT); > dest.addFirst(new PdfNumber(0)); > fs = PdfFileSpecification.fileEmbedded(fdfwr,dirpath + "\\" + filename, >filename, null); > fs.addDescription(description,false); > fdfwr.addFileAttachment(fs); > target = new PdfTargetDictionary(true); > target.setEmbeddedFileName(description); > action = PdfAction.gotoEmbedded(null, target, dest, true); > chunk = new Chunk(" " +filename); > chunk.setAction(action); > p = new Paragraph("",verysmallblue); > p.setSpacingAfter(5f); > p.add(chunk); > p.add("."); > return p; > > } > >-- >View this message in context: >http://itext-general.2136553.n4.nabble.com/opening-an-attachment-via-a-lin >k-in-the-text-tp4655200.html >Sent from the iText - General mailing list archive at Nabble.com. > >-------------------------------------------------------------------------- >---- >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >iText-questions mailing list >[hidden email] >https://lists.sourceforge.net/lists/listinfo/itext-questions > >iText(R) is a registered trademark of 1T3XT BVBA. >Many questions posted to this list can (and will) be answered with a >reference to the iText book: http://www.itextpdf.com/book/ >Please check the keywords list before you ask for examples: >http://itextpdf.com/themes/keywords.php ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ iText-questions mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php |
| Powered by Nabble | Edit this page |
