Import comments and fields without UI messages  SOLVED

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
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Import comments and fields without UI messages

Post by MartinCS »

Hello Tracker-Team,

I would like to import comments and fields into a document which is currently opened in the Pdf Editor without the use of a UI dialog showing up to select the desired fdf file.

Following the new 'OperationDemo' class in the FullDemo (v315) I was trying to implement this code in my application. But with no success.

Code: Select all

try
{
	var op = pdfCtl.Inst.CreateOp(pdfCtl.Inst.Str2ID("op.document.importCommentsAndFields"));

	if (op == null)
	{
		return;
	}

	op.Params.Root["Input"].v = fsInst.DefaultFileSys.StringToName("d:\\temp\\2.fdf");
	op.Do();
}
catch
{
	// ignored
}
Is this currently available with the latest Pdf SDK version and am I on the right track?

Thank you in advance for your help!

Martin
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Import comments and fields without UI messages

Post by Vasyl-Tracker Dev Team »

The correct code:

Code: Select all

...
op.Params.Root["Input"].v = pdfCtl.Doc; // put target-document
op.Params.Root["Options.FileName"].v = "d:\\temp\\2.fdf"; // *.xfdf too

op.Do()
...
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Import comments and fields without UI messages

Post by MartinCS »

Hi Vasyl,

thank you for your help and the code snippet!

Everything works perfectly. :D


Martin
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17906
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Import comments and fields without UI messages

Post by Tracker Supp-Stefan »

:)
Post Reply