I'm calling this command "cmd.bookmarksView.pages.extract" to extract selected bookmark pages .
In the dialog that pops up, we need to change some default values, so users dont need to change them later.
I found some code on the forum for CropPages, and adapted that code to create this class:
Code: Select all
public partial class ExtractPagesEventMonitor : IUIX_EventMonitor
{
private int m_nID = 0;
public ExtractPagesEventMonitor(int nID)
{
m_nID = nID;
}
public void OnEventMonitor(IUIX_Obj pTarget, IUIX_Event pEvent)
{
if (pEvent.Code == (uint)UIX_EventCodes.e_ShowModal)
{
IntPtr outPtr;
pTarget.QueryImpl(typeof(IUIX_Dialog).GUID, null, out outPtr);
IUIX_Dialog dlg = (IUIX_Dialog)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
if (dlg == null)
return;
if (dlg.ID != m_nID)
return;
//dlg.CheckItem("RangeCtl.Current", 1, true);
//dlg.CheckItem("crop.Redaction", 1, true);
}
}
}
And then I created the code for calling the dialog:
Code: Select all
ExtractPagesEventMonitor extractPages = new ExtractPagesEventMonitor(pdfCtl.Inst.Str2ID(""));
uiInst.CurrentThreadCtx.RegisterEventMonitor(extractPages);
pdfCtl.Inst.ExecUICmd2("cmd.bookmarksView.pages.extract");
uiInst.CurrentThreadCtx.UnregisterEventMonitor(extractPages);
I now need to know what to put here:
Code: Select all
ExtractPagesEventMonitor extractPages = new ExtractPagesEventMonitor(pdfCtl.Inst.Str2ID("WHAT GOES HERE"));
Code: Select all
WHAT HOES HERE?
//dlg.CheckItem("RangeCtl.Current", 1, true);
//dlg.CheckItem("crop.Redaction", 1, true);