Author Topic: Issue _PRINTIMAGE (Resolved)  (Read 5644 times)

0 Members and 1 Guest are viewing this topic.

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Issue _PRINTIMAGE (Resolved)
« on: December 05, 2018, 11:32:16 am »
Hello
I'm programming on a computer with windows 10 64 bits and I'm doing a program that should print a document in the printer. I am using the _PRINTIMAGE example of Qb64 wiki and the document is printed perfectly with the printer and with PDF Creator.
I have tried the program in another computer that I have with Windows 7 sp1 and the page is white, both in the printer and in PDF Creator. In contrast, the preview comes out perfectly.
Could it be a _PRINTIMAGE error?
Thanks
« Last Edit: December 24, 2018, 10:39:36 am by Juanjogomez »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #1 on: December 05, 2018, 01:21:38 pm »
Odd that going backwards to Win 7 would create a problem. It is usually the other way around. Questions that might help developers...

1) Do both computers share the same printer?

2) Do you have the same version of QB64 installed in both computers?

3) Is access to printing the same. In other words are both printed over network, usb, etc.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #2 on: December 05, 2018, 03:08:53 pm »
Hi. I have none problem with _PRINTIMAGE and HP wirelless laser printer in Windows7 SP1, 64 bit. Is printer, which you use set as default?

I was still thinking - check in the preview to select the option to automatically adjust the print size. If PrintImage started the printer, it looks like the print is out of the printable area on the paper
« Last Edit: December 05, 2018, 03:17:22 pm by Petr »

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #3 on: December 05, 2018, 03:38:08 pm »
Hi, both computer have the same version of qb64 as I use the program from a folder I have created in Dropbox.
The printer is connected via network to both computers.
The printer is set as the default one and when I use PdfCreator as the default printer it also prints a blank page, I have also tried selecting the "adjust to paper size" setting in the printer but the result is the same.

Thank you

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #4 on: December 07, 2018, 07:00:55 am »
_PRINTIMAGE need some windows plugin to pass the screen to the printer? It is the only thing that occurs to me.
I do not know what to do to make it work on that computer

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #5 on: December 07, 2018, 03:05:31 pm »
Hi. I think, not  need extra plugin. Try clear the print queue, turn the printer off and on. If it does not help, try to check if the white font color is not set. If not, what do you see if instead of _PRINTIMAGE something& use SCREEN something&? Can you send a program?

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #6 on: December 07, 2018, 03:09:53 pm »
Try use _NEWIMAGE (210, 297, 32) for A4 format.

FellippeHeitor

  • Guest
Re: Issue _PRINTIMAGE
« Reply #7 on: December 07, 2018, 09:35:50 pm »
Too low resolution, ain’t it?

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #8 on: December 08, 2018, 04:35:47 am »
Hi Fellippe, if I can rely on the correctness of the help for the PRINTIMAGE statement, it is stated that, I quote:

"The image may be stretched disproportionately using normal screen sizes. To compensate, use a _NEWIMAGE screen that is proportional to the paper size. e.g. A 640 X 900 SCREEN page is roughly the same as 3 times a 210mm X 297mm paper size."

So I figured the basic resolution in the ratio of 1: 1 would be what I wrote - 210x297

Definitely, if the source code is added here, I'd like to look at it later. I'm still working on the bathroom, I added her photo to the thread of the Christmas theme. I like to try it, but - it's strange that Windows 10 works as it does, but Windows 7 does not. Rather, I have encountered the opposite problem.

FellippeHeitor

  • Guest
Re: Issue _PRINTIMAGE
« Reply #9 on: December 08, 2018, 04:47:24 am »
By relying on the correctness of the help you’ll actually create a _NEWIMAGE(640, 900, 32) which is proportional to A4 paper (which is 210 x 297 millimeters in size). But even 640x900 is small resolution for quality printing. My point is that 210x297 will produce bad quality results.
« Last Edit: December 08, 2018, 04:52:24 am by FellippeHeitor »

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #10 on: December 08, 2018, 04:54:46 am »
I try it :-D

Juanjogomez: Try this very easy source, if it print to paper text "Test" in black to white background. Works correct for me:

Code: QB64: [Select]
  1. a = _NEWIMAGE(640, 900, 32)
  2. CLS , _RGB32(255, 255, 255) 'white background
  3. COLOR _RGB32(0, 0, 0), _RGB32(255, 255, 255)
  4. PRINT "Test"
  5.  

If is just set COLOR _RGB32(0,0,0), is printed black quad without readable text. This output can be see if you use SCREEN a instead of _PRINTIMAGE.
If is used COLOR _RGB32(0, 0, 0), _RGB32(255, 255, 255), so as in program, then SCREEN show correct output and _PRINTIMAGE print correctly.

Aha! With other tests, I found that the 210x297 resolution returns a three times larger print output than the screen. This means I have misunderstood the text in the Help. I am sorry for my poor knowledge of English.
« Last Edit: December 08, 2018, 05:11:22 am by Petr »

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #11 on: December 09, 2018, 05:43:15 am »
Hi Petr and everyones,

a = _NEWIMAGE(640, 900, 32)
_DEST a
CLS , _RGB32(255, 255, 255) 'white background
COLOR _RGB32(0, 0, 0), _RGB32(255, 255, 255)
PRINT "Test"
_PRINTIMAGE a

That program prints a blank sheet.

As I mentioned, it only happens with a computer. I have tried on 3 computers connected to the same printer, and even with another printer, and it works fine, except with that computer. As I mentioned, it has Windows 7 SP1 64 bits. In another computer with windows 7 SP1 of 32 bits and another one with windows 10, they work perfectly.

It is not a program problem, but the _PRINTIMAGE command, which does not work on that computer.

FellippeHeitor

  • Guest
Re: Issue _PRINTIMAGE
« Reply #12 on: December 09, 2018, 07:04:26 am »
Please try this, both on the computer that's doing fine and on the one that doesn't seem to like _PRINTIMAGE:

Code: QB64: [Select]
  1. LPRINT "Test"

Let me know if it works.

Another thing to try: run your program in admin mode on the faulty machine. Does it make any difference?
« Last Edit: December 09, 2018, 07:12:57 am by FellippeHeitor »

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #13 on: December 09, 2018, 01:21:54 pm »
Hi FillippeHeitor,

I try run the program in admin mode and print a blank page.

LPRINT "Test" print a blank paper
« Last Edit: December 09, 2018, 01:23:17 pm by Juanjogomez »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Issue _PRINTIMAGE
« Reply #14 on: December 09, 2018, 01:29:40 pm »
Well unless the printer's out of ink, I give up.

Anyway, if it won't process _LPRINT then the problem isn't _PUTIMAGE.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/