1819870 Members
2545 Online
109607 Solutions
New Discussion юеВ

Print bold on one line

 
Peter Zeiszler
Trusted Contributor

Print bold on one line

I have users that print out a TXT file. They want to change one line to print in Larger Bold font. I know how to change the complete document but am not finding anything on directly changing one line to change fonts and print bold.

I can do it with escape sequences on the terminal (i.e. BOLD/Blinking) but thats all escape sequences for the terminal.

All I am thinking of is PCL codes or convert to Postscript and they learn how to manage fonts/sizes in postscript languages.
Any ideas?
11 REPLIES 11
Steven Schweda
Honored Contributor

Re: Print bold on one line

> [...] print out a TXT file. [...]

You may think that that's a description of
what's happening, but it's not.

What kind of printer?

"Print out" how, exactly? (What, exactly,
gets sent to the printer: plain ASCII text,
PCL, PostScript, ...? How is it sent to the
printer?)

What you need to do differently depends on
what you're doing now.

> All I am thinking of is [...]

Those are probably the kinds of things which
you will need to do. But you might already
be doing one of them, and I can't tell
without more information.
Peter Zeiszler
Trusted Contributor

Re: Print bold on one line

It is a .txt file with ascii. No postscript or PCL files or knowledge.

We are printing directly to HP and Canon printers via stream printing through DCPS and Scriptserver usually to port 9100.

Was thinking of having them convert using A2PS and then they could insert the postscript codes to change the font. Of course neither me or the admin in charge of the application know postscript.

John McL
Trusted Contributor

Re: Print bold on one line

What's the capability of your printer when it comes to printing bold (or whatever else)?

Maybe you could embed some special control characters or codes into your your output. You might also try using a device control library (or is that just for forms?) or create your own special print symbiont.

You might also like to look at some TXT to PDF conversion tools (assuming your printer can handle PDF) and seeing what embedded codes (bold, underline etc.) they can accept.

My advice is to avoid doing this if you can. Whatever you do I think you'd be making a help of trouble for yourself regards initial work and on-going support when printers are replaced.
Peter Zeiszler
Trusted Contributor

Re: Print bold on one line

The printers can print bold, landscape, all kinds of things. They are shared network printers that everyone prints to from multiple OSes.

I know I could change the overall look with forms - have done that on some specific queues where they want specific layouts, font sizes, scales, etc.

Its the trick of changing just one line to larger font &/or bolded so that its easier to spot in their print out.

I always try here when I get stumped because some people here have done miracles with coding. I can't do the PCL or Postscript for them - not covered. But I can help the application admin further along.
Steven Schweda
Honored Contributor

Re: Print bold on one line

> It is a .txt file with ascii. No postscript
> or PCL files or knowledge.

Part of the fun here is that you could be
sending PostScript to your printer without
knowing it.

> We are printing directly to HP and Canon
> printers

Not many details there.

> via stream printing through DCPS and
> Scriptserver usually to port 9100.

I know nothing about "Scriptserver", and not
very much about DCPS, but I believe that DCPS
sends PostScript to a printer. (It certainly
sends PostScript to LasetJet 4MV.)

> Was thinking of having them convert using
> A2PS and then they could insert the
> postscript codes to change the font. Of
> course neither me or the admin in charge of
> the application know postscript.

That would be one way to get the job done.
DCPS should be smart enough to notice that
it's getting PostScript instead of plain
ASCII text, and then not do its own
text-to-PS conversion. (I'd look at the DCPS
manual, but HP's new modern-PDF-only
documentation policy defeats my old XPDF
program, and the disk in my Mac just died.)

A possibly easier method would be to convert
the text to HTML, where it's pretty easy to
fiddle with text size and boldness, and then
find some HTML-to-PS converter. (A Web
browser can do it, but it may be difficult to
get a Web browser to do it in a
non-interactive way, and without adding its
own header and footer noise.)

Many years ago, I actually looked at
PostScript long enough to do something
useful with it, but it's been so long that I
don't remember exactly what it was that I
did. (It's sad, isn't it?) I do remember
spending a lot of time leafing through a fat
book from Adobe. (Probably available in PDF,
now.)

The amazing thing (to me) is how little I
print anything nowadays. I probably haven't
use the LaserJet for over a year. I
sometimes miss the thick piles of tractor-fed
green-bar program listings, but not enough to
make me feed the LaserJet.
Steven Schweda
Honored Contributor

Re: Print bold on one line

> [...] changing just one line [...]

One thing about playing directly with the
PostScript: It's a _page_-description
language. So, if you replace a line of small
text with a line of larger text in a simple
way, then you may spoil the bottom margin of
your page. Of course, many things are
possible, and it might be easy to put a blank
line (or more) after the to-be-big+bold line
(in the ASCII text), and then replace all of
them with one bigger bold line (in the
PostScript).

In other words, if you're fiddling in the
middle of a multi-page document, don't expect
text to get shifted automatically onto the
next page (or in from it). The guy who makes
the PostScript is the guy who decides what
fits on a page. A PostScript printer doesn't
do that job.
RBrown_1
Trusted Contributor

Re: Print bold on one line

It seems the object of the exercise is to make a single line on a page stand out.

Before these new-fangled printers that do strange stuff, you would do something like put a string of asterisks from the end of the text to the right margin or something. Or underline with a bunch of "=" on the next line. Or a line of "-" above the line you want to stand out, if it is a section break.

Low-tech, but won't mess up your page formatting like changing the height of a line after a full page has been laid out.

But let me read your problem description again. Changing to bold from normal (and back) should not change the line height. It is a long time since I spent a few minutes with PCL, but the reference manual I just checked shows ansi-like escape sequences. Bracketing your string with the appropriate Bold and Normal sequences should not be too big a change to your application program. DCPS is supposed to be able to print PCL files. You might have to change your print command, or maybe DCPS will figure it out automatically.

HELP PRINT_PARAMETERS DATA_TYPE

Robert Brooks_1
Honored Contributor

Re: Print bold on one line

(I'd look at the DCPS
manual, but HP's new modern-PDF-only
documentation policy defeats my old XPDF
program, and the disk in my Mac just died.)

--

If you know the name of the document, you can still find the HTML version. Here's the V8.4 System Services Reference Manual

http://h71000.www7.hp.com/doc/84final/4527/4527pro.html

-- Rob
Hein van den Heuvel
Honored Contributor

Re: Print bold on one line

Maybe just maybe the interpreter in the printer recognized the ancient overprint as bolding indicator?
Oh the memories! LA36's and the likes, Runoff!

Worth a quick try?
Duplicate or triplicate a data line and glue it back together with a naked ( 13, "\r", \015, %x0D )

Hein
Phil.Howell
Honored Contributor

Re: Print bold on one line

try putting E at start of line
and F at the end

some printers honour ancient codes

Phil
Hoff
Honored Contributor

Re: Print bold on one line

Unfortunately, VMS is greatly lacking in tools in various areas, and text processing is unfortunately one of the areas. This task is far easier on Unix.

text2pdf is a few years old, and source is available, and you can probably coax that tool into generating a PDF that you can then embed bolding, and tweak the tool to provide a way to detect a home-grown bolding tag in the text file and... Well, you get the idea.

At least some of groff has been ported to VMS, so that's likely another path, and (if it's been ported) that has back-ends that can generate various formats including Postscript. The macro there is .B to bold a line.

There's a decent write-up on groff here:

http://linux-redhat.net/Wiley-Fedora.6.and.Red.Hat.Enterprise.Linux.Bible/final/BBL0059.html

There's an ancient version of groff for VMS here:

http://digiater.com/openvms/decus/lt92b/gnusoftware/

There does not appear to be a version of groff in GNV.