Thanks for those tips but when i create an outline using the copy it doesn't
appear on the pdf, the code sample is the following:
Document d = new Document(reader.getPageSizeWithRotation(1));
PdfCopy copy = new PdfCopy(d, new
FileOutputStream("C:/rapportcopy_" +
app.getTitle().replace(" ", "") + ".pdf"));
copy.setPageEvent(index);
d.open();
for (int i = 1; i <= reader.getNumberOfPages(); i++)
{
copy.addPage(copy.getImportedPage(reader, i));
}
PdfReader reader2 = new PdfReader(baos.toByteArray());
for (int i = 1; i <= reader2.getNumberOfPages(); i++)
{
copy.addPage(copy.getImportedPage(reader2, i));
}
d.close();
copy.close();
and in the events:
public void onChapter(PdfWriter arg0, Document arg1, float arg2, Paragraph
arg3)
{
try
{
PdfContentByte cb = arg0.getDirectContent();
PdfOutline root = cb.getRootOutline();
PdfDestination destination = new
PdfDestination(PdfDestination.FITH,
arg2);
//cb.localDestination(arg3.getContent(), destination);
new PdfOutline(root,
PdfAction.gotoLocalPage(arg3.getContent(),false), arg3.getContent());
}
}
catch (DocumentException e)
{
e.printStackTrace();
}
}
--
View this message in context:
http://www.nabble.com/Links-doesn%27t-work-when-concatenating-pdfs-tp17557087p17648884.html
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar