Page 1 of 1

Problem vector printing text

Posted: Mon Apr 27, 2020 3:29 am
by glennj.0158
Starting to use Vector printing. The things I don't know still vastly outnumber the things I do know.

Looking for a resource pointer so that I don't spend a lot of time wasting other's time.

Currently I have a small test program that works as proof of concept. When I ported the concept to my actual program (which was printing using DrawText) I made some kind of mistake and print the approximate number of totally blank pages. I'm baffled and don't have a simple enough chunk of code to post here. I am printing inside of the VectorOutputHeight() and VectorOutputWidth() box (which was the initial problem).

When you set up for a printer:

Code: Select all

[PrintRequester()
StartVectorDrawing(PrinterVectorOutput())
and then use VectorOutputHeight() and VectorOutputWidth() what is the relationship between the rectangle drawing area and the printer page size? Is it consistent across various paper sizes?

Any sage advice would be greatly appreciated

-Glenn

Re: Problem vector printing text

Posted: Mon Apr 27, 2020 5:45 am
by netmaestro
PrinterPageHeight() and PrinterPageWidth() are both available right after the printer is selected and before any StartDrawing or StartVectorDrawing commands. So that's the box size of which I'd stay inside. The numbers provided by these commands are dependent upon the DPI setting of the specific printer and may change from one printer to another. However, if you position and size your printed items as proportions of the box size you're working with, your output will look the same from printer to printer even if the DPI settings differ.

Re: Problem vector printing text

Posted: Mon Apr 27, 2020 9:01 pm
by glennj.0158
Thank you
For my specific printer the values are:
Page Height = 6460, Width = 4960 defining the printable space on an 8 1/2 x 11 page
Vector Height = 773.86, Width = 595.28 defining the vector space in points

The hardware allows me to print within 1/4" of the boundaries, so the effective print area should be roughly 8 1/4 x 10 3/4

I've put messaging into the code and it looks like I am in the box for all the text, and part of it is definitely in the box.

Getting two pages printed (although both blank) which is correct. If I were printing micro-type I wouldn't get the page ejects.

I know it's my error I just have no idea how to trouble shoot a blank page when the locations are in bounds. Is there a way I can be defaulting to a white or transparent ink? I have not made any calls to change the ink color.

-Glenn

Re: Problem vector printing text

Posted: Mon Apr 27, 2020 10:20 pm
by IdeasVacuum
If you post your print procedure, maybe we can spot something (vector lib is relatively new to everyone).

Re: Problem vector printing text (Resolved)

Posted: Mon Apr 27, 2020 10:36 pm
by glennj.0158
There were two problems:

Missing call to StopPrinting() -- This causes the print queue to be improperly closed causes some print problems.

Call to VectorSourceColor (#Black) -- I assumed this would give black text. I have no idea what it actually does
but when I removed it the printing magically appeared.

Thanks for the help

Re: Problem vector printing text (Resolved)

Posted: Mon Apr 27, 2020 10:43 pm
by HeX0R
glennj.0158 wrote:Call to VectorSourceColor (#Black) -- I assumed this would give black text. I have no idea what it actually does
The vector lib uses an alpha channel, #Black is without any alpha channel, and therefore transparent.
Use $FF000000 or RGBA(0, 0, 0, 255)

We might need some more predefined color constants, like #BlackA, #RedA, ...
or use a simple Macro like this:

Code: Select all

Macro AddAlpha(Color)
	$FF000000 | Color
EndMacro

VectorSourceColor(AddAlpha(#Black))