op.bookmarks.addNew.simple
From PDF XChange PDF SDK
Line 21: | Line 21: | ||
| Array of <code>IUnknown</code>-based objects containing the [[PXV:IPXC_Document|IPXC_Document]] of the updated bookmarks. Not yet implemented. | | Array of <code>IUnknown</code>-based objects containing the [[PXV:IPXC_Document|IPXC_Document]] of the updated bookmarks. Not yet implemented. | ||
|} | |} | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//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); | ||
+ | Book.Color.SetRGB(0.5f, 0.1f, 1.0f); | ||
+ | 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(); | ||
+ | } | ||
+ | </pre> |
Revision as of 04:41, 18 April 2016
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); Book.Color.SetRGB(0.5f, 0.1f, 1.0f); 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(); }