[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Adobe PDF API's

Posted on 2004-03-25
13
Medium Priority
?
802 Views
Last Modified: 2013-12-03
I want to create a pdf file with "tags" of some sort in it.  Then, I will populate those fields with a VB program from a SQL database.  The goal is to have a sort of template that can be filled with data from the database and presented to the end user.

Has anyone here done anything with this?  If the answer is complicated, I am willing to split up the questions, making each worth 500 points.

I've got to go now; I will fill in any gaps later.
0
Comment
Question by:labreuer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 8

Expert Comment

by:ampapa
ID: 10681996
Here is a link to a similar question I answered: http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20834706.html?query=acrobat+pdf&searchType=topic

Let me know if I can fill in some more of the blanks...
0
 
LVL 1

Author Comment

by:labreuer
ID: 10683681
This is designed to fill in form fields -- what sort of restriction does this place on the final format of the text?  For example, if I want one field to be bold and a larger font, is that doable?
0
 
LVL 8

Expert Comment

by:ampapa
ID: 10683725
In Acrobat you can create a field on a document that can be formatted, yes.

I do a similar process but use an AxctiveX control called activepdf. It works great.

ampapa,
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:labreuer
ID: 10683993
What are a few things you like better about activepdf, compared to Adobe Acrobat Professional?  I understand the activepdf toolkit is required to do this -- you use activepdf's pdf maker as well?
0
 
LVL 8

Expert Comment

by:ampapa
ID: 10684106
I use toolkit from Access to populate Tax returns, it's a smooth setup and fairly seamless. Very little programming involved compared to some of the other attempts to create PDF documents with your data, then saving the PDF document with your data intact.

The essentials for my usage is to create a document in Acrobat with my fields specified (fonts, color, size, etc.) I save it as a template if you will then basically call ActivePDF and push my data from Access through to the template and save it as another PDF document, and rock on.

If your considering doing anything like what I described the cost is minimal to the amount of time it will save. I believe they have a full trial if your interested?
0
 
LVL 1

Author Comment

by:labreuer
ID: 10684236
This definitely looks like a solution -- how much research did you do into this (e.g. did you find/try any other products)?
0
 
LVL 8

Expert Comment

by:ampapa
ID: 10684297
No, once I found it I stopped looking. I'm sure there are some others available as always there's more than one way to skin a cat, but ActivePDF worked well for my situation.

ampapa,
0
 
LVL 1

Author Comment

by:labreuer
ID: 10687775
Do you have any examples of a pdf with forms, then after you've added the data and flattened the pdf?
0
 
LVL 8

Expert Comment

by:ampapa
ID: 10691848
Unfourtunately they are tax retuens and I can't supply those to you but I could probably send you a form ready to be populated with data?
0
 
LVL 1

Author Comment

by:labreuer
ID: 10708760
How complicated did your dynamic content get?  It seems that you might have only done very simple things with ActivePDF.  If I wanted to, for example, have a template that allowed for a table of dynamic size, it seems that ActivePDF would not be able to do this...
0
 
LVL 8

Accepted Solution

by:
ampapa earned 2000 total points
ID: 10709877
I'm not sure that you can create a dynamic table in a PDF document? I can't answer that. I guess you can if your generating the PDF  document on the fly?

All I can say is that ActivePDF is great for filling in data. Create a form with some fields map those fields to the same name as fields in your DB, add some source code and your off. I hope I'm not over simplifying things, but I thought it was done rather well, a little expensive but non the less.

This is from the help file I hope they don't mind, sorry the images won't post.

'***********************************************************
This example fills a PDF template using DBToForm.
To define the fields of an invoice:

1 Using Acrobat to define your PDF fields, create the input PDF. See Creating a PDF Template.  When defining PDF fields, name the fields the same as the database fields. When naming line items, name them dbFieldx where x is the line item number.  Below are examples of the corresponding Access database tables.  

Below are examples of the corresponding Access database tables.

Orders:
Field Name                    DataType

company                       text
name                            text


Details:
Field Name                   DataType
OrderID                        text
QTY                             number

 

Below is the defined Invoice PDF:
(picture of form with fields named similar to DB)

 
Example source:

<%

Set Toolkit = Server.CreateObject("APToolkit.Object")
' Open the output file
R = Toolkit.OpenOutputFile(Server.MapPath("myInvoice.PDF"))
' Open the input file
R = Toolkit.OpenInputFile(Server.MapPath("APInvoice.PDF"))
' Define the master query's variables
DSN = "DBQ=" & Server.MapPath("Toolkit.mdb") & _
";Driver={Microsoft Access Driver (*.mdb)};"
UserID = "Admin"
Password = ""
Options = -1
' Select all of the records from the orders file
SQLQuery = "select * from Orders"
' Set up the master query
Toolkit.SetMasterQuery DSN, UserID, Password, Options, SQLQuery
' Select all of the related records from the orderDetails file
SQLQuery = "select * from OrderDetails where OrderID ='|OrderID|"
' Set up the Related query
Toolkit.AddRelatedQuery DSN, UserID, Password, Options, SQLQuery
' Since our line items field names do not have a _
separator between the name and line number we need to tell the toolkit that
Toolkit.SetDBMultiRowSeparator ""
' Since we took the time to set up the form formatting, _
we should turn that on too
Toolkit.DoFormFormatting = True
' Finally, we want to make the file truly read-only with NO fields in it
Toolkit.SetDefaultDBMergeFlag –998
Toolkit.FlattenRemainingFormFields = True
' Execute with single page output!
Toolkit.DBToForm False
Set Toolkit = Nothing

%>  
0
 
LVL 1

Author Comment

by:labreuer
ID: 10710470
Ok, you've definitely answered my question if I just need simple single-format fields, so I'm going to give you an A.  If I want more, I will probably have to look into dynamic PDF generation.
0
 
LVL 8

Expert Comment

by:ampapa
ID: 10712514
Thanks for the grade.

I hope things work out for you.

ampapa,
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question