get handling open from recent file list

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

get handling open from recent file list

Post by edvschu »

Hello,

with custom command handler i handle command open, here only click on button. In this way i need handle open from recent file list. How can i catch this command?

Best Regards,
edvschu
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: get handling open from recent file list

Post by Sasha - Tracker Dev Team »

Hello edvschu,

Well there is no way to distinguish that. You can catch the https://sdkhelp.pdf-xchange.com/vie ... oreExecute event and see whether it's an op.openDoc operation to know that the document will be opened.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: get handling open from recent file list

Post by edvschu »

Hello Alex,

handle various ways to open pdf by catch op.OpenDoc in beforeExecute event i have already thought.
Catch op.OpenDoc, how do I get the full filename at this point?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: get handling open from recent file list

Post by Sasha - Tracker Dev Team »

Hello edvschu,

From the operation's input of course. Here's the code snipped that I have - you should change the document's opening to your needs.

Code: Select all

PDFXEdit.IOperation oper = (PDFXEdit.IOperation)e.pFrom;
PDFXEdit.ICabNode options = oper.Params.Root["Input"];
PDFXEdit.IAFS_Name name = input.v as PDFXEdit.IAFS_Name;
PDFXEdit.IPXC_Document doc = null;
if (name == null)
{
	PDFXEdit.IAFS_File file = input.v as PDFXEdit.IAFS_File;
	if (file == null)
	{
		PDFXEdit.IString str = input.v as PDFXEdit.IString;
		if (str != null)
			doc = pxcInst.OpenDocumentFrom(str, null);
	}
	else
	{
		doc = pxcInst.OpenDocumentFrom(file, null);
	}
}
else
{
	doc = pxcInst.OpenDocumentFrom(name, null);
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: get handling open from recent file list

Post by edvschu »

That helps me further. Thank you Alex.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: get handling open from recent file list

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: get handling open from recent file list

Post by edvschu »

I have noticed that doc.id at point catch op.OpenDoc is not the same after the process is completed.
Let me see the doc.id in event document.viewingStarted, it is another. How can this be explained?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: get handling open from recent file list

Post by Sasha - Tracker Dev Team »

Hello edvschu,

You don't need the IPXC_Document from my sample - you should extract data from the IAFS_Name, IAFS_File or IString directly. The id is different because the operation itself executes and opens the document again.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply