Adobe Forums

Add Me
Adobe Forums » Software Discussions » Adobe Acrobat » Adobe SDK and Programming » Reason for Error "No form is open in Acrobat Viewer"

Tags:



Reply
LinkBack Thread Tools Display Modes
Reason for Error "No form is open in Acrobat Viewer"
  #1 (permalink)  
Old 11-17-2008, 06:29 AM
Atin Wadehra
Guest
 
Posts: n/a
Default Reason for Error "No form is open in Acrobat Viewer"

Am trying to use the AcroForms plug-in using IAC in VC++ to populate fields by opening PDFs in memory. The method PDDoc->OpenAVDoc is bringing the Acrobat window in front. If I comment this method, am getting the error "No form is Open in Acrobat Viewer". Below is my code

// Create the Acro App object
pAcroApp = new CAcroApp;
pAcroApp->CreateDispatch("AcroExch.App", &OleExc)

// Create the PDDoc object
pAcroPDDoc = new CAcroPDDoc;
pAcroPDDoc->CreateDispatch("AcroExch.PDDoc", &OleExc)

// Open the PDF File
pAcroPDDoc->Open(cstrPdfFile)

// Create the AVDoc object
pAcroAVDoc = new CAcroAVDoc;
pAcroAVDoc->AttachDispatch(pAcroPDDoc->OpenAVDoc(cstrPdfFile), true);

// Create the Forms Automation object
pFormApp = new IAFormApp;
pFormApp->CreateDispatch("AFormAut.App", &OleExc)

// Get the collection of fields pFields = new IFields(pFormApp->GetFields());

The above line is producing the error mentioned above on commenting the OpenAVDoc method. Can someone provide help??


Reply With Quote


  #2 (permalink)  
Old 11-17-2008, 06:29 AM
Atin Wadehra
Guest
 
Posts: n/a
Default Re: Reason for Error "No form is open in Acrobat Viewer"

The error also comes if I make a call to AcroApp.Hide method before calling the OpenAVDoc method.
Reply With Quote


  #3 (permalink)  
Old 11-18-2008, 06:22 AM
NiceNix@adobeforums.com
Guest
 
Posts: n/a
Default Re: Reason for Error "No form is open in Acrobat Viewer"

You are getting this error message because your pFormApp object can't find a form to get the fields from. You have to open the form in the Viewer (via OpenAVDoc) first. The same is true for AcroApp.Hide. If you don't have a doc open, it has nothing to hide.
Reply With Quote


  #4 (permalink)  
Old 11-18-2008, 06:22 AM
Atin Wadehra
Guest
 
Posts: n/a
Default Re: Reason for Error "No form is open in Acrobat Viewer"

Nix,

Am making the call to OpenAVDoc before creating the pFormApp object.

Also, am unable to find out any documentation specifying the reason for this error and when it'll occur. There is only a single line mentioned about this error in the IACReference.pdf
Reply With Quote


Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Hairstyles | UFO Videos | Bollywood Wallpapers | Poems  | WWE


All times are GMT. The time now is 07:51 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.