Skip to main content
Inspiring
December 13, 2011
Question

adding data from a webpage to a PDF document

  • December 13, 2011
  • 1 reply
  • 2851 views

i have the already populated from the PHP DB

using the following

{Recordset1.userid}

<td width="250" class="table-text"><?php echo $row_Recordset1['email']; ?></td>

<td width="250" class="table-text"><?php echo $row_Recordset1['PhoneMobile']; ?></td>

<td width="200" class="table-text"><?php echo $row_Recordset1['prop_id']; ?></td>

<td width="200" class="table-text"><?php echo $row_Recordset1['prop_add1']; ?></td>

<td width="250" class="table-text"><?php echo $row_Recordset1['GuName']; ?></td>

<td width="250" class="table-text"><?php echo $row_Recordset1['GuPhoneEmail']; ?></td>

i then need this information sent to a pdf document that also has other information on it. there are spaces in the PDF document for this information to go

any ideas would really help

thanks

This topic has been closed for replies.

1 reply

Rob Hecker2
Legend
December 13, 2011

I will respond just in case no one else has anything to offer on this, although it has been a long time since I have worked on such a project, and hopefully I will never need to again. I loathe working with data and the PDF format. Also, I have not done this with Acrobat 9. Hopefully, it works better in 9 than other versions.

Acrobat can work with two data formats: XML and FDF. FDF is the native format for PDF (at least it used to be).

You don't have to build your data enabled PDF with LiveCycle, but that's the expected way to do it. There are a few PHP classes on the web that will prepare your data for importing into Acrobat. The more you need the process to be automated, the more issues you will probably run into.

This kind of process is something few web designers tackle. I think you might get a better response on the Acrobat forums.

Good luck

Inspiring
December 13, 2011

i will look in the acrobat forums.

>This kind of process is something few web designers tackle

what other option are there that i may not of thought about to get the data from the PHP DB onto a form (that also has standard information) that can be printed out?

Rob Hecker2
Legend
December 13, 2011

If that's all you need, a form that looks good when printed out, then yes, there is an easier way. You can actually do it with html/css. In fact, you may be able to use the same web form that that contains all the buttons and other stuff that you don't want to have printed. Or you can create a separate html page that is formatted the way you want it for printing. The key is to use a different style sheet for printing. Here is an example:

<link href="css/basicstyle.css" rel="stylesheet" type="text/css">

<link href="css/print.css" rel="stylesheet" type="text/css" media="print">

In the example above, the css file called print.css will only be called if the output device is a printer.

So in the print.css style sheet, you can hide your buttons like this (assuming that the buttons use a class called button):

.button {visibility:hidden;}

If the printing is going to be done only on computers you control, then you can specify any font on the system, instead of using just web safe fonts. You can specify a higher resolution of any graphics, like logos, for the print version.

The one thing that can be an  issue is that on some browsers it is difficult (or impossible) to turn off the url and date that appear at the bottom of the page. This cannot be done from the html (or javascript) code, as far as I know. It must be set in the browser.

So certainly PDF can offer you a slicker looking output, but using html is a great deal easier and you really can get the output very nice.