Hi support,
Please take a look on the following code and note that, at runtime, the document cannot be saved :
Pdf pdf1 = new Pdf();
Section sec1 = pdf1.getSections().add();
Text text1 = new Text(sec1);
Segment segment1 = text1.getSegments().add(“link1”); //$NON-NLS-1$
segment1.getTextInfo().setUnderLine(true);
segment1.setHyperLink(new HyperLinkToLocalPdf(“bmk1”)); //$NON-NLS-1$
sec1.getParagraphs().add(text1);
Table table = new Table(sec1);
//add a row
Row row1 = new Row(table);
table.getRows().add(row1);
Cell cell11 = row1.getCells().add();
Text txt = new Text(cell11);
cell11.getParagraphs().add(txt);
txt.getSegments().add(new Segment(txt, “A”)); //$NON-NLS-1$
Segment seg = new Segment(txt, " "); //$NON-NLS-1$
seg.setID(“bmk1”); //$NON-NLS-1$
txt.getSegments().add(seg);
//Segment seg1 = new Segment(txt, “B”); //$NON-NLS-1$
//txt.getSegments().add(seg1);
sec1.getParagraphs().add(table);
try
{
FileOutputStream out = new FileOutputStream(new File(“C:/Temp/HyperlinkBug.pdf”));
pdf1.save(out);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
If you delete the comments for adding the “B” segment, the document is saved.
Please advice,
Milan