op.search

From PDF XChange PDF SDK
Revision as of 07:00, 20 January 2017 by Palamar (Talk | contribs)

Jump to: navigation, search


Overview

The operation allows searching for words/phrases in the given folder or document(s).

Parameters

Name Type Description
Input Array Array of IUnknown-based objects containing either a folder with documents that will be searched through or documents that will be used for words/phrases search.
Output Array Not used.
Options Dictionary Dictionary with options of the operation.

Sample

//C#
public class SearchCallback : PDFXEdit.IPXV_SearchCallback
{
	public void OnFinish(int nResCode)
	{
				
	}

	public void OnNewEntry(PDFXEdit.IPXV_SearchEntry pEntry)
	{
		for (uint i = 0; i < pEntry.Count; i++)
		{
			PDFXEdit.IPXV_SearchEntryItem item = pEntry[i];
			if (item != null)
			{
				//item.Ptr
				//http://sdkhelp.tracker-software.com/view/PXV:IPXV_SearchPtr
			}
		}
	}

	public void OnStart()
	{
	
	}

	public void OnStartPtr(PDFXEdit.IPXV_SearchPtr pPtr)
	{
				
	}

	public void OnStopPtr(PDFXEdit.IPXV_SearchPtr pPtr, bool bIncomplete)
	{
				
	}
}

private void SearchOperation(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst)
{
	int nID = Inst.Str2ID("op.search", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	PDFXEdit.ICabNode input = Op.Params.Root["Input"];
	input.Add().v = Doc.CoreDoc;
	PDFXEdit.ICabNode options = Op.Params.Root["Options"];
	options["AND"].Add().v = "stream";
	options["AND"].Add().v = "is";
	options["AND"].Add().v = "defined";
	SearchCallback clbk = new SearchCallback();
	options["Callback"].v = clbk;
	Op.Do();
}