Hi Support,
How do I read a bookmark node from an existing document? Can I have a code snippet?
Regards,
Dhivya.
Reading Bookmarks
Re: Reading Bookmarks
Support · Nov 24, 2006Hello Dhivya,
Reading any information from existing bookmarks is not possible using our products. Our DynamicPDF Merger product have the ability to add new Bookmarks and to preserve and existing Bookmarks but there is no way to read the text of the bookmark or the pagenumber it exist on.
Thanks,
ceTe Software Support Team.
Re: Reading Bookmarks
Forum member · Nov 24, 2006Hi Support,
Thanks for the quick response. :)
Regards,
Dhivya
Re: Reading Bookmarks
Forum member · Dec 30, 2008Just wondering if the ability to access an existing bookmark is available yet? I see from this post that it was not available in 2006.
"Reading any information from existing bookmarks is not possible using our products. Our DynamicPDF Merger product have the ability to add new Bookmarks and to preserve and existing Bookmarks but there is no way to read the text of the bookmark or the pagenumber it exist on."
I am looking for a PDF viewer that will allow me to programmatically access/display a bookmarked page. Is this possible?
Thanks
Re: Reading Bookmarks
Support · Dec 30, 2008Hello,
Yes, it is possible to read the outlines and bookmarks of an existing PDF document using our latest version v5.0 of our product. You can read using the PdfOutlineList class. Following is a sample code for this.
static void Main(string[] args)
{
Document document = OutlinePageNums();
document.Draw( "HelloWorld.pdf" );
Console.ReadLine();
}
public static Document OutlinePageNums()
{
PdfDocument pdfDocument = new PdfDocument(@"C:\Temp\AllPageElements.pdf");
if (pdfDocument.Outlines != null) OutputOutlines(pdfDocument.Outlines);
return new MergeDocument(pdfDocument);
}
public static void OutputOutlines(PdfOutlineList outlines)
{
for (int i = 0; i < outlines.Count; i++)
{
OutputOutline(outlines[i]);
}
}
public static void OutputOutline(PdfOutline outline)
{
Console.WriteLine(outline.Text + " : " + outline.TargetPageNumber);
if (outline.ChildOutlines != null && outline.ChildOutlines.Count > 0) OutputOutlines(outline.ChildOutlines);
}
Thanks,
ceTe Software Support Team.
Re: Reading Bookmarks
Forum member · Dec 30, 2008Thank you for your prompt reply. Do you have sample code for VB6?
Thanks again.
Re: Reading Bookmarks
Support · Dec 30, 2008Hello,
The ability to read the bookmarks is a feature we added in v5.0 of our product. The COM/ActiveX product is now in version v4.0. So this feature is not available in COM product. We are working in developing the v5.0 of COM product and this feature will be added in v5.0. But we are not have any timeframe for its release as of now.
Thanks,
ceTe Software Support Team.
Re: Reading Bookmarks
Forum member · Dec 31, 2008Thanks. I am new to PDF and did not understand that bookmarks and outlines are the same. The sample code you provided helped me to understand this connection. I downloaded your pdf viewer (DynamicPDF Viewer v 1.0 Evaluation Edition) and found that I am able to open a pdf and navigate to a bookmark/outline using the GetOutline... methods with VB6. I will continue to evaluate this but so far it looks good. Thanks again for your help.