op.openDoc

From PDF XChange PDF SDK
Jump to: navigation, search


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

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