|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
AddTextField & InsertPage PDF issuesHi all,
I have discovered a couple of issues with the PDF tags (with assistance from Stephen Briggs). Does anyone know of any solutions to these otherwise i will recommend them as feature requests? Firstly simply AddTextField has no control over borders, i.e. you get a 1 pixel line around every text field. IMHO, it should default to no border, but control over this would be invaluable. Secondly if i have a PDF file on disk that has forms already filled out, it seems impossible to copy the field values into another PDF_Doc object. i.e. var: 'file_path'='/site/pdf/', 'file_name'='filled_form.pdf', 'pdfOUT'=(PDF_Doc: -Size='Legal', 'Author'='Name', -UseDate); var:'tmplt_pg'=(PDF_Read:-File=($file_path + $file_name)); // Log field names and values var:'input_fields'=$tmplt_pg->FieldNames; iterate: $input_fields, local:'i'; log_always: 'PDF_Form: ' + #i + '=' + $tmplt_pg->(FieldValue:#i); /iterate; loop: $tmplt_pg->PageCount; $pdfOUT->(InsertPage: $tmplt_pg, (loop_count), -NewPage); /loop; $pdfOUT->Close; PDF_Serve: $pdfOUT, -File=$file_name; As far as i'm aware InsertPage is the only way to get a PDF_Read object into a PDF_Doc object and in the above case it doesn't copy the form values across. Any suggestions would be appreciated. Many thanks, Adam -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: AddTextField & InsertPage PDF issuesI've not used AddTextField, but the lack of borders might be a constraint of the underlying library of iText. If no one says anything about it, then check their web site to see if it is an option.
As far as copying values from one PDF form to another, the two member tags that might help are: pdf_read->importfdf pdf_read->exportfdf FDF is a file or byte stream containing the form data, depending on whether you use a -file parameter. The details of how to use this tag are pretty sparse, and I have not used them yet, but I would assume that they would work similarly to the other pdf_read->foo tags. --steve On Wednesday, July 23, 2008, lists@... (Adam de Zoete) pronounced: >Hi all, > >I have discovered a couple of issues with the PDF tags (with assistance >from Stephen Briggs). Does anyone know of any solutions to these >otherwise i will recommend them as feature requests? > >Firstly simply AddTextField has no control over borders, i.e. you get a >1 pixel line around every text field. IMHO, it should default to no >border, but control over this would be invaluable. > >Secondly if i have a PDF file on disk that has forms already filled out, >it seems impossible to copy the field values into another PDF_Doc >object. i.e. > > >var: > 'file_path'='/site/pdf/', > 'file_name'='filled_form.pdf', > 'pdfOUT'=(PDF_Doc: -Size='Legal', 'Author'='Name', -UseDate); >var:'tmplt_pg'=(PDF_Read:-File=($file_path + $file_name)); > >// Log field names and values >var:'input_fields'=$tmplt_pg->FieldNames; >iterate: $input_fields, local:'i'; > log_always: 'PDF_Form: ' + #i + '=' + $tmplt_pg->(FieldValue:#i); >/iterate; > >loop: $tmplt_pg->PageCount; > $pdfOUT->(InsertPage: $tmplt_pg, (loop_count), -NewPage); >/loop; > >$pdfOUT->Close; >PDF_Serve: $pdfOUT, -File=$file_name; > > >As far as i'm aware InsertPage is the only way to get a PDF_Read object >into a PDF_Doc object and in the above case it doesn't copy the form >values across. > >Any suggestions would be appreciated. > >Many thanks, > >Adam > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <web@...> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: AddTextField & InsertPage PDF issues23 jul 2008 kl. 09.59 skrev Adam de Zoete:
> Firstly simply AddTextField has no control over borders, i.e. you > get a > 1 pixel line around every text field. IMHO, it should default to no > border, but control over this would be invaluable. I was starting this mail claiming that AddTextField adds fields with no borders at all, even if you want them. But that was when opening the pdfs in Preview. When I opened the same pdf in Acrobat Professional the field did have some kind of borders. Looking in the properties for the field confused me even more. The properties palett claims that there IS NO borders for the field! If I create a new field directly in Acrobat using the same settings then that field shows no borders, as it should. So something's not right here. HDB Jolle -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: AddTextField & InsertPage PDF issuesThanks for this Steve. I spent a little time testing it, but was getting
a lot of Java errors in the console, so probably need a little longer to see if it's a possibility. Is there anyone out there actually using importfdf and exportfdf that can vouch it actually works? Adam Steve Piercy - Web Site Builder wrote: > I've not used AddTextField, but the lack of borders might be a constraint of the underlying library of iText. If no one says anything about it, then check their web site to see if it is an option. > > As far as copying values from one PDF form to another, the two member tags that might help are: > > pdf_read->importfdf > pdf_read->exportfdf > > FDF is a file or byte stream containing the form data, depending on whether you use a -file parameter. > > The details of how to use this tag are pretty sparse, and I have not used them yet, but I would assume that they would work similarly to the other pdf_read->foo tags. > > --steve > > > On Wednesday, July 23, 2008, lists@... (Adam de Zoete) pronounced: > >> Hi all, >> >> I have discovered a couple of issues with the PDF tags (with assistance >>from Stephen Briggs). Does anyone know of any solutions to these >> otherwise i will recommend them as feature requests? >> >> Firstly simply AddTextField has no control over borders, i.e. you get a >> 1 pixel line around every text field. IMHO, it should default to no >> border, but control over this would be invaluable. >> >> Secondly if i have a PDF file on disk that has forms already filled out, >> it seems impossible to copy the field values into another PDF_Doc >> object. i.e. >> >> >> var: >> 'file_path'='/site/pdf/', >> 'file_name'='filled_form.pdf', >> 'pdfOUT'=(PDF_Doc: -Size='Legal', 'Author'='Name', -UseDate); >> var:'tmplt_pg'=(PDF_Read:-File=($file_path + $file_name)); >> >> // Log field names and values >> var:'input_fields'=$tmplt_pg->FieldNames; >> iterate: $input_fields, local:'i'; >> log_always: 'PDF_Form: ' + #i + '=' + $tmplt_pg->(FieldValue:#i); >> /iterate; >> >> loop: $tmplt_pg->PageCount; >> $pdfOUT->(InsertPage: $tmplt_pg, (loop_count), -NewPage); >> /loop; >> >> $pdfOUT->Close; >> PDF_Serve: $pdfOUT, -File=$file_name; >> >> >> As far as i'm aware InsertPage is the only way to get a PDF_Read object >> into a PDF_Doc object and in the above case it doesn't copy the form >> values across. >> >> Any suggestions would be appreciated. >> >> Many thanks, >> >> Adam >> > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Steve Piercy Web Site Builder Soquel, CA > <web@...> <http://www.StevePiercy.com/> > -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: AddTextField & InsertPage PDF issuesYes, that's been my experience. I think it needs to be submitted as a
feature request. Adam Jolle Carlestam wrote: > 23 jul 2008 kl. 09.59 skrev Adam de Zoete: > >> Firstly simply AddTextField has no control over borders, i.e. you get a >> 1 pixel line around every text field. IMHO, it should default to no >> border, but control over this would be invaluable. > > I was starting this mail claiming that AddTextField adds fields with no > borders at all, even if you want them. > But that was when opening the pdfs in Preview. When I opened the same > pdf in Acrobat Professional the field did have some kind of borders. > Looking in the properties for the field confused me even more. The > properties palett claims that there IS NO borders for the field! > > If I create a new field directly in Acrobat using the same settings then > that field shows no borders, as it should. So something's not right here. -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: AddTextField & InsertPage PDF issuesI tried this out:
var('mypdf' = pdf_read(-file='myfile.pdf')); var('fdf_data' = $mypdf->exportfdf(-file='fdf_data.fdf')); Where myfile.pdf contained form data. Then when I opened fdf_data.fdf in BBEdit, it looked good to me, albeit in a strange format. So I assume the merging of PDF data using ->importfdf would also work. If you're getting java errors, there is definitely something else interfering with your ability to use the iText library, as I think it relies upon java. If you post your console errors, then perhaps some of the Lasso java library gurus can chime in. I don't know squat about that stuff. --steve On Thursday, July 24, 2008, lists@... (Adam de Zoete) pronounced: >Thanks for this Steve. I spent a little time testing it, but was getting >a lot of Java errors in the console, so probably need a little longer to >see if it's a possibility. > >Is there anyone out there actually using importfdf and exportfdf that >can vouch it actually works? > >Adam > > >Steve Piercy - Web Site Builder wrote: >> I've not used AddTextField, but the lack of borders might be a constraint of the >underlying library of iText. If no one says anything about it, then check their web >site to see if it is an option. >> >> As far as copying values from one PDF form to another, the two member tags that >might help are: >> >> pdf_read->importfdf >> pdf_read->exportfdf >> >> FDF is a file or byte stream containing the form data, depending on whether you >use a -file parameter. >> >> The details of how to use this tag are pretty sparse, and I have not used them >yet, but I would assume that they would work similarly to the other pdf_read->foo >tags. >> >> --steve >> >> >> On Wednesday, July 23, 2008, lists@... (Adam de Zoete) pronounced: >> >>> Hi all, >>> >>> I have discovered a couple of issues with the PDF tags (with assistance >>>from Stephen Briggs). Does anyone know of any solutions to these >>> otherwise i will recommend them as feature requests? >>> >>> Firstly simply AddTextField has no control over borders, i.e. you get a >>> 1 pixel line around every text field. IMHO, it should default to no >>> border, but control over this would be invaluable. >>> >>> Secondly if i have a PDF file on disk that has forms already filled out, >>> it seems impossible to copy the field values into another PDF_Doc >>> object. i.e. >>> >>> >>> var: >>> 'file_path'='/site/pdf/', >>> 'file_name'='filled_form.pdf', >>> 'pdfOUT'=(PDF_Doc: -Size='Legal', 'Author'='Name', -UseDate); >>> var:'tmplt_pg'=(PDF_Read:-File=($file_path + $file_name)); >>> >>> // Log field names and values >>> var:'input_fields'=$tmplt_pg->FieldNames; >>> iterate: $input_fields, local:'i'; >>> log_always: 'PDF_Form: ' + #i + '=' + $tmplt_pg->(FieldValue:#i); >>> /iterate; >>> >>> loop: $tmplt_pg->PageCount; >>> $pdfOUT->(InsertPage: $tmplt_pg, (loop_count), -NewPage); >>> /loop; >>> >>> $pdfOUT->Close; >>> PDF_Serve: $pdfOUT, -File=$file_name; >>> >>> >>> As far as i'm aware InsertPage is the only way to get a PDF_Read object >>> into a PDF_Doc object and in the above case it doesn't copy the form >>> values across. >>> >>> Any suggestions would be appreciated. >>> >>> Many thanks, >>> >>> Adam >>> >> >> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- >> Steve Piercy Web Site Builder Soquel, CA >> <web@...> <http://www.StevePiercy.com/> >> > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <web@...> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: AddTextField & InsertPage PDF issuesYes, the problem seemed to be with importfdf, but i haven't had the time
to test it. However this doesn't really solve my original problem, although there might be a rather round about route! exportfdf & importfdf are unfortunately related to the PDF_Read tag. i.e. i'm trying to load a PDF file (in PDF_Doc), populate the form with data (through PDF_Read), AddJavascript (in PDF_Doc) and serve. Thanks for your help. Adam Steve Piercy - Web Site Builder wrote: > I tried this out: > > var('mypdf' = pdf_read(-file='myfile.pdf')); > var('fdf_data' = $mypdf->exportfdf(-file='fdf_data.fdf')); > > Where myfile.pdf contained form data. Then when I opened fdf_data.fdf in BBEdit, it looked good to me, albeit in a strange format. So I assume the merging of PDF data using ->importfdf would also work. > > If you're getting java errors, there is definitely something else interfering with your ability to use the iText library, as I think it relies upon java. If you post your console errors, then perhaps some of the Lasso java library gurus can chime in. I don't know squat about that stuff. > > --steve > > > On Thursday, July 24, 2008, lists@... (Adam de Zoete) pronounced: > >> Thanks for this Steve. I spent a little time testing it, but was getting >> a lot of Java errors in the console, so probably need a little longer to >> see if it's a possibility. >> >> Is there anyone out there actually using importfdf and exportfdf that >> can vouch it actually works? >> >> Adam >> >> >> Steve Piercy - Web Site Builder wrote: >>> I've not used AddTextField, but the lack of borders might be a constraint of the >> underlying library of iText. If no one says anything about it, then check their web >> site to see if it is an option. >>> As far as copying values from one PDF form to another, the two member tags that >> might help are: >>> pdf_read->importfdf >>> pdf_read->exportfdf >>> >>> FDF is a file or byte stream containing the form data, depending on whether you >> use a -file parameter. >>> The details of how to use this tag are pretty sparse, and I have not used them >> yet, but I would assume that they would work similarly to the other pdf_read->foo >> tags. >>> --steve >>> >>> >>> On Wednesday, July 23, 2008, lists@... (Adam de Zoete) pronounced: >>> >>>> Hi all, >>>> >>>> I have discovered a couple of issues with the PDF tags (with assistance >>> >from Stephen Briggs). Does anyone know of any solutions to these >>>> otherwise i will recommend them as feature requests? >>>> >>>> Firstly simply AddTextField has no control over borders, i.e. you get a >>>> 1 pixel line around every text field. IMHO, it should default to no >>>> border, but control over this would be invaluable. >>>> >>>> Secondly if i have a PDF file on disk that has forms already filled out, >>>> it seems impossible to copy the field values into another PDF_Doc >>>> object. i.e. >>>> >>>> >>>> var: >>>> 'file_path'='/site/pdf/', >>>> 'file_name'='filled_form.pdf', >>>> 'pdfOUT'=(PDF_Doc: -Size='Legal', 'Author'='Name', -UseDate); >>>> var:'tmplt_pg'=(PDF_Read:-File=($file_path + $file_name)); >>>> >>>> // Log field names and values >>>> var:'input_fields'=$tmplt_pg->FieldNames; >>>> iterate: $input_fields, local:'i'; >>>> log_always: 'PDF_Form: ' + #i + '=' + $tmplt_pg->(FieldValue:#i); >>>> /iterate; >>>> >>>> loop: $tmplt_pg->PageCount; >>>> $pdfOUT->(InsertPage: $tmplt_pg, (loop_count), -NewPage); >>>> /loop; >>>> >>>> $pdfOUT->Close; >>>> PDF_Serve: $pdfOUT, -File=$file_name; >>>> >>>> >>>> As far as i'm aware InsertPage is the only way to get a PDF_Read object >>>> into a PDF_Doc object and in the above case it doesn't copy the form >>>> values across. >>>> >>>> Any suggestions would be appreciated. >>>> >>>> Many thanks, >>>> >>>> Adam >>>> >>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- >>> Steve Piercy Web Site Builder Soquel, CA >>> <web@...> <http://www.StevePiercy.com/> >>> >> > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Steve Piercy Web Site Builder Soquel, CA > <web@...> <http://www.StevePiercy.com/> > -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: AddTextField & InsertPage PDF issuesWhere does the data for the form come from? A database or web form?
In what format is the data, if not a database or web form? The first step would be to get your data into a format that you can play with, then map to the data to field names in the PDF. I have several web forms that receive data, write it to a blank PDF form (which I created in Acrobat), then the resulting PDF as filled out form or served it to the user for them to sign. The basic process of taking a blank PDF form, populating its fields with data and saving it to the file system is the following. var('blank_pdf' = pdf_read(-file='/forms/blank.pdf')); var('filled_pdf' = '/forms/completed.pdf'); // one of several methods to build your field=value pairs var('my_fields' = array( 'foo'='bar', ... 'oogah'='boogah') ); iterate($my_fields,local('i')); $blank_pdf->setfieldvalue(-field=#i->first,-value=#i->second); /iterate; $blank_pdf->save(-file = $filled_pdf); I'd suggest do the above chunk first. Then do the pdf_doc steps, inserting the filled out form as pages, and adding the javascript. --steve On Thursday, July 24, 2008, lists@... (Adam de Zoete) pronounced: >Yes, the problem seemed to be with importfdf, but i haven't had the time >to test it. > >However this doesn't really solve my original problem, although there >might be a rather round about route! exportfdf & importfdf are >unfortunately related to the PDF_Read tag. > >i.e. i'm trying to load a PDF file (in PDF_Doc), populate the form with >data (through PDF_Read), AddJavascript (in PDF_Doc) and serve. > >Thanks for your help. > >Adam > > >Steve Piercy - Web Site Builder wrote: >> I tried this out: >> >> var('mypdf' = pdf_read(-file='myfile.pdf')); >> var('fdf_data' = $mypdf->exportfdf(-file='fdf_data.fdf')); >> >> Where myfile.pdf contained form data. Then when I opened fdf_data.fdf in BBEdit, >it looked good to me, albeit in a strange format. So I assume the merging of PDF >data using ->importfdf would also work. >> >> If you're getting java errors, there is definitely something else interfering with >your ability to use the iText library, as I think it relies upon java. If you post >your console errors, then perhaps some of the Lasso java library gurus can chime in. >I don't know squat about that stuff. >> >> --steve >> >> >> On Thursday, July 24, 2008, lists@... (Adam de Zoete) pronounced: >> >>> Thanks for this Steve. I spent a little time testing it, but was getting >>> a lot of Java errors in the console, so probably need a little longer to >>> see if it's a possibility. >>> >>> Is there anyone out there actually using importfdf and exportfdf that >>> can vouch it actually works? >>> >>> Adam >>> >>> >>> Steve Piercy - Web Site Builder wrote: >>>> I've not used AddTextField, but the lack of borders might be a constraint of the >>> underlying library of iText. If no one says anything about it, then check their >web >>> site to see if it is an option. >>>> As far as copying values from one PDF form to another, the two member tags that >>> might help are: >>>> pdf_read->importfdf >>>> pdf_read->exportfdf >>>> >>>> FDF is a file or byte stream containing the form data, depending on whether you >>> use a -file parameter. >>>> The details of how to use this tag are pretty sparse, and I have not used them >>> yet, but I would assume that they would work similarly to the other pdf_read->foo >>> tags. >>>> --steve >>>> >>>> >>>> On Wednesday, July 23, 2008, lists@... (Adam de Zoete) pronounced: >>>> >>>>> Hi all, >>>>> >>>>> I have discovered a couple of issues with the PDF tags (with assistance >>>> >from Stephen Briggs). Does anyone know of any solutions to these >>>>> otherwise i will recommend them as feature requests? >>>>> >>>>> Firstly simply AddTextField has no control over borders, i.e. you get a >>>>> 1 pixel line around every text field. IMHO, it should default to no >>>>> border, but control over this would be invaluable. >>>>> >>>>> Secondly if i have a PDF file on disk that has forms already filled out, >>>>> it seems impossible to copy the field values into another PDF_Doc >>>>> object. i.e. >>>>> >>>>> >>>>> var: >>>>> 'file_path'='/site/pdf/', >>>>> 'file_name'='filled_form.pdf', >>>>> 'pdfOUT'=(PDF_Doc: -Size='Legal', 'Author'='Name', -UseDate); >>>>> var:'tmplt_pg'=(PDF_Read:-File=($file_path + $file_name)); >>>>> >>>>> // Log field names and values >>>>> var:'input_fields'=$tmplt_pg->FieldNames; >>>>> iterate: $input_fields, local:'i'; >>>>> log_always: 'PDF_Form: ' + #i + '=' + $tmplt_pg->(FieldValue:#i); >>>>> /iterate; >>>>> >>>>> loop: $tmplt_pg->PageCount; >>>>> $pdfOUT->(InsertPage: $tmplt_pg, (loop_count), -NewPage); >>>>> /loop; >>>>> >>>>> $pdfOUT->Close; >>>>> PDF_Serve: $pdfOUT, -File=$file_name; >>>>> >>>>> >>>>> As far as i'm aware InsertPage is the only way to get a PDF_Read object >>>>> into a PDF_Doc object and in the above case it doesn't copy the form >>>>> values across. >>>>> >>>>> Any suggestions would be appreciated. >>>>> >>>>> Many thanks, >>>>> >>>>> Adam >>>>> >>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- >>>> Steve Piercy Web Site Builder Soquel, CA >>>> <web@...> <http://www.StevePiercy.com/> >>>> >>> >> >> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- >> Steve Piercy Web Site Builder Soquel, CA >> <web@...> <http://www.StevePiercy.com/> >> > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <web@...> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
| Free Forum Powered by Nabble | Forum Help |