FieldFocusChanged event parameter SOLVED
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.
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.
FieldFocusChanged event parameter
When a user clicks into an AcroForm field with a format category of Date, Acrobat DC adds a button to the right of the field that drops down a calendar control. I am migrating an app from Acrobat to Tracker and a tester has pointed out that Tracker lacks that feature. I figured I could just handle "e.document.fieldFocusChanged" and drop down a calendar similar to Acrobat, but so far I'm unable to determine which field is referenced by the event. The documentation at https://sdkhelp.pdf-xchange.com/vie ... cusChanged states that Param1 is not used, but I can see that Param1 contains a unique value for each field on the form. What does that value represent and how can I get an IPXC_FormField from it? Also, if there's an easier or more direct way to accomplish the drop down calendar please let me know. Thanks.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: FieldFocusChanged event parameter
Hello askelly,
We just had a meeting and it was told that this will be implemented soon. Meanwhile, you can use the event you mentioned - I updated the description on Wiki page.
Cheers,
Alex
We just had a meeting and it was told that this will be implemented soon. Meanwhile, you can use the event you mentioned - I updated the description on Wiki page.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: FieldFocusChanged event parameter
Thanks, that works. I think the documentation could be clearer that Param1 contains a pointer to an IPXC_Annotation. I was able to get it like this (VB.Net):
Is there a more direct way within the SDK?
Also, I haven't been able to figure out how to determine if a field has a format category of Date. Is that information accessible somewhere in the SDK?
Finally, do you have an ETA on when the calendar dropdown will be added? If it will be within the next month or two then I'm wasting effort trying to roll my own. Thanks!
Code: Select all
Dim Annot As PDFXEdit.IPXC_Annotation = System.Runtime.InteropServices.Marshal.GetTypedObjectForIUnknown(e.pEvent.Param1, GetType(PDFXEdit.IPXC_Annotation))
Also, I haven't been able to figure out how to determine if a field has a format category of Date. Is that information accessible somewhere in the SDK?
Finally, do you have an ETA on when the calendar dropdown will be added? If it will be within the next month or two then I'm wasting effort trying to roll my own. Thanks!
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: FieldFocusChanged event parameter
Hello askelly,
Well I did provide links to the annotation and field interfaces though I did not write the interface's name directly.
The cast that you've done is correct - I am using "as" in C# or the way that you described.
To get the information whether it's a Date field or not, use the Flags property of the IPXC_FormField - it should contain the PXC_FormFieldFlag.TFF_Date as a bit flag.
Cheers,
Alex
Well I did provide links to the annotation and field interfaces though I did not write the interface's name directly.
The cast that you've done is correct - I am using "as" in C# or the way that you described.
To get the information whether it's a Date field or not, use the Flags property of the IPXC_FormField - it should contain the PXC_FormFieldFlag.TFF_Date as a bit flag.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: FieldFocusChanged event parameter
The TFF_Date flag seems to not be working. If I view a particular field's properties in PDF-XChange Editor it has "Category" set to "Date" in the "Format Value" section, but the flags are zero in the SDK. Other flags are working as expected. I'm using build 321. Thanks.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: FieldFocusChanged event parameter SOLVED
Hello askelly,
Just checked - that flag is not yet used in our inner code. Try using this piece of code instead:
As for the ETA - we will try add this feature soon - probably for the next release.
Cheers,
Alex
Just checked - that flag is not yet used in our inner code. Try using this piece of code instead:
Code: Select all
PDFXEdit.IPXS_Inst sInst = (PDFXEdit.IPXS_Inst)pdfCtl.Inst.GetExtension("PXS");
uint nAtom = sInst.StrToAtom("S");
for (uint i = 0; i < pdfCtl.Doc.CoreDoc.AcroForm.FieldsCount; i++)
{
bool bIsDate = false;
PDFXEdit.IPXC_FormField fld = pdfCtl.Doc.CoreDoc.AcroForm.Field[i];
for (uint j = 0; j < fld.WidgetsCount; j++)
{
PDFXEdit.IPXC_Annotation widget = fld.Widget[j];
if (widget != null)
{
pdfCtl.Doc.CoreDoc.CosDocument.LockDocument();
PDFXEdit.IPXS_PDFVariant aa = widget.PDFObject.Dict_Get("AA");
if (aa != null)
{
PDFXEdit.IPXS_PDFVariant f = aa.Dict_Get("F");
if (f != null)
{
string sS = f.Dict_GetStringA(nAtom, "");
if (sS.Equals("JavaScript"))
{
string sJS = f.Dict_GetString("JS", "");
if (sJS.Contains("AFDate_Format"))
bIsDate = true;
}
}
}
pdfCtl.Doc.CoreDoc.CosDocument.UnlockDocument();
}
}
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: FieldFocusChanged event parameter
That works. Thank you!
- Tracker Supp-Stefan
- Site Admin
- Posts: 17948
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: FieldFocusChanged event parameter
Glad to hear it worked askelly!
Cheers,
Stefan
Cheers,
Stefan