Page 1 of 1

VectorDrawing - PrinterOutput - Physical Borders

Posted: Mon Jan 04, 2016 3:40 pm
by mhs
Hello everybody,

I'm working on a printing job with the Vectordrawing lib. It has struck me that the physical printer margins are ignored or can not be read.

Example:

Code: Select all

StartVectorDrawing(PrinterOutput(#PB_Unit_Millimeter))

MovePathCursor(0, 30)
DrawVectorParagraph("Test", 100, 5)

StopVectorDrawing()
My printer has a physikal border on the left of 5 millimeters. In this case the output of the text is shifted at these 5 millimeters to the right. I would have expected, that either the text is croped on the left or that there is a function to determine the physical border of the printer to correct the coordinate.

How do you handle this case, if you want to print the address on different printers exactly in the window of a envelope, for example?

Re: VectorDrawing - PrinterOutput - Physical Borders

Posted: Thu Jan 21, 2016 6:01 am
by collectordave
There are not only physical borders but also soft borderrs as well. My printer has the same effect but has no physical borders. I had to look into the printer and get it to print borderless.

There are methods in windows to get the printer hard and soft margins and also the vector drawing library does seem to help a little.

I use this little bit of code just to check.

Code: Select all

If PrintRequester()

  If StartPrinting("Daves Test")
  
    If StartVectorDrawing(PrinterVectorOutput(#PB_Unit_Millimeter))
      Debug VectorOutputWidth() 
      Debug VectorOutputHeight()
      StopVectorDrawing()
    EndIf
    
    StopPrinting()
  EndIf

EndIf

If you know you have selected A4 paper then check the returned width and height any difference is the margins in the printer restricting the printable area. My HP Envy returned 204mm for the width before i found the borderless setting after which it returned 210mm. Whether these differences are allways balanced I cannot say.

I workaround the problem by allways including a border of around 10mm for A4 sized paper.

Re: VectorDrawing - PrinterOutput - Physical Borders

Posted: Thu Jan 21, 2016 8:19 am
by mhs
collectordave thank you for your reply.

That's right, but it does not make any difference whether soft or hard margins. Both are borders for the vector drawing lib and shift the output to the right / bottom.
collectordave wrote:There are methods in windows to get the printer hard and soft margins and also the vector drawing library does seem to help a little.
...
Whether these differences are allways balanced I cannot say.
I would not count on the fact that it is always balanced on every printer. I know that there is winapi to get the borders, but I think, that is the job of PB to provide a function for every os.

When I think of it, I expect even actually that the lib noted the physical borders and corrects the output accordingly. If I move the drawing cursor absolute to 20mm left and 50mm down for printing the address field of a letter, then I expect, that the output is placed absolutly at 20, 50 on the paper, no matter how thick the borders of the printer are. It could be that its printed twice, once as a preview on a image and again on the real printer, there should be the same output twice.

I will make a bug report so that is maybe checked again.

Re: VectorDrawing - PrinterOutput - Physical Borders

Posted: Sat Jan 23, 2016 6:01 am
by collectordave
Hi mhs
I will make a bug report so that is maybe checked again.
Not sure it is a bug but definately a feature request. To be able to get the hard and soft margins for a printer would be great it would give us the ability to set the minimum margins for the end user and also to tell them why. It is when it is not balanced that I find annoying.

I have done some work on the vector print routines allready with a print preview on screen http://www.purebasic.fr/english/viewtop ... 13&t=63022

If of use to you please send me a PM and maybe we can work on something like this together?

Cheers

collectordave

Re: VectorDrawing - PrinterOutput - Physical Borders

Posted: Thu Mar 17, 2016 6:07 am
by collectordave
You can now try http://www.purebasic.fr/english/viewtop ... 12&t=65192

So far it is good on windows and MAC