Hi
I write this code to create new document from existing document
everything fine but bookmark not transfer to new document
please help
Code:
try
{
PdfDocument maindoc = PdfReader.Open(InputFile, PdfDocumentOpenMode.Import);
PdfDocument OutputDoc = new PdfDocument();
foreach (PdfPage page in maindoc.Pages)
{
OutputDoc.AddPage(page);
}
foreach (PdfOutline outline in maindoc.Outlines)
{
OutputDoc.Outlines.Add(outline);
}
maindoc.Dispose();
OutputDoc.Dispose();
OutputDoc.Save(outputFile);
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}