The PDF SDK for .NET  product has been acquired by Sybrex company in January, 2011 and not available on our web-site anymore.

NEW: Check our new rich PDF reports generator for Javascript (completely client side generation): PDF Generator SDK for Javascriptclick here to read more details...


For 3rd party server side C# open-source PDF generation library?

Check the blog article: .NET Bear, Do You Know Any Free PDF Generation Libraries For Use In Commercial Applications?
 

Our commercial products for PDF format:

PDF Extractor SDK - extract tables, text, structured data from PDF files in your apps

PDF Renderer SDK - render PDF files to PNG, BMP, TIFF images in your apps

PDF To HTML SDK - convert PDF to HTML with images and formatting preserved

How to add bookmarks to PDF document using Bytescout.PDF library for .NET

How to add bookmarks (outlines) to PDF document

This example teaches how to create outlines (bookmarks) tree in PDF document generated by Bytescout.PDF library

bookmarks outlines in PDF document made with Bytescout.PDF component for .NET

Download example source code: bytescoutpdf_outlines_bookmarks.zip (5 KB)

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.PDF;

namespace Outlines
{
class Program
{
static void Main(string[] args)
{
PDFDocEngine engine =
new PDFDocEngine("", "");

// Add new document
Document document = engine.AddDocument();

// Add standard font
uint font = document.AddFontStandard(StandardFontType.Courier, FontEncodingType.Standard);

// Append new pages to the document
Page page = document.AddPage(PageSizeType.A4, PageOrientationType.LandScape);
Page page2 = document.AddPage(PageSizeType.A4, PageOrientationType.LandScape);

// Create new drawing
Drawing drawing = page.AddDrawing();

// Set Active Font
drawing.SetActiveFont(font, 50, false, false);

// Draw Text
drawing.PlaceText(100, 100, 0, "Hello World!");

// Close drawing
drawing.Close();

// Create new drawing
drawing = page2.AddDrawing();

// Set Active Font
drawing.SetActiveFont(font, 50, false, false);

// Draw Text
drawing.PlaceText(100, 100, 0, "Hello again, World!");

// Close drawing
drawing.Close();

// Add root outline
Outline root = document.Outlines.AddChild();
root.Title = "Root";

// Add link to page 1
Outline child = root.AddChild();
child.Title = "Page 1";
child.destination = new Destination(document, "Page1", false);

// Add link to page 2
child = root.AddChild();
child.Title = "Page 2";
child.destination = new Destination(document, "Page2", false);

// Add NamedDestinations to document
document.AddNamedDestination("Page1", Destination.FitPage(0));
document.AddNamedDestination("Page2", Destination.FitPage(1));

// Save document
document.Save("HelloWorld.pdf");
}
}
}

Download example source code: bytescoutpdf_outlines_bookmarks.zip (5 KB)

Filed in: PDF SDK for .NET

Tutorials: