how to print?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to print?
# 1  
Old 07-12-2005
how to print?

morning,

i have shell script which generates a HTML-File that lists printers. I should programme under the List an button if you click it the list goes to the Printer and to print me the list.

How can I realise that?

Thanks

greetz
cengiz
# 2  
Old 07-12-2005
I'm trying it with javascript before i print i want a preview window which shows me the same list but a little bit smaller so that matches on piece of paper.

my problem is i have javascript failure but i dont find the failure in my code.
this is the most interesting part of this code

JavaScript says 'Object not found'

I hope you can help me
Code:
  echo "</TABLE>" | tee -a $HTMLFILE
  echo "</CENTER>" | tee -a $HTMLFILE
  echo "<Html><Head><title>Druckvorschau</title></head>" > $HTMLFILE2
  echo "<script language='JavaScript'>" | tee -a $HTMLFILE2
  echo "function fenster()" | tee -a $HTMLFILE2
  echo "{" | tee -a $HTMLFILE2
  echo "ParaString = 'toolbar=no, location=no, directories=no, status=yes, menubar=no,scrollbars=yes, resizable=yes,WIDTH=800,HEIGHT=450';"  | tee -a $HTMLFILE2
  echo "druck = window.open('', 'fenster', ParaString);" | tee -a $HTMLFILE2
  echo "druck.document.clear();" | tee -a $HTMLFILE2
  echo "druck.document.open();" | tee -a $HTMLFILE2
  echo "druck.document.write('<CENTER>');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TABLE BORDER>');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TR>');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>Drucker');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>Kst.');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>Bemerkung');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>FP');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>Geb&#228ude');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>S&#228ule');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>Tel.');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>Kabel');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>IP-Adresse');" | tee -a $HTMLFILE2
  echo "druck.document.write('<TH>letzte Änderung');" | tee -a $HTMLFILE2
  JAHR=`date "+%Y"`
  DRUCKER=`cd $PFAD; find *.inf | grep -v AuftrDRU | sort -u`
  for DR in $DRUCKER
   do
    echo "druck.document.write('<TR>')" | tee -a $HTMLFILE2
    UG=`grep Untergruppe      $PFAD$DR | awk '{printf("%s\n",$2)}' `
    TMP=`mktemp`
    cmd=`echo "sed 's/[0-9][0-9]:[0-9][0-9]/""$JAHR/g' " `
    cmd2=`echo "sed 's/,/ /g'"`
    list=`echo "ls -al $PFAD$DR" `
    echo "$list | $cmd | $cmd2"  > $TMP
    # echo "druck.document.write('<TD><A HREF=\"dru_drucker?$UG\">$UG</A>');"  | tee -a $HTMLFILE2
    echo "druck.document.write('<TD><A HREF=\"dru_drucker\" onClick=\"SltNewWinPopup('dru_drucker?$UG','',575,600,20,20); \" >$UG</A>');"  | tee -a $HTMLFILE2

    grep Kostenstelle     $PFAD$DR | awk '{printf("<TD>%s\n",$2)}'                                            | tee -a $HTMLFILE2
    grep Bemerkung        $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}'                    | tee -a $HTMLFILE2
    grep Fertigungspunkt  $PFAD$DR | awk '{printf("<TD>%s\n",$2)}'                                            | tee -a $HTMLFILE2
    grep Gebaeude         $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}'                    | tee -a $HTMLFILE2
    grep Sauele           $PFAD$DR | awk '{printf("<TD>%s\n",$2)}'                                            | tee -a $HTMLFILE2
    grep Telefon          $PFAD$DR | awk '{printf("<TD>%s\n",$2)}'                                            | tee -a $HTMLFILE2
    grep Kabel-Nr         $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}'                    | tee -a $HTMLFILE2
    grep IP-Adresse       $PFAD$DR | awk '{printf("<TD>%s\n",$2)}'                                            | tee -a $HTMLFILE2
    . $TMP                         | awk '{printf("<TD>%s %s %s\n", $6, $7, $8)} '                            | tee -a $HTMLFILE2
    rm $TMP
  done
  echo "druck.document.close();" | tee -a $HTMLFILE2
  echo "}" | tee -a $HTMLFILE2
  echo "</script>"  | tee -a $HTMLFILE2

  echo "<form name='form'>" | tee -a $HTMLFILE
  echo "<div align='center'><a href='$HTMLFILE' target='_blank'><input type='button' value='drucken'></a></div>" | tee -a $HTMLFILE
  echo "</form>" | tee -a $HTMLFILE

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Setting up Solaris 10 to print to a windows print server

Guys, I have a issue that I am trying to rectify please advise. lpstat -t shows scheduler is running printer lext644 disabled since Mon Dec 02 19:48:18 2013. available.I have restarted the printer service and it shows online but the above says disabled. I have a lot of jobs in the print... (1 Reply)
Discussion started by: terrywhitejr
1 Replies

2. UNIX for Dummies Questions & Answers

How to create a print filter that print text & image?

Currently, I have a print filter that takes a text file, that convert it into PCL which then gets to a HP printer. This works. Now I need to embedded a image file within the text file. I'm able to convert the image file into PCL and I can cat both files together to into a single document... (1 Reply)
Discussion started by: chedlee88-1
1 Replies

3. UNIX for Advanced & Expert Users

[Solved] remove all print jobs from a print queue

Hello, Sometimes i need to clear all the jobs of a print queue and it is really annoying to cancel one by one. Is there a way to cancel all print jobs for a specific print queue with a single command instead of cancelling them one by one? My AIX system is 5.3 Thank you for your attention (2 Replies)
Discussion started by: omonoiatis9
2 Replies

4. Shell Programming and Scripting

print first few lines, then apply regex on a specific column to print results.

abc.dat tty cpu tin tout us sy wt id 0 0 7 3 19 71 extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0 0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies

5. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

6. Shell Programming and Scripting

Howto Print File Path or Print the Filename

I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction? for FILE in `cat list`; do if ; then ... (1 Reply)
Discussion started by: overkill
1 Replies

7. Solaris

Print to ps2pdf print queue

I am trying to create a printer queue, on a SunOS 5.7 system, that outputs a pdf file. There is an application running on the system that has a print button, which sends print files to the default printer. If I disable the printer, I am able to manually capture the files in /var/spool/lp/tmp and... (2 Replies)
Discussion started by: Sean_69
2 Replies

8. UNIX for Dummies Questions & Answers

Print to a ps2pdf print queue.

I am trying to create a printer queue, on a SunOS 5.7 system, that outputs a pdf file. There is an application running on the system that has a print button, which sends print files to the default printer. If I disable the printer, I am able to manually capture the files in /var/spool/lp/tmp and... (1 Reply)
Discussion started by: Sean_69
1 Replies

9. HP-UX

Print Problem in UNIX. Need to know the option to specify the print paper size

Hi, Could any one please let me know what is the option available in UNIX to print by specifying the paper size? We are using Unix11i. I could n't see any option specified in the 'lp' command to print the report by specifying the size of the paper. It would be of great help to me, if... (1 Reply)
Discussion started by: ukarthik
1 Replies

10. Shell Programming and Scripting

How do I get awk to print a " in it's print part?

The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }' I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ". Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies
Login or Register to Ask a Question