Problem vector printing text

Just starting out? Need help? Post your questions and find answers here.
glennj.0158
User
User
Posts: 21
Joined: Tue Mar 31, 2020 4:43 pm
Location: Lawrenceville, NJ, USA

Problem vector printing text

Post 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
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Problem vector printing text

Post 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.
BERESHEIT
glennj.0158
User
User
Posts: 21
Joined: Tue Mar 31, 2020 4:43 pm
Location: Lawrenceville, NJ, USA

Re: Problem vector printing text

Post 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
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Problem vector printing text

Post by IdeasVacuum »

If you post your print procedure, maybe we can spot something (vector lib is relatively new to everyone).
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
glennj.0158
User
User
Posts: 21
Joined: Tue Mar 31, 2020 4:43 pm
Location: Lawrenceville, NJ, USA

Re: Problem vector printing text (Resolved)

Post 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
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Problem vector printing text (Resolved)

Post 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))
Post Reply