op.document.replacePages
From PDF XChange PDF SDK
(→Sample) |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
{{#customTitle:op.document.replacePages}} | {{#customTitle:op.document.replacePages}} | ||
{{#parentPage:PXV:Operations|op.document.replacePages|operation}} | {{#parentPage:PXV:Operations|op.document.replacePages|operation}} | ||
− | + | ||
{{ToReview}} | {{ToReview}} | ||
== Overview == | == Overview == | ||
− | The operation allows you to replace a part of an active PDF document with a part of already opened PDF document or located in a destination folder file all supported formats. | + | The operation allows you to replace content a part of an active PDF document with a part of already opened PDF document or located in a destination folder file all supported formats. |
== Parameters == | == Parameters == | ||
Line 16: | Line 16: | ||
| class="op_param_name" | Input | | class="op_param_name" | Input | ||
| style="text-align:center" | IUnknown | | style="text-align:center" | IUnknown | ||
− | | <code>IUnknown</code>-based object containing the [[PXV:IPXC_Document|IPXC_Document]] | + | | <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;" | IUnknown | | style="text-align:center;" | IUnknown | ||
− | | <code>IUnknown</code>-based object containing the [[PXV:IPXC_Document|IPXC_Document]] | + | | <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_replacePages_Options|Options]] | | class="op_param_name" | [[PXV:op_document_replacePages_Options|Options]] | ||
Line 26: | Line 26: | ||
| Dictionary with options of the operation. | | Dictionary with options of the operation. | ||
|} | |} | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//C# | ||
+ | private void ReplacePages(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst) | ||
+ | { | ||
+ | int nID = Inst.Str2ID("op.document.replacePages", false); | ||
+ | PDFXEdit.IOperation Op = Inst.CreateOp(nID); | ||
+ | PDFXEdit.ICabNode input = Op.Params.Root["Input"]; | ||
+ | input.v = Doc; | ||
+ | PDFXEdit.ICabNode options = Op.Params.Root["Options"]; | ||
+ | options["PagesRange.Type"].v = "Exact"; | ||
+ | options["PagesRange.Text"].v = "1-3"; //Selecting 1,2,3 pages from file | ||
+ | options["CommentsAction"].v = 0; //Don't copy comments | ||
+ | options["BookmarksAction"].v = 0; //Don`t copy bookmarks | ||
+ | options["Position"].v = 1; //Start index of the source pages that will replace the document's pages | ||
+ | options["PositionStop"].v = 3; //End index of the source pages that will replace the document's pages | ||
+ | PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS"); | ||
+ | PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestFile.pdf"); //Converting string to name | ||
+ | options["Src"].v = destPath; //Source document | ||
+ | Op.Do(); | ||
+ | } | ||
+ | </pre> |
Latest revision as of 06:48, 20 April 2016
Overview
The operation allows you to replace content a part of an active PDF document with a part of already opened PDF document or located in a destination folder file all supported formats.
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 ReplacePages(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst) { int nID = Inst.Str2ID("op.document.replacePages", false); PDFXEdit.IOperation Op = Inst.CreateOp(nID); PDFXEdit.ICabNode input = Op.Params.Root["Input"]; input.v = Doc; PDFXEdit.ICabNode options = Op.Params.Root["Options"]; options["PagesRange.Type"].v = "Exact"; options["PagesRange.Text"].v = "1-3"; //Selecting 1,2,3 pages from file options["CommentsAction"].v = 0; //Don't copy comments options["BookmarksAction"].v = 0; //Don`t copy bookmarks options["Position"].v = 1; //Start index of the source pages that will replace the document's pages options["PositionStop"].v = 3; //End index of the source pages that will replace the document's pages PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS"); PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestFile.pdf"); //Converting string to name options["Src"].v = destPath; //Source document Op.Do(); }