These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Populating PDF from Excel, with a twist

nicke
Registered: May 18 2009
Posts: 2

Hello everyone,

I have the following scenario:

I have a web application that generates an excel file with several rows of information.
I tried to export from excel to .txt (tab delimited file) and import it into the form fields my pdf file - all good so far.

This would all be hunky dory if the excelfine only contained one row, however it contains 3000 rows which I would love to generate and print 3000 pdf files.

How can I accomplish this?

Hoping for the best..
/Niklas

My Product Information:
Acrobat Pro 9.1.1, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
How are you currently importing data into the PDF? Are you using JavaScript?

To handle so much data, and silent printing you'll need to write an automation script. This is something you can develop and run from the console window. Or if you need to reuse the script you could place it into a toolbar button or menu item. But the key bit is that in order to get the features you want (data import and silent print) the script has to be in a privileged location outside of the document.

The JavaScript function for importing from a tab delimited file is "doc.importTextData()", it has an imput for selecting a row and returns a number that lets the script know that the end has been reached.

Just run this function in a loop with the print function. You may run into timing problems because the import is fast and the print is slow, and neither is a blocking function. To solve this you might need to force a delay in the code.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

manash
Registered: May 23 2009
Posts: 8
Thom,

I've got the same situation (though usually only 200 records) but your answer is a little bit over my head. First question: How do I know if I'm using JavaScript? I'm using Acrobat 9 Pro and clicking Forms>Manage Form Data>Import Data. Should I be doing something else?Thanks ~ Carrie
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Manash, The workflow outlined by Nicke is basically variable data printing. To do this he needs to automate both importing data and printing. One very simple implementation is to use a folder level JavaScript. What you're doing is manually importing data with Acrobat's user interface. This is fine when the number of records is small, but with around 200 records to import you could definately benefit from some automation.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

namiamy
Registered: May 20 2009
Posts: 14
there are some ways you can use.
1.first i think you can download 2007 Microsoft Office Add-in: Microsoft Save as PDF, if you install this software successfully, u can save the excel file as pdf directly.
2.you also can use Google Docs save as PDF

and there are a lot of Free Excel to PDF Creators here:
http://www.anypdftools.com/free-excel-to-pdf-creator.php#155
manash
Registered: May 23 2009
Posts: 8
Thom,

Thanks for the reply and yes I would definately prefer to automate this but I have no clue as to how to go about it. When you say "folder level JavaScript" how difficult is this to learn? I have absolutely no knowledge off scripting but I'm willing to learn as I actually have about five different forms that have to be filled out with a lot of the same information on them. Any pointers on where to learn (is pdfscripting for the uneducated beginner or are you assuming at least some knowledge for members)? or is this a script that's already been written and can be easily modified i.e. changing the field names?

Thanks ~ Carrie
manash
Registered: May 23 2009
Posts: 8
namiamy,

Thanks for the reply. I can convert Excel files to pdf without any problems. I'm actually attempting to import the fields into a pdf form to create multiple pdfs i.e. one pdf per record (row).
namiamy
Registered: May 20 2009
Posts: 14
hi manash,
i dont know your mean exactly.
maybe you want to convert your excel file to pdf per row? each row have a pdf file?

if this, i will suggest you convert your excel to pdf first.
then split your pdf file with the software pdf splitter. this software can split any PDF files into smaller PDF files.
manash
Registered: May 23 2009
Posts: 8
namiamy,

Thanks but that's not what I'm trying to do. Thom is heading me in the right direction.

~Carrie
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Manash,
Writing simple scripts for something like a form calculation is not to difficult to learn in a short time. Writing an automation script for variable data printing is a bit more difficult. But you'll need to start at the same place. i.e. the beginning. You'll need to become familiar with JavaScript and the Acrobat programming environment. You'll find a whole series of introductory video tutorials at www.pdfscripting.com. The first set of these is free. You'll also find several articles that cover topics in automation scripting at this site in the tutorials area.

Also take a look at the URLs in my signature block.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

smcern
Registered: May 27 2009
Posts: 1
I have an Excel spreadsheet that I would like to convert into a pdf form format. The problem I am running into is the spreadsheet has two dropdown fields and I cannot ge the dropdowns to work properly.

I've gone into Live Cycle to solve the dropdown issue, but it is putting each line of the spreadsheet into an individual form. Can I keep the spreadsheet layout and use Live Cycle to set up the dropdown fields?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You are on the wrong thread, this discussion has nothing to do with converting Excel files to PDF. Please post your question to a new thread.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

manash
Registered: May 23 2009
Posts: 8
Thom,

Thanks for the help! Now let's just hope I can learn something new :)

~ Carrie