Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 09, 2019 6:28 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 8:43 am 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
I'm evaluating the DynaPDF plug-in prior to purchasing, and I need to be able to set the value of an existing form field. From what I am reading, it looks like the value property is read-only. Can someone tell me if this is possible, and if so, what do I need to do to set the value of a field. I was anticipating purchasing the Lite version assuming that it would have this capability.

I noticed that version 3 is slated to be released soon, is it possible that this capability has been added to the updated version?

As an option if this isn't possible directly, I noticed that I can add a javascript function to the file, and that seems to work to set the field contents, but I'd rather know if I can set the values directly from RB instead of having to generate a much more complicated javascript to add.


Also, does this plug-in work with dynamic PDFs created through Adobe Livecycle?

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 9:48 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
markwalsh wrote:
I'm evaluating the DynaPDF plug-in prior to purchasing, and I need to be able to set the value of an existing form field. From what I am reading, it looks like the value property is read-only. Can someone tell me if this is possible, and if so, what do I need to do to set the value of a field. I was anticipating purchasing the Lite version assuming that it would have this capability.


The SetTextFieldValue function does that.

markwalsh wrote:
I noticed that version 3 is slated to be released soon, is it possible that this capability has been added to the updated version?


Well, what features version 3 has, is not yet clear. But all those form things are already built in.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 10:04 am 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
Thanks for the quick response.

MonkeybreadSoftware wrote:
markwalsh wrote:
I'm evaluating the DynaPDF plug-in prior to purchasing, and I need to be able to set the value of an existing form field. From what I am reading, it looks like the value property is read-only. Can someone tell me if this is possible, and if so, what do I need to do to set the value of a field. I was anticipating purchasing the Lite version assuming that it would have this capability.


The SetTextFieldValue function does that.

Thanks.
MonkeybreadSoftware wrote:
markwalsh wrote:
I noticed that version 3 is slated to be released soon, is it possible that this capability has been added to the updated version?


Well, what features version 3 has, is not yet clear. But all those form things are already built in.

Greetings
Christian


Another question: Is it possible to print the PDF from RB in the Lite version? I was also looking to be able to flatten the PDF, but I see that is only available in the Pro version.

Thanks again.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 10:18 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Depends what you mean with print.
DynaPDF can create a PDF file for you.

This PDF file can be printed on Mac OS X with our CoreGraphics classes.
Or command line with some pdf to postscript tool and sending to a postscript aware printer.

I think on Windows you can launch Acrobat reader and have the file printed with some command line switch.

See this example:
http://www.monkeybreadsoftware.net/exam ... tpdf.shtml

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 10:33 am 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
MonkeybreadSoftware wrote:
Depends what you mean with print.
DynaPDF can create a PDF file for you.

This PDF file can be printed on Mac OS X with our CoreGraphics classes.
Or command line with some pdf to postscript tool and sending to a postscript aware printer.

I think on Windows you can launch Acrobat reader and have the file printed with some command line switch.

See this example:
http://www.monkeybreadsoftware.net/exam ... tpdf.shtml

Greetings
Christian

Thanks. My intention was to give the user the option to save the PDF or to just print the data. In the case of printing the data, I was hoping to be able to create the PDF then print it without any extra user input (i.e. opening the PDF in Reader/Acrobat then requiring the user to initiate the print command) then delete the PDF since it is no longer needed. This would also keep the user's focus in my application instead of switching them to Acrobat for printing and then having to switch back to my application.

This will be under Windows (but may include Mac in the future)

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 11:28 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
I thought Acrobat Reader has a silent option to open, print and close the PDF!?

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 12:00 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
It does.


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 12:16 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
timhare wrote:
It does.

Thanks, Christian and Tim. I'll look into that (not familiar with how to do that right now). I'm not sure if the user's will have Acrobat/Reader/Neither installed, so I was hoping originally that I could send the print directly using the DynaPDF plugin. Is there a link to an example to do this?


MonkeybreadSoftware wrote:
The SetTextFieldValue function does that.

Currently looking into how to identify an existing field in an acroform. The 'SetTextFieldValue' function requires an integer field index. I have tried using
f = pdf.FindField("txtCompanyName")
call pdf.SetTextFieldValue(F, "Company Name", "Company Name", 1)

But I am getting an error "40: SetTextFieldValue: Invalid handle!"

Not sure if I am doing something wrong. I started out using the 'Acroform' example included with the plugin, and edited it to use my PDF form. I was able to set the field value of a field in that example file since the field index was obtained when the field was created, but haven't had any luck just yet figuring out how to determine the index of the field by name if it already exists.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 2:01 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Well, you should check the return value. Maybe you get -1 as the field was not found?

This works here:

Quote:
f = pdf.FindField("Finanzamt")
if f>=0 then
call pdf.SetTextFieldValue(f, "Mayen", "", pdf.ktaLeft)
end if


You can email me for an example project on this. I just wrote one for the next plugin version.

Also check the import flags:
call pdf.SetImportFlags(pdf.kifImportAll)

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS DynaPDF setting form field values
PostPosted: Mon Dec 13, 2010 2:23 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
MonkeybreadSoftware wrote:
Well, you should check the return value. Maybe you get -1 as the field was not found?

This works here:

Quote:
f = pdf.FindField("Finanzamt")
if f>=0 then
call pdf.SetTextFieldValue(f, "Mayen", "", pdf.ktaLeft)
end if


You can email me for an example project on this. I just wrote one for the next plugin version.

Also check the import flags:
call pdf.SetImportFlags(pdf.kifImportAll)

Greetings
Christian

Yes, I am getting -1. I believe I am opening/importing the existing PDF improperly - when I run the test program, the PDF is missing the field I had placed in it when it opens the output file. I had taken your example file which creates a Tax Form, and replaced the code which created the forms with the lines I was using to set the field. I just started playing with this plug-in today, and I am not familiar with the proper way to open the PDF for editing.

I will send you an email.

I did find the answer to the printing silently in another one of your example files, so I believe I will be able to get that working.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group