PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu May 13, 2021 8:20 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Bookmarks
PostPosted: Mon Feb 26, 2007 7:25 pm 
Offline

Joined: Mon Feb 26, 2007 7:19 pm
Posts: 1
Hi,
I am trying to set a bookmark using migra doc lite.
The code below does not set a bookmark and it doesnt add a hyperlink field.
I dont need a hyperlink field, but it has a bookmark property so i thought it might do the trick.
Please review the code below, thanks in advance.

-Edward

Code:
    Private Function SetDocument_Properties(ByVal iInvNum As Integer) As Document
        SetDocument_Properties = New Document
        Dim p As Paragraph

        With SetDocument_Properties
            With .Info
                .Title = "Packing Slips"
                .Subject = "Packing Slips"
                .Author = "SPI"
            End With

            .AddSection()
            With .LastSection
                p = .AddParagraph
                With p
                    .AddBookmark(iInvNum.ToString)
                    .AddText(iInvNum.ToString)
                    .AddHyperlink(iInvNum.ToString, HyperlinkType.Bookmark)
                End With
            End With
        End With
    End Function


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 08, 2007 11:48 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
You use hyperlink not correctly.
See in sample HelloMigraDoc how the table of content is created. This illustrates the connection between bookmarks and hyperlinks and how to use them.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group