News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Print Library

Started by donkey, March 10, 2005, 01:48:33 AM

Previous topic - Next topic

shankle

I do a lot of printing with most of my programs.
The problem that I have is the programs will work on printer manufacture A but not
on printer manufactures B thru Z.
Then there is the resolution problem. What fills a whole page on my printer
fills a 3rd of a page on printers B thru Z. Is it a problem of the cheap printers
or a programming problem or both?
Regards,
JPS

The greatest crime in my country is our Congress

ipadilla

Hi shankle,

I would like to know what´s the metho you are using to get all the parameters (scape sequences). Are you using a Access database or something similar to collect the scape sequences for all the most important printers in the marker?. How do you select different printers?. I remember that I worked on this theme in VB  some years ago.
ipadilla
 



shankle

Hi Ipadilla,

I write all my programs for an HP officejet printer. I don't do anything with scape
sequences. I don't use any database. I don't have any way of finding out about
different printers.  I would guess from what you say that the lack thereof is
probably my problem. However I don't have the resources to rectify the problem.
JPS
The greatest crime in my country is our Congress

raymond

<ESC> sequences were necessary in the "old days" under DOS when you had direct access to the hardware. Under more modern operating systems such as Windows, you have to rely on the system's APIs which then uses the installed printer drivers.

If the proper driver is available for the printer you want to use, it's "simply" a matter of  advising the operating system of your choice and printing should then be the same for all installed printers. Unfortunately, I have not yet looked into that area and do not presently know how to do it. :( :(

This would be one of the many details to work on when the project gets under way. :clap:

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

ipadilla

Hi Raymond,
Thank you for replying. I´m afraid I´m anchored in the past. If I understand you well, the best way for this programming is using API´s. I have searched on the web and there is not too much information about MASM32 printers programming. I have found some examples in C++.
ipadilla   

MichaelW

The example program in \masm32\examples\exampl02\showdib\ is supposed to print bitmaps, but it does not work on my system.

eschew obfuscation

PBrennick

Yeah, it doesn't work for me, either.  Is any of this stuff tested before used?

Paul
The GeneSys Project is available from:
The Repository or My crappy website

six_L


;   Get printer DC
;   --------------
      Invoke RtlZeroMemory, ADDR pd, SizeOf pd ;+ <===
      MOV pd.lStructSize, SizeOf pd ;+ <===
      
      MOV EAX,hInstance ;+ <===
      MOV pd.hInstance,EAX ;+ <===
      
      MOV pd.Flags,PD_RETURNDC or PD_SELECTION ;+ <===
      
      mov eax,hWnd
      mov pd.hWndOwner,eax

      invoke PrintDlg, ADDR pd

;============================================
printed small

regards
regards

PBrennick

six_L,
That is a very nice repair job.  You mentioned that it prints small, it does, but if you stretch it to fit the window (Show -> Stretch to Window) it will fill the entire printed page!  It probably is even more adjustable, just no time to play with it right now.

But thanks for the fix, just goes to show, structures are meant to be filled correctly.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

kenngough

I have developed my own Busines Basic run-time that has the logic to handle printing.  It is written in MASM32, can handle multiple fonts, multiple pages, line drawing etc.
This runs in Console Mode, uses the Windows API calls, so as not to be printer dependent.  The source is not HLA but is extremely well documented.  I would gladly share any printing logic I have developed.  I would gladly appreciate anyone who has an example of printing graphics (pictures) in MASM32.

Kenn

kennGough@gmail.com

raymond

I have never tried to print graphics. Howevere, based on my successful attempts to print text, here's what I would try:

- Get the DC where your graphic resides (srcDC)
- Create the printer DC (destDC)
- BitBlt (or StretchBlt) from the srcDC to the destDC
- Send it to the printer
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Draakie

Chib wrote a brilliant Rich Edit XXX LIB
implementation some years back - source and all
is public domain I think ............ ::)

http://www.chib.boom.ru/

Might help here and there for pinching an idea. :U

Draakie
Does this code make me look bloated ? (wink)

Siekmanski

This is an example how 2 print text and pictures to a printer
It's a stripped version from my other sources but it does the job

Have fun,  Siekmanski