op.document.insertPages
From PDF XChange PDF SDK
(Automatic page editing by robot) |
|||
Line 26: | Line 26: | ||
| Dictionary with options of the operation. | | Dictionary with options of the operation. | ||
|} | |} | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//C# | ||
+ | private void InsertPages(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst) | ||
+ | { | ||
+ | int nID = Inst.Str2ID("op.document.insertPages", false); | ||
+ | PDFXEdit.IOperation pOp = Inst.CreateOp(nID); | ||
+ | PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | ||
+ | input.v = Doc; | ||
+ | PDFXEdit.ICabNode options = pOp.Params.Root["Options"]; | ||
+ | //Creating IAFS_Name path from string path | ||
+ | PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS"); | ||
+ | PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestFile.pdf"); | ||
+ | options["Position"].v = 0; //First page | ||
+ | options["Location"].v = "Before"; //The pages will be inserted before first page | ||
+ | options["CommentsAction"].v = "Copy"; //Copy all comments | ||
+ | options["FieldsAction"].v = "Copy"; //Copy all fields | ||
+ | options["BookmarksAction"].v = "CopyRelated"; //Copy bookmarks that are related to the inserted pages | ||
+ | options["Src"].v = destPath; //Source document | ||
+ | options["PagesRange.Type"].v = "Exact"; | ||
+ | options["PagesRange.Text"].v = "1-3"; //Select pages range that will be deleted from the document | ||
+ | pOp.Do(); | ||
+ | } | ||
+ | </pre> |
Revision as of 05:21, 9 January 2016
Overview
The operation overview...
Parameters
Name | Type | Description |
---|---|---|
Input | Array | Array of IUnknown -based objects.
|
Output | Array | Array of IUnknown -based objects.
|
Options | Dictionary | Dictionary with options of the operation. |
Sample
//C# private void InsertPages(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst) { int nID = Inst.Str2ID("op.document.insertPages", false); PDFXEdit.IOperation pOp = Inst.CreateOp(nID); PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; input.v = Doc; PDFXEdit.ICabNode options = pOp.Params.Root["Options"]; //Creating IAFS_Name path from string path PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS"); PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestFile.pdf"); options["Position"].v = 0; //First page options["Location"].v = "Before"; //The pages will be inserted before first page options["CommentsAction"].v = "Copy"; //Copy all comments options["FieldsAction"].v = "Copy"; //Copy all fields options["BookmarksAction"].v = "CopyRelated"; //Copy bookmarks that are related to the inserted pages options["Src"].v = destPath; //Source document options["PagesRange.Type"].v = "Exact"; options["PagesRange.Text"].v = "1-3"; //Select pages range that will be deleted from the document pOp.Do(); }