Hi,
We have an Adobe Plugin in which Adobe form is used. With Adobe LiveCycle Designer, Staic PDF Form and Dynamic XML Form can be created. We want to distinguish between these two types. Is there any Adobe API available which will return the type of the PDF Form; Static PDF or Dynamic XML Form?
Thanks - Apeksha
Solved! Go to Solution.
Views
Replies
Total Likes
Your script failed for me but when I used the following modified version it detected the form type correctly ( as long as the pdf is saved from designer using either save as static or save as dynamic )
Dim app, pddoc
Dim js
Set app = CreateObject("AcroExch.App")
Set pddoc = CreateObject("AcroExch.PDDoc")
If pddoc.Open("E:\Untitled1.pdf") Then
Set js = pddoc.GetJSObject
If Not js Is Nothing Then
If js.dynamicXFAForm Then
MsgBox "It's a dynamic form!"
Else
MsgBox "It's a static form!"
End If
End If
End If
Set app = Nothing
Set pddoc = Nothing
As for the 2nd approah, I dont have a sample that can be shared but essentially, its a matter of using the COS API calls to open the XFA stream within the PDF and determining what the rendering type is.
You can also execute javascript using the API / C code
Views
Replies
Total Likes
Is the form already open, which your plugin is trying to examine or is it before loading the pdf into acrobat? If its already open then it is proably easiest to execute script to examine the "dynamicXFAForm", "xfa" and "XFAForeground" properties on the Doc object. If not through script, you will have to examine the XFA cos object itself to determine what the render property should be.
Views
Replies
Total Likes
Yes, the form is already open. Earlier, I had tried a VB Script to check if the PDF file is Static PDF Or Dynamic XML as per the value of 'dynamicXFAForm' but it returned 'true' for both type of PDFs created by Adobe X LiveCycle Designer. :|
Please correct me if I am doing anything wrong.
<code snip>
app = CreateObject("AcroExch.App")
pddoc = CreateObject("AcroExch.PDDoc")
If pddoc.Open("c:\Usage Example Form.pdf") Then
js = pddoc.GetJSObject
If Not js Is Nothing Then
If js.dynamicXFAForm Then
MsgBox "It's a dynamic form!"
Else
MsgBox "It's a static form!"
End If
End If
End If
</code snip>
Our plug-in is written in C++ and we use Adobe APIs to work with Adobe Forms. Could you please guide me how to do it using XFA cos object?
Thanks - Apeksha
Views
Replies
Total Likes
Your script failed for me but when I used the following modified version it detected the form type correctly ( as long as the pdf is saved from designer using either save as static or save as dynamic )
Dim app, pddoc
Dim js
Set app = CreateObject("AcroExch.App")
Set pddoc = CreateObject("AcroExch.PDDoc")
If pddoc.Open("E:\Untitled1.pdf") Then
Set js = pddoc.GetJSObject
If Not js Is Nothing Then
If js.dynamicXFAForm Then
MsgBox "It's a dynamic form!"
Else
MsgBox "It's a static form!"
End If
End If
End If
Set app = Nothing
Set pddoc = Nothing
As for the 2nd approah, I dont have a sample that can be shared but essentially, its a matter of using the COS API calls to open the XFA stream within the PDF and determining what the rendering type is.
You can also execute javascript using the API / C code
Views
Replies
Total Likes
Hi dohanlon,
The script worked perfectly well.
Thanks a lot for your help!!!
Best regards,
Apeksha
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies