op.bookmarks.addNew.simple

From Tracker Software PDF SDK
Jump to: navigation, search
(Sample)
 
Line 31: Line 31:
 
//Adding two bookmarks to the Bookmarks Root from The Core Level
 
//Adding two bookmarks to the Bookmarks Root from The Core Level
 
PDFXEdit.IPXC_Bookmark Book = Doc.CoreDoc.BookmarkRoot.AddNewChild(true);
 
PDFXEdit.IPXC_Bookmark Book = Doc.CoreDoc.BookmarkRoot.AddNewChild(true);
Book.Color.SetRGB(0.5f, 0.1f, 1.0f);
+
PDFXEdit.IColor color = Book.Color;
 +
color.SetRGB(0.5f, 0.1f, 1.0f);
 +
Book.Color = color;
 
Book.Opened = true;
 
Book.Opened = true;
 
PDFXEdit.IPXC_ActionsList AL = Doc.CoreDoc.CreateActionsList();
 
PDFXEdit.IPXC_ActionsList AL = Doc.CoreDoc.CreateActionsList();

Latest revision as of 06:04, 6 March 2018


Overview

The operation allows to send the notification to all of the listeners that the bookmarks were manually added.

Parameters

Name Type Description
Input Array Array of IUnknown-based objects containing the IPXC_Bookmark objects that need to be updated. Note that all of the bookmarks must belong to one document.
Output Array Array of IUnknown-based objects containing the IPXC_Document of the updated bookmarks. Not yet implemented.

Sample

//C#
private void AddBookmarksFromCoreLevel(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst)
{
	int nID = Inst.Str2ID("op.bookmarks.addNew.simple", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	PDFXEdit.ICabNode input = Op.Params.Root["Input"];
	//Adding two bookmarks to the Bookmarks Root from The Core Level
	PDFXEdit.IPXC_Bookmark Book = Doc.CoreDoc.BookmarkRoot.AddNewChild(true);
	PDFXEdit.IColor color = Book.Color;
	color.SetRGB(0.5f, 0.1f, 1.0f);
	Book.Color = color;
	Book.Opened = true;
	PDFXEdit.IPXC_ActionsList AL = Doc.CoreDoc.CreateActionsList();
	PDFXEdit.PXC_Destination dest = new PDFXEdit.PXC_Destination();
	dest.nPageNum = 0;
	dest.nNullFlags = 15;
	dest.nType = PDFXEdit.PXC_DestType.Dest_XYZ;
	AL.AddGoto(dest);
	Book.Actions = AL;
	Book.Title = "First Bookmark";
	input.Add().v = Book;

	Book = Doc.CoreDoc.BookmarkRoot.AddNewChild(true);
	Book.Style = PDFXEdit.PXC_BookmarkStyle.BookmarkFont_BoldItalic;
	Book.Title = "Last Bookmark";
	input.Add().v = Book;
	//Executing operation from the Editor Level to notify all of the UI items that the bookmarks were added
	Op.Do();
}