My code like this
PdfCopy pdfCopy = new PdfCopy(document, output);
document.open();
for (int n = 1; n <= reader.getNumberOfPages(); n++) {
PdfImportedPage importedPage =
pdfCopy.getImportedPage(reader,
n);
if (n == pageNum) {
PdfDestination dest = new
PdfDestination(
PdfDestination.FITH,
left, top, 0);
//
pdfCopy.addNamedDestination(word.toUpperCase(), n, dest);
stamp =
pdfCopy.createPageStamp(importedPage);
PdfContentByte cb =
stamp.getUnderContent();
Chunk chunk = new
Chunk(StringUtils.leftPad("\u00a0",
chars.intValue() * 2));
chunk.setLocalDestination(word);
chunk.setBackground(BaseColor.LIGHT_GRAY);
Phrase phrase = new Phrase(chunk);
ColumnText.showTextAligned(cb,
Element.ALIGN_LEFT, phrase,
left, top, 0);
stamp.alterContents();
}
pdfCopy.addPage(importedPage);
}
document.close();
But only the latest saved destination can be find. How can save more
destination for same page or other page?
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Add-named-destination-to-existed-pdf-tp4657219.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
iText-questions mailing list
[email protected]
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