logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Sunday, October 18, 2020 7:18:37 PM(UTC)
 
Code:

using(var doc = PdfDocument.CreateNew())
{
    var page = doc.Pages.InsertPageAt(0, 500, 500);

    //Create a file specification for the target document.
    var fileSpec = new PdfFileSpecification(doc);
    fileSpec.FileName = @"e:\0\1GB\test_big.pdf";

    //create destination in remote document
    var dest = new PdfDestination(doc);
    dest.IsSameDocument = false;
    dest.PageIndex = 99;

    //create a new bookmark (the bookmark will target the current document)
    var bookmark = doc.Bookmarks.InsertAt(0, "Title", page);

    //Create action dictionary
    var action = PdfTypeDictionary.Create();
    //Action type
    action["S"] = PdfTypeName.Create("GoToR");
    //file specification
    action["F"] = fileSpec.Dictionary;
    //destination in remote document
    action["D"] = PdfTypeArray.Create(dest.Handle);

    //set an action to a bookmark.
    bookmark.Dictionary["A"] = action;
    //remove the old destination from the bookmark.
    bookmark.Dictionary.Remove("Dest");

    doc.Save(@"e:\80\test.pdf", SaveFlags.NoIncremental);
}    
lugangxyz Posted: Thursday, October 15, 2020 8:07:25 AM(UTC)
 
Hi there
I need to create a bookmark which point to a external url
From what I learned so far, seems I need to create a pdfAction(with externl uri) for this
But then I found that with PdfBookmark I can not change the pdfaction propety directlly

So is there a way which I can create a bookmark(link to external pdf file) from pdfium net?

Thanks in advance