op.document.insertPages
From PDF XChange PDF SDK
(Automatic page editing by robot) |
(→Sample) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
{{#customTitle:op.document.insertPages}} | {{#customTitle:op.document.insertPages}} | ||
{{#parentPage:PXV:Operations|op.document.insertPages|operation}} | {{#parentPage:PXV:Operations|op.document.insertPages|operation}} | ||
− | |||
{{ToReview}} | {{ToReview}} | ||
== Overview == | == Overview == | ||
− | The operation overview | + | The operation overview allows you to insert pages into the current document from another PDF document. |
== Parameters == | == Parameters == | ||
Line 15: | Line 14: | ||
|- | |- | ||
| class="op_param_name" | Input | | class="op_param_name" | Input | ||
− | | style="text-align:center" | | + | | style="text-align:center" | IUnknown |
− | | | + | | <code>IUnknown</code>-based object containing the [[PXV:IPXC_Document|IPXC_Document]] that will have it's pages changed. |
|- | |- | ||
| class="op_param_name" | Output | | class="op_param_name" | Output | ||
− | | style="text-align:center;" | | + | | style="text-align:center;" | IUnknown |
− | | | + | | <code>IUnknown</code>-based object containing the [[PXV:IPXC_Document|IPXC_Document]] that had it's pages changed. |
|- | |- | ||
| class="op_param_name" | [[PXV:op_document_insertPages_Options|Options]] | | class="op_param_name" | [[PXV:op_document_insertPages_Options|Options]] | ||
Line 26: | Line 25: | ||
| 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 Op = Inst.CreateOp(nID); | ||
+ | PDFXEdit.ICabNode input = Op.Params.Root["Input"]; | ||
+ | input.v = Doc; | ||
+ | PDFXEdit.ICabNode options = Op.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 | ||
+ | Op.Do(); | ||
+ | } | ||
+ | </pre> |
Latest revision as of 01:05, 19 April 2016
Overview
The operation overview allows you to insert pages into the current document from another PDF document.
Parameters
Name | Type | Description |
---|---|---|
Input | IUnknown | IUnknown -based object containing the IPXC_Document that will have it's pages changed.
|
Output | IUnknown | IUnknown -based object containing the IPXC_Document that had it's pages changed.
|
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 Op = Inst.CreateOp(nID); PDFXEdit.ICabNode input = Op.Params.Root["Input"]; input.v = Doc; PDFXEdit.ICabNode options = Op.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 Op.Do(); }