Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old May 5th, 2003, 02:25 PM
-vertigo- -vertigo- is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Louth, Lincolnshire
Posts: 314 -vertigo- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 24 sec
Reputation Power: 2
132 col dot matrix printing from IE

This issue is probably one of the most annoying ones I have ever seen. 99.999% of businesses use dot matrix printers with continuous stationery, but html seems to have no support for them.

Let me explain.

I am writing web reports, linked to SQL server. This database is to replace an old Informix based one. The old system prints text reports on continuous stationery, 132 columns.

At the moment I am using the Generic/Text only driver. The printer is a Printronix P5005B, but it has Epson FX/IBM Proprinter compatability. So basicly it is your stock standard, run-of-the-mill dot matrix printer.

The problem is getting the printouts to use the full width of the paper. In Internet Explorer, there are various paper formats, but none that matches this one. The paper is about 15x9 inches. The closest format available in IE is 15x11. I am using Internet Explorer 6.0, Win2K (not by choice, don't bother suggesting other OS, etc).

When I use this format, the whole width of the paper is used, but the only way to see this is to print a plain text file from IE. Doing this, about every 5th character is two characters together. The output is squashed together slightly.

I can't find how to specify the font width for text-files in IE. I can of course use a style sheet to specify the font, but as soon as I make the file html, the size of the content is limited by the window. I can of course use an inline div to set the width of the page (by style sheet or simply width=1200, etc.), this will be my next endeavour.

What I need to know is: Is there a way to explicitly specify the font size for text-files in IE? Alternatively, if I must use a style to set it, and a div to set the width of the page, how does the point (ie. 10pt, etc) relate to characters per inch? For example, if the printer uses 12 characters per inch, how does that relate to pt's.

There has to be many readers who have gone through this quagmire already. Any advice?

Thanks.
-vertigo-

Reply With Quote
  #2  
Old May 5th, 2003, 05:18 PM
marcel marcel is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Nieuw Vennep ,Netherlands
Posts: 108 marcel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: 132 col dot matrix printing from IE

In our company we have some webpages with a print button. and if you press the print button its printed from the server. this way we have 100% control over the printer and don't have to worry about the client.

Reply With Quote
  #3  
Old May 6th, 2003, 07:13 AM
-vertigo- -vertigo- is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Louth, Lincolnshire
Posts: 314 -vertigo- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 24 sec
Reputation Power: 2
slight progress

I have found now that using a PRE tag with customised font-size and line-height seems to work well.

Using the following styles results in the characters being properly dimensioned:

BODY { padding: 0px; margin: 0px }
PRE { font-size: 18px; line-height: 55% }

I then set the page margins to 0, lost the header and footer, and it seems to be printing relatively correct.

Unfortunately, everything on the page will now need to be padded with spaces to the correct width, because the PRE keeps all whitespace.

I can't help but think there must be an easier way to do this.

This is vaguely reminiscent of formatting input screens in console apps. I may implement a gotoxy function that pads spaces/n's to reach the desired column.

Much fun...

Reply With Quote
  #4  
Old May 6th, 2003, 08:56 AM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: 132 col dot matrix printing from IE

And what if you use a fixed-width font such as courier? (meaning: lose the <pre>, but use something like <span style="font-family: courier"> )
Note that in modern browsers it is possible to set different styles for print and screen media in CSS.

Reply With Quote
  #5  
Old May 6th, 2003, 09:32 AM
-vertigo- -vertigo- is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Louth, Lincolnshire
Posts: 314 -vertigo- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 24 sec
Reputation Power: 2
RE: 132 col dot matrix printing from IE

Are you saying I shouldn't use padded spaces to set cell widths/cell spaces? I can use a large table, and style all the TD's as Courier, etc.

Different columns are padded differently. For example, some columns are 1 char apart, some are 5 apart. I could give each column a seperate class, and style left and right margins for each. That would possibly be slightly more structured. But what do I do when data for a cell is too large?

I have written a quick function to handle padding trimming and right/left justification for a cell, perhaps I should use this in conjunction the the styled table.

When padding the TD's I will use multiples of 18 pixels.

How do you specify different styles for print/screen?

Reply With Quote
  #6  
Old May 6th, 2003, 04:06 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: 132 col dot matrix printing from IE

hmm, and I thought the problem was in the fact that <pre> keeps whitespace.
I guess you should be able to use PHP for the padding and all.
As for different styles for print and screen, check this: http://www.w3.org/TR/REC-CSS2/media.html

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > 132 col dot matrix printing from IE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway