I need a routine for printing out to pre-printed paper forms.

We recently had a programmer install in our office software written in php , and to be used locally through localhost on our pc, mysql, php and apache2.2 all installed, the software is working well, however we have a large supply of pre-printed forms which we want to use up first before using the print direct to ordinary paper, the printout we have just now is printed in a graphic format, and can't find a way to adjust this to our form, we need a routine that will collect data directly from our print.php file and adjust it to suit to our form format.

The programmer said this was not possible, but I am sure there must be a way,


Can anyone help?

you will need to change the print form to look like your paper to be printed on, then the code will need to resemble the $print properties for each line to be printed.

Do a google search for php and pdf print styles

Hi thanks for you reply, have checked and maybe in-design may do the job, but collecting the data to be printed may be a problem according to the print script i have, I am a novice when it comes PHP,

Here is the print script that is used just now.

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Print Voucher</title>
</head>
<link rel="stylesheet" href="style.css" type="text/css">
<?php
error_reporting(0);
include_once 'db.php';


if (!isset($db_conn)) {$db_conn = db_open();}
?>


<body>


<form id='frmPrint' name='frmPrint' method="get">
<DIV id='divPrint' name='divPrint'></DIV>
<script><!--
var objPrint = document.getElementById("divPrint");
objPrint.innerHTML = window.opener.document.getElementById("divInvoice").innerHTML;
window.opener.document.getElementById("divInvoice").innerHTML;
//-->
</script>
</form>

Swefil:
Give this a try and let us know if it works for you:

http://www.smartform.com/

Casper, Thanks for the tip, yes it worked like a dream, easy to setup and use, at least we can print our vouchers manually for now, using our database is a problem for at the moment, but I am sure we will be able to in a few days when our programmer comes back and give us the correct fields for input, possibly need to do a double function, first transferring to msaccess db so as to use the obdc function in the software.

Best regards
Swefil

Great, I'm glad you got a work around for the time being. If you need any other assistance don't hesitate to ask.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.