Page 1 of 1

How to find if a form contains XFA fields.

Posted: Wed Oct 07, 2015 4:07 pm
by docu-track99
Hello Tracker,

In PDF X Change viewer SDK manual, there is a method called ShowXFAInfo . Can you please guide us in the meantime how we can implement this method?

Thanks,

Doc-It Development

Re: How to find if a form contains XFA fields.

Posted: Thu Oct 08, 2015 9:33 am
by Sasha - Tracker Dev Team
Hi, docu-track99

First of all, exactly what type of SDK are you using - this is a Drivers API section and you're asking about Viewer SDK.
Also, please provide a better description about what you need to do.

Re: How to find if a form contains XFA fields.

Posted: Thu Oct 08, 2015 1:44 pm
by docu-track99
We are using PDF X Change Viewer Active X SDK version 2.5.0311.

Since currently PDF X Change Viewer has an issue with XFA form that it cannot display data on XFA field. We are looking for a work around strategy for our client that if they encounter this type of form, we give them some sort of warning message like "The form you are trying to open has dynamic XFA fields. Please be advise that you may NOT see data in some fields. As a workaround please use Adobe Viewer..... "

So, we need a way to before opening a document if it contains XFA fileds.

In PDFV_AX.pdf manual, on page 103 we found a method "ShowXFAInfo" . Can you please tell us how we can use this method/function?

Doc-It Development

Re: How to find if a form contains XFA fields.

Posted: Fri Oct 09, 2015 7:17 am
by Dima - Tracker Dev Team
Here's the sample(C#) which you can experiment with:

Code: Select all

    CComBSTR bsResult;
    CComBSTR bsScript = L"if (xfa != undefined && xfa != null) { if (this.XFAForeground)('static XFA');else 'dynamic XFA';} else 'else';";
    HRESULT hRes = m_spView->RunJavaScript(bsScript, &bsResult.m_str, 0, 0);
    if (bsResult == L"dynamic XFA")
        ;//dynamic XFA
    else if (bsResult == L"static XFA")
        ;//static XFA
    else
        ;//