Paradox Community
Search:

 Welcome |  What is Paradox |  Paradox Folk |  Paradox Solutions |
 Interactive Paradox |  Paradox Programming |  Internet/Intranet Development |
 Support Options |  Classified Ads |  Wish List |  Submissions 


Paradox Newsgroups  |  Paradox Web Sites  |  Paradox Book List  |  FAQs From The Corel FAQ Newsgroup  



Subject: FAQ:PdoxDOS: Printing Pictures 2001.02.05

Version 1.0 (2001.02.05)
written by Michael Kennedy <info@kennedysoftware.ie>
edited by Mike Irwin
====================
0. Introduction
====================

This FAQ provides information for those wishing to
print images from Paradox for DOS. Its principles
should be good for any DOS program. If you have
items that should be added, please contact the author.

The printer used here is an HP Series II, but the same
approach can be used with any printer: you just ned to
obtain the printer programming manual that will tell
you the various Escape codes that you need to know.
Alternatively, many printers will be switchable into an
"HP Emulation" mode. If not, "Epson emulation" is also
frequent, and Epson manuals are fairly easy to get hold
of.

-------------------------------
 0.1 Legal Info and Disclaimers
-------------------------------

Paradox is a trademark of Corel.
Borland Database Engine (BDE) is a trademark of Inprise.

The information provided in this FAQ is provided "as is"
and is not warranted in any way. The information provided
in this FAQ is not endorsed or authorized by Corel or
Inprise in any shape, form, or manner. The editors
claim NO responsibility for ANY illegal activity
regarding this file, or as a result of someone reading
this file.

You may distribute this file, as long as the copies are
complete, unaltered, and are in electronic form only.

-------------
 0.2 Feedback
-------------

Please send feedback in a Corel Paradox newsgroup or the
news:comp.databases.Paradox newsgroup to any of the FAQ
Team mentioned in the "FAQ: FAQ FAQ" document.

Please specify the FAQ name and section number the
comment applies to, if any.

==============================
1. General
==============================
Many years ago, I implemented an app in PDoxDOS 4.5
which prints Graphs, Reports, BitMap Logos, etc. And
sometimes it prints ALL of these on the SAME SHEET -
which was a bit tricky as far as I recall. And to
standard LaserJet-II printers. The app is still run
every day - at a very large multi-national...

Basic point - it's no great problem to do it - and it
required no special printer add-ons... It involved
getting the bit-map file(s) saved as a print-image,
with inbuilt PCL codes. These files are just a bunch of
standard HP-LJ Esc-sequences  - millions of them. These
had to be manually changed a little (internally) to
prevent page-ejects, etc. Then, when the Paradox report
is ready, these modified bit-maps were sent to the
printer, together with the standard reports, and all
printed perfectly on the same sheets, etc.

==============================
2. Details
==============================

Starting with a BMP image that you wish to include in
a report, save the BMP file in Print form - same as
redirecting a raw printout of it into a file. Pretend
that it's going to a Laser-Jet II, because the LJ-III
driver may be a little different from the following -
though the same approach applies.

The LJ-II file needs to be tweaked slightly. We did
some of this manually, and wrote a few small utilities
also to automate some of it. This is a "Binary/Hex"
file, and whoever digs into it will need to be familiar
with the Escape sequences sent to a LJ-II. There's no
magic to the solution: just understand the HP commands,
and tweak the file accordingly.

Here's the changes I made/make...

Ec 45                [Reset]               : E
  <--- out !!
Ec 26 6C 30 53       [Simplex Mode]        : &l0S
  <--- out !!
Ec 2A 72 30 46       [Current Orientation] : *r0F
  <--- out !!
Ec 26 6C 30 4F       [Set Orientation]     : &l0O
  <--- out !!
Ec 26 6C 31 48       [Upper Tray]          : &l1H
  <--- out !!
Ec 26 6C 32 36 61 34 64 31 65 34 35 46     : &l26a4d1e45F
  <- remove the "2 6a" bit (Set Paper Size)
Ec 2A 74 33 30 30 52 [ ? ]                 : *t300R
Ec 2A 62 30 4D 0D    [Graphics Mode]       : *b0M?
Ec 2A 70 31 30 33 59 [Set Y co-ord]        : *p103Y
Ec 2A 70 32 31 35 58 [Set Y co-ord]        : *p215X
Ec 2A 72 31 41       [Start Graphics]      : *r1A

 ......... etc ........

Ec 2A 72 42          [End Graphics]        : *rB
   0C                [Form Feed]           : ?
     <--- out !!
Ec 45                [Reset/Page-eject]    : E
  <--- out !!

A bit tricky in a Hex editor; easier in a program.
Note that some commands are REMOVED, and the file
shrinks accordingly. Some Hex editors can't shrink
nor expand files... (This ain't the same as REPLACING
them with Nulls, Spaces, etc !!!).

When printing, send the Page contents from Paradox into
a disk-file - as usual, and copy this to the printer
port. This should not have Page-ejects at the end -
obviously. Then send (copy) the LJ-II logo/signature
also. Send a Form-Feed at the end, or Esc-E, or
whatever. All will print correctly on
the page !. If you want to position the graphic at a
specific (variable ?) location of the page, etc, etc,
you'll need to insert suitable LJ commands,
or ensure that the PDox report/graph sets up the page
acccordingly so that the graphic falls into the desired
location.


Paradox Community Newsgroups


 Feedback |  Paradox Day |  Who Uses Paradox |  I Use Paradox |  Downloads 


 The information provided on this Web site is not in any way sponsored or endorsed by Corel Corporation.
 Paradox is a registered trademark of Corel Corporation.


 Modified: 15 May 2003
 Terms of Use / Legal Disclaimer


 Copyright © 2001- 2003 Paradox Community. All rights reserved. 
 Company and product names are trademarks or registered trademarks of their respective companies. 
 Authors hold the copyrights to their own works. Please contact the author of any article for details.