Professional Web Applications Themes

Reason for Error "No form is open in Acrobat Viewer" - Adobe Acrobat SDK

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", ...

  1. #1

    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??
    Atin Wadehra Guest

  2. #2

    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.
    Atin Wadehra Guest

  3. #3

    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.
    NiceNix@adobeforums.com Guest

  4. #4

    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 doentation 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
    Atin Wadehra Guest

  5. #5

    Default Re: Reason for Error "No form is open in Acrobat Viewer"

    I faced the same issue, and didn't find a way to get the collection of fields without showing Acrobat window.

    So, currently I call CAcroApp::Show then CAcroApp::Minimize before trying to get fields.

    By the way, which versions of Acrobat and Acrobat SDK do you use? Based on Acrobat 9 type library imported into VS2005 via class wizard:
    1) IAFormApp is abstract class, so you can't instantiate it via "new IAFormApp", I use CAFormApp class instead;
    2) I use method CAFormApp::get_Fields to get the collection of fields.
    Ivan_Pechorin@adobeforums.com Guest

  6. #6

    Default Re: Reason for Error "No form is open in Acrobat Viewer"

    Ivan,

    Am currently using Acrobat 7 and 7 SDK and have a workaround to call CAcroApp::Minimize just after OpenAVDoc for not showing the viewer.

    However this is not working in Acrobat 9. So, am waiting for a workaround in 9.0 before migrating.
    Atin Wadehra Guest

Similar Threads

  1. Acrobat Pro does not open because : "language resources"
    By GuyBois@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 4
    Last Post: September 7th, 05:32 PM
  2. Gray Out "Save As" option when client open a6 Pro Mac form in 5 Std PC
    By Oscar_Velasco@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: May 6th, 08:37 PM
  3. Acrobat Form Submit error: changes VALUE="true" to "0"
    By Douglas_Maus@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 1
    Last Post: August 12th, 05:25 PM
  4. "Unable to open file for writing" - Acrobat PDF issue?
    By Laurie_Holland@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 1
    Last Post: June 3rd, 02:14 PM
  5. Replies: 1
    Last Post: May 17th, 02:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139