Patagames Software Support Forum
»
Pdfium.Net SDK
»
Common Questions
»
How to create a bookmark which point to external url?
Rank: Newbie
Groups: Registered
Joined: 10/15/2020(UTC) Posts: 8 
|
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 Edited by user Thursday, October 15, 2020 8:08:11 AM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
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);
}
Edited by user Sunday, October 18, 2020 7:43:10 PM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Patagames Software Support Forum
»
Pdfium.Net SDK
»
Common Questions
»
How to create a bookmark which point to external url?
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close