op.document.OCRPages

From PDF XChange PDF SDK
Jump to: navigation, search
(Sample)
Line 32: Line 32:
 
{
 
{
 
int nID = Inst.Str2ID("op.document.OCRPages", false);
 
int nID = Inst.Str2ID("op.document.OCRPages", false);
PDFXEdit.IOperation pOp = Inst.CreateOp(nID);
+
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
+
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
 
input.v = Doc;
 
input.v = Doc;
PDFXEdit.ICabNode options = pOp.Params.Root["Options"];
+
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
 
options["PagesRange.Type"].v = "All"; //OCR all pages
 
options["PagesRange.Type"].v = "All"; //OCR all pages
 
options["OutputType"].v = 0;
 
options["OutputType"].v = 0;
 
options["OutputDPI"].v = 300;
 
options["OutputDPI"].v = 300;
Inst.AsyncDoAndWaitForFinish(pOp);
+
Inst.AsyncDoAndWaitForFinish(Op);
 
}
 
}
 
</pre>
 
</pre>

Revision as of 01:18, 19 April 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 OCRPages(PDFXEdit.IPXV_Inst Inst, PDFXEdit.IPXV_Document Doc)
{
	int nID = Inst.Str2ID("op.document.OCRPages", 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 = "All"; //OCR all pages
	options["OutputType"].v = 0;
	options["OutputDPI"].v = 300;
	Inst.AsyncDoAndWaitForFinish(Op);
}