Page 1 of 1

Using Active X viewer with Tools classes while creating

Posted: Wed Sep 16, 2015 4:35 pm
by alanlschoolcraft
Is there a way to use the active X viewer to readily show any added or modified acro form objects using the tools classes after any control/object add or change to the x/y position or font? I have tried using both, but can not seem to get the PDF in the tools workspace to show in the active X viewer on the same window. Searched help, and the forum, but can not find any info. Is it even possible?

Thanks

Re: Using Active X viewer with Tools classes while creating

Posted: Thu Sep 17, 2015 1:29 am
by Tracker - Clarion Support
Hi Alan!

Not in the way you mean.

You could use the Viewer ActiveX to open an existing PDF, create the field in the PDF on one of the pages using the JavaScript engine, and then save the modified PDF file. After that, the field should appear in the Fields pane in the Viewer.

The hard part is going to be figuring out the location and size of the field.

If you intend to do this you will find this document invaluable:
http://www.adobe.com/content/dam/Adobe/ ... erence.pdf

The section on Field is what you want.

Re: Using Active X viewer with Tools classes while creating

Posted: Thu Sep 17, 2015 1:24 pm
by alanlschoolcraft
Thanks Craig, looking at the documentation, it will accomplish what we need.

Re: Using Active X viewer with Tools classes while creating

Posted: Thu Sep 17, 2015 1:35 pm
by Tracker - Clarion Support
Hi Alan!

Good to know! :)

If you need any further help, let me know.

Re: Using Active X viewer with Tools classes while creating

Posted: Wed Sep 23, 2015 2:17 am
by alanlschoolcraft
Started using java script to fill acro fields with activex. It seems that after opening, and getting a list of fields, it crashes after updating a number of fields. A small form with 6 text fields fills fine. But a busier document with 100+ fields crashes after about 15 to 20. If I stop after 10 or so, document saves fine with fields filled in. But if I continue, it crashes. Tried saving, closing, and re-opening to no avail. Java includes function with two parameters, fieldname, and data to fill. Followed by function call to AddData("xxx","abc") . The code does work, but only for a limited number of calls. Any help would be appreciated. I tried in batch mode sending function and all calls, as well as function,call pairs for each field. Same result.

Here is the code being used in the loop of a Q,

IF FormFieldQ.FieldData <> ''
FREE(JS_Input)
FREE(JS_Output)
JS_Input.Line = 'function setFieldValue(d,n) {{ var f = this.getField(n); f.value = d; }'
PUTINI('JSInputLine','Function',CLIP(JS_Input.Line),'c:\slsdev\jsdebug.ini')
ADD(JS_Input)
JS_Input.Line = 'setFieldValue("' & CLIP(FormFieldQ.FieldData) & '","' & CLIP(FormFieldQ.FieldName) & '");'
PUTINI('JSInputLine'&i#,'line'&i#,CLIP(JS_Input.Line),'c:\slsdev\jsdebug.ini')
ADD(JS_Input)
PUTINI('Running','Script','Running','c:\slsdev\jsdebug.ini')
PDFForm.RunJavaScript(LOC:DocID,JS_Input,JS_Output,0)
GET(JS_Output,1)
END


Thanks

Re: Using Active X viewer with Tools classes while creating

Posted: Wed Sep 23, 2015 12:10 pm
by Tracker - Clarion Support
Hi Alan!

Not good! Can you please zip up and email me a copy of the form and the JavaScript that is crashing? We'll need those to test with here.

Re: Using Active X viewer with Tools classes while creating

Posted: Wed Sep 23, 2015 2:20 pm
by gcobaughSLS
Hi Craig, this is George Cobaugh. I have my own login for the forum now. Alan was just passing along the info as I found it. Now I can deal directly to the forum. I will send the zipped up file with the txa code of my test procedure, and the pdf form I am testing with. It is part of a much larger system and database, so the entirety would be difficult. I can dump the Q data to a csv, so you will have the data as well as the pdf form you could import into a Q and run the exact test I am. I did a further trace, and found that the last line that was run in the class code before crash was to the parent call, it never returned. I will document that as well. I'll get your email from Alan and send all to you this morning.

Thanks,
George

Re: Using Active X viewer with Tools classes while creating

Posted: Wed Sep 23, 2015 3:03 pm
by Tracker - Clarion Support
Hi George!

Thanks, I don't think I need to see your Clarion code, but I do need to see the form and the JavaScript that you are trying to use to load the data into the form, as this seems to be a JavaScript Engine problem.

Re: Using Active X viewer with Tools classes while creating

Posted: Wed Sep 23, 2015 3:34 pm
by gcobaughSLS
Email sent with zip file

Re: Using Active X viewer with Tools classes while creating

Posted: Wed Sep 23, 2015 5:40 pm
by Tracker - Clarion Support
Hi George!

Received, please see email from me per your problem.

Re: Using Active X viewer with Tools classes while creating

Posted: Thu Sep 24, 2015 12:03 am
by gcobaughSLS
Did you send to me? Or to Alan? I didn't get it yet.

Thanks

Re: Using Active X viewer with Tools classes while creating

Posted: Thu Sep 24, 2015 1:16 am
by Tracker - Clarion Support
I sent it to gand_t@hotmail.com.

Re: Using Active X viewer with Tools classes while creating

Posted: Fri Oct 02, 2015 4:13 pm
by Tracker - Clarion Support
This subject has been answered in emails due to confidential nature of some information. :)