op.openDoc

From PDF XChange PDF SDK
Jump to: navigation, search
(Parameters)
 
(2 intermediate revisions by the same user not shown)
Line 15: Line 15:
 
| 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:IAFS_Name|IAFS_Name]], [[PXV:IAFS_File|IAFS_File]]) that will have it's open document.
+
| <code>IUnknown</code>-based object containing the ([[PXV:IAFS_Name|IAFS_Name]], [[PXV:IAFS_File|IAFS_File]], [[PXV:IString|IString]]) that will have it's open document.
 
|-
 
|-
 
| class="op_param_name" | Output
 
| class="op_param_name" | Output
Line 25: Line 25:
 
| Dictionary with options of the operation.
 
| Dictionary with options of the operation.
 
|}
 
|}
 +
 +
== Sample ==
 +
<pre class="brush:c#">//C#
 +
private void OpenDocument(PDFXEdit.IPXV_MainFrame mainFrm, PDFXEdit.IPXV_Inst Inst)
 +
{
 +
int nID = Inst.Str2ID("op.openDoc", false);
 +
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
 +
PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS");
 +
PDFXEdit.IAFS_Name name = fsInst.DefaultFileSys.StringToName(@"D:\TestFile.pdf");
 +
var input = Op.Params.Root["Input"];
 +
input.v = name;
 +
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
 +
options["NativeOnly"].v = true;
 +
Op.Do();
 +
PDFXEdit.IPXC_Document doc = (PDFXEdit.IPXC_Document)Op.Params.Root["Output"].v;
 +
//Opening document in the given main Frame
 +
mainFrm.OpenDocFrom(doc);
 +
}
 +
</pre>

Latest revision as of 03:02, 19 January 2017


Overview

The operation allows to open documents in the Editor Control from the given files.

Parameters

Name Type Description
Input IUnknown IUnknown-based object containing the (IAFS_Name, IAFS_File, IString) that will have it's open document.
Output IUnknown IUnknown-based object containing the (IAFS_Name, IAFS_File) that had it's open document.
Options Dictionary Dictionary with options of the operation.

Sample

//C#
private void OpenDocument(PDFXEdit.IPXV_MainFrame mainFrm, PDFXEdit.IPXV_Inst Inst)
{
	int nID = Inst.Str2ID("op.openDoc", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS");
	PDFXEdit.IAFS_Name name = fsInst.DefaultFileSys.StringToName(@"D:\TestFile.pdf");
	var input = Op.Params.Root["Input"];
	input.v = name;
	PDFXEdit.ICabNode options = Op.Params.Root["Options"];
	options["NativeOnly"].v = true;
	Op.Do();
	PDFXEdit.IPXC_Document doc = (PDFXEdit.IPXC_Document)Op.Params.Root["Output"].v;
	//Opening document in the given main Frame
	mainFrm.OpenDocFrom(doc);
}