Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

vb.net form fill

Explorer ,
Mar 07, 2016 Mar 07, 2016

A noob question

If I create a pdf form, can I then use the SDK w/vb.net via Visual Studio to create an app to fill the form on a user's station (and flatten it once filled) provided that they have Acrobat Std or Pro installed?   I think the answer here is yes, as long as Std/Pro is installed?

TOPICS
Acrobat SDK and JavaScript
4.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 07, 2016 Mar 07, 2016

That is correct, if you have Acrobat Standard or Pro installed, you can use the Acrobat IAC (InterApplication Communication) interface to "remote control" Acrobat from your own application. Take a look here for a simple example to read and set form fields using VBA - you should be able to easily convert that to a VB.Net application:

Reading PDF Form Fields with VBA - KHKonsulting LLC

Make sure to read the relevant documentation in the Acrobat SDK.

Translate
Community Expert ,
Mar 07, 2016 Mar 07, 2016

That is correct, if you have Acrobat Standard or Pro installed, you can use the Acrobat IAC (InterApplication Communication) interface to "remote control" Acrobat from your own application. Take a look here for a simple example to read and set form fields using VBA - you should be able to easily convert that to a VB.Net application:

Reading PDF Form Fields with VBA - KHKonsulting LLC

Make sure to read the relevant documentation in the Acrobat SDK.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 09, 2016 Mar 09, 2016

Well, not sure I find anything easy, but in any case, I am using form created with LiveCycle Designer, because I need expanding text fields. 

I don't suppose you know of any examples of filling a form with data using XFA forms and VB.NET?  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2016 Mar 09, 2016

That gets a lot more complicated - and it may not work at all, it depends on the actual form. See here for a discussion about how this can be accomplished (you can probably scroll all the way to the end to my last reply):

Can't insert values into Editable text fields using VBA

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 09, 2016 Mar 09, 2016

Ugh.  Maybe I should use Word for the merge portion, and then just print as PDF.  That might be simpler.   Every station has MSOffice and Acrobat, so  that should work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 09, 2016 Mar 09, 2016

Just to leave no stone unturned....

If I have the data for the form in an xml file, all I am doing is 3 steps in Acrobat:

1) open pdf file

2) import data from xml file

3) print to pdf

I don't understand why this is difficult.  I understand XFA is not an AcroForm, but I am basically just calling a merge function built into Acrobat, yes? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 10, 2016 Mar 10, 2016

Ah, that changes things. Your question was about filling a form from a VB application, there was never any mention of XML. If you have the data in XFA format, you can use the Doc.importXFAData() method: http://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJS...

I've never used this via the JSObject bridge, so you will have to experiment to see if it works in your case. As always, try to get it working with just Javascript first to make sure that your data file is compatible with your form. Once you know it works in JavaScript, you can then try to move the functionality into your VB application.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 10, 2016 Mar 10, 2016
LATEST

Understood.  I don't have it in xml format.... but I know how to save winform data in an xml file, so possibility there I guess. Thanks for the help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 09, 2016 Mar 09, 2016

ACrobat automation isn't a list of the things you can do in the UI, it is it's own specific capabilities. First get the XFA JavaScript manual because it us different. Not this describes what you can do. Further complications come from necessary security limitations.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines