  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | Links are lost when pdf is copied | Links are lost when pdf is copied 2005-06-27 - By Nauruhn, Ralph
Back Hello everyone,
I created a pdf with links in it. The links have been created using something like this:
paragraph.add(new Chunk(partWithRef, refFont).setLocalGoto(ref));
The corresponding destinations have been created using something like this:
PdfDestination pdfDestination = new PdfDestination(PdfDestination.XYZ, x, pageHeight - y, 0);
cb.localDestination(destination, pdfDestination);
This works fine for this pdf.
Now in a second step this pdf file (including all pages) is being copied to another one:
PdfImportedPage newPage = writer.getImportedPage(reader, pdfPageNr);
// a .. f will be set here
cb.addTemplate(newPage, a, b, c, d, e, f);
The resulting pdf has all the content off the first pdf except the links. They don�t work anymore? Do I have to come them separately?
Thanks for every hint.
Kind Regards
Ralph
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas -microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head> <meta http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <meta name=Generator content="Microsoft Word 11 (filtered medium)"> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} span.E-MailFormatvorlage17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @(protected) Section1 {size:595.3pt 841.9pt; margin:70.85pt 70.85pt 2.0cm 70.85pt;} div.Section1 {page:Section1;} --> </style>
</head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Hello everyone,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>I created a pdf with links in it. The links have been created using something like this:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>����������� paragraph.add(new Chunk(partWithRef, refFont).setLocalGoto(ref));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>The corresponding destinations have been created using something like this:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>������� PdfDestination pdfDestination = new PdfDestination(PdfDestination.XYZ, x, pageHeight - y, 0);<o:p></o:p></span>< /font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>������� cb.localDestination(destination, pdfDestination);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>This works fine for this pdf.<o:p></o:p></span></font ></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Now in a second step this pdf file (including all pages) is being copied to another one:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>�������� PdfImportedPage newPage = writer.getImportedPage(reader, pdfPageNr);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>�������� // a .. f will be set here<o:p></o:p></span> </font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>�������� cb.addTemplate(newPage, a, b, c, d, e, f);<o :p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>The resulting pdf has all the content off the first pdf except the links. They don�t work anymore? Do I have to come them separately?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Thanks for every hint.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Kind Regards<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>� Ralph<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
|
|
 |