op.document.redact
From PDF XChange PDF SDK
(Automatic page editing by robot) |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
{{#customTitle:op.document.redact}} | {{#customTitle:op.document.redact}} | ||
{{#parentPage:PXV:Operations|op.document.redact|operation}} | {{#parentPage:PXV:Operations|op.document.redact|operation}} | ||
− | |||
{{ToReview}} | {{ToReview}} | ||
== Overview == | == Overview == | ||
− | + | This operation allows to permanently remove text and graphics, marked by Redaction annotations, from the document's content. | |
== Parameters == | == Parameters == | ||
Line 16: | Line 15: | ||
| class="op_param_name" | Input | | class="op_param_name" | Input | ||
| style="text-align:center" | Array | | style="text-align:center" | Array | ||
− | | Array of <code>IUnknown</code>-based objects. | + | | Array of <code>IUnknown</code>-based objects containing the [[PXV:IPXC_Annotation|Redaction Annotation]] items that will be used to apply redaction. |
|- | |- | ||
| class="op_param_name" | Output | | class="op_param_name" | Output | ||
| style="text-align:center;" | Array | | style="text-align:center;" | Array | ||
− | | Array of <code>IUnknown</code>-based objects. | + | | Array of <code>IUnknown</code>-based objects. Not used. |
|- | |- | ||
| class="op_param_name" | [[PXV:op_document_redact_Options|Options]] | | class="op_param_name" | [[PXV:op_document_redact_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 ApplyRedaction(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) | ||
+ | { | ||
+ | PDFXEdit.IPXS_Inst pSInt = (PDFXEdit.IPXS_Inst)Inst.GetExtension("PXS"); | ||
+ | uint nRedactAtom = pSInt.StrToAtom("Redact"); | ||
+ | int nID = Inst.Str2ID("op.document.redact", false); | ||
+ | PDFXEdit.IOperation Op = Inst.CreateOp(nID); | ||
+ | var input = Op.Params.Root["Input"]; | ||
+ | //Going through all of the pages and gathering the redaction annotation list | ||
+ | for (uint i = 0; i < Doc.CoreDoc.Pages.Count; i++) | ||
+ | { | ||
+ | PDFXEdit.IPXC_Page page = Doc.CoreDoc.Pages[i]; | ||
+ | for (uint j = 0; j < page.GetAnnotsCount(); j++) | ||
+ | { | ||
+ | PDFXEdit.IPXC_Annotation annot = page.GetAnnot(j); | ||
+ | if (annot.Type == nRedactAtom) | ||
+ | { | ||
+ | input.Add().v = annot; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | PDFXEdit.ICabNode options = Op.Params.Root["Options"]; | ||
+ | options["Flags"].v = 4; | ||
+ | Op.Do(); | ||
+ | } | ||
+ | </pre> |
Latest revision as of 04:16, 14 April 2017
Overview
This operation allows to permanently remove text and graphics, marked by Redaction annotations, from the document's content.
Parameters
Name | Type | Description |
---|---|---|
Input | Array | Array of IUnknown -based objects containing the Redaction Annotation items that will be used to apply redaction.
|
Output | Array | Array of IUnknown -based objects. Not used.
|
Options | Dictionary | Dictionary with options of the operation. |
Sample
//C# private void ApplyRedaction(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) { PDFXEdit.IPXS_Inst pSInt = (PDFXEdit.IPXS_Inst)Inst.GetExtension("PXS"); uint nRedactAtom = pSInt.StrToAtom("Redact"); int nID = Inst.Str2ID("op.document.redact", false); PDFXEdit.IOperation Op = Inst.CreateOp(nID); var input = Op.Params.Root["Input"]; //Going through all of the pages and gathering the redaction annotation list for (uint i = 0; i < Doc.CoreDoc.Pages.Count; i++) { PDFXEdit.IPXC_Page page = Doc.CoreDoc.Pages[i]; for (uint j = 0; j < page.GetAnnotsCount(); j++) { PDFXEdit.IPXC_Annotation annot = page.GetAnnot(j); if (annot.Type == nRedactAtom) { input.Add().v = annot; } } } PDFXEdit.ICabNode options = Op.Params.Root["Options"]; options["Flags"].v = 4; Op.Do(); }