473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to print an output...linking with printer

123 100+
Hi ..
My result from Php scripts are no of files .
I want to link them to printer for printing.How can I do so.?
Ouput looks like
Expand|Select|Wrap|Line Numbers
  1. file1
  2. file2
  3. file3
  4. file4
how can I basically make output file1 as an hyperlink and when user clicks it ...It should be printed.
Sep 18 '08 #1
1 1745
ajd335
123 100+
I have used the below code for the above
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $title = " Form1";
  3. if(isset($_POST['fname'])) { $f1 =  $_POST['fname']; }
  4. if(isset($_POST['lname'])) { $l1 =  $_POST['lname']; }
  5. if(isset($_POST['add'])) { $a1 =  $_POST['add']; }
  6. if(isset($_POST['date'])) { $d1 =  $_POST['date']; }
  7. $fullname = $l1.","." ".$f1;
  8.  
  9. $dirname = "/home/gr/ereports/O1"  ;
  10. $handle = opendir($dirname) or die('cant open');
  11. $ans = shell_exec("find /home/gr/ereports/O1/$d1*  -name \"*.ps\"  -exec grep -i -e $fullname  {} \\; -print0 ");
  12. $ans1 = explode("\n",$ans);
  13. foreach($ans1 as $key => $value)
  14. {
  15. $str=  substr($value,0,56);
  16. print $str;
  17. print('<a  href ="#" onclick = " print1(); return false;">Print</a>');
  18. echo "<br/>";
  19. }
  20. function print1()
  21. {
  22. $fin = shell_exec("lpr -Pprinter1 $str");
  23. }
  24. ?>
  25.  
My current $str contains the below.And thats the output from the above script...
Expand|Select|Wrap|Line Numbers
  1. /home/path to fil...../file1.ps print
  2. /home/path to fil...../file2.ps print
  3. /home/path to fil...../file3.ps print
  4.  
Now I want to do something so that when I click on print It should print the desired file on which It was clicked.
I am not getting the proper one...
Whats wrong in that ??
Sep 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Manfred Schwab | last post by:
Recording messages and print statements in a textfile during program execution. Is there a similar command to redirect errormessages or print statements into a standart asciifile during...
5
by: Devin Dow | last post by:
Print Preview looks perfect, but the Printout is cut off (extends off the page). Has anyone else experienced this? A3 paper size seems to exacerbate the problem. I can't believe it because...
16
by: John Baker | last post by:
HI; I feel like a fool..I put CUTE FTP in my last request for help --it should have been CUTE PDF! I have FTP on my mind because I have been working on a web based application, and somehow my...
2
by: Salad | last post by:
It's been years since I captured printer output, basically I've forgotten how to do it. Can you refresh my brain and let me know how it's done if it can be done in Access? I don't want the...
2
by: Gidi | last post by:
Hello, I've created a Document which i want to print using the PrintDocument class. In the document i draw some strings, and lines. When I PrintPreviewing my document (using the PrintPreview...
13
by: Daniel Crespo | last post by:
Hi to all, I want to print a PDF right from my python app transparently. With "transparently" I mean that no matter what program handles the print petition, the user shouldn't be noticed about...
56
by: peng | last post by:
Hi, I am development a project using C#.Net. Inside application, it needs to print labels on different Zebra label printers on the network. I used a shell script, but it only worked on the...
1
by: Gilberto | last post by:
pks00 Expert 280 Posts April 16th, 2007 01:08 PM Re: How to print MS Access 2000 report to PDF995 printer by VBA Code Sweet, your using pdf995, makes answering this question that much...
4
by: steve | last post by:
When I print to a file using C# print what format is the file written out in? I am debugging a print routine and don't want to do the actual print but would like to open the output file in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.