|
Post by brendan on Jul 16, 2020 6:22:25 GMT -5
I have set the default printer orientation to landscape but my landscape graphicbox (1700w x 700h) continues to printout across the top of the page in portrait.
Any suggestions on howto get it to print out to landscape on paper?
|
|
|
Post by Rod on Jul 16, 2020 7:16:39 GMT -5
This works for me, I set my preferences in the Printer dialog and use landscape as the default, I need to click apply on my Epsom printer dialog. There after Liberty Graphicboxes all print landscape.
Of course 1700x700 does not really suit an A4 landscape print, its too thin, but don't know what you are creating so it may be fine. Note that I used print size, print 1700 to spread the 1700 pixels across the entire printed page.
'Images and drawing can be larger than the visible graphic box 'you can still print these despite the fact they can't be seen. 'Smaller graphicbox images can be enlarged to better fill the page. 'Scale up smaller graphicbox images using PRINT VGA\SVGA\XGA commands 'This example is 1700 width page printing. 'Use the debugger to step through to see whats going on 'For a receipt printer choose width and height values that fill 'the printer width wise and allow everything printed length wise.
ImageWidth = 1700 ' you may need to adjust to your printer spec ImageHeight = 700 ' dito midW=int(ImageWidth/2) midH=int(ImageHeight/2) nomainwin WindowWidth = 800 WindowHeight = 600 UpperLeftX = (DisplayWidth-WindowWidth)/2 UpperLeftY = (DisplayHeight-WindowHeight)/2 graphicbox #1.g, 50,50,700,500 open "Graphics Printing" for window_nf as #1 print #1, "trapclose [quit]"
print #1.g, "down ; size 4 ; place 0 0; color black ; box ";ImageWidth;" ";ImageHeight print #1.g, "place ";midW;" ";midH print #1.g, "circle ";midH print #1.g, "place ";midW;" ";midH print #1.g, "\Hello" print #1.g, "flush" print #1.g, "print 1700"
[quit] close #1 end
|
|
|
Post by brendan on Jul 16, 2020 12:54:07 GMT -5
Thank you Rod, Did you set the printer to landscape pre LB or during program run via PRINTERDIALOG command?
|
|
|
Post by Rod on Jul 16, 2020 14:09:49 GMT -5
Printerdialog has not worked for a long time due to Windows changes. You need to use the Print Driver that Windows installs for your specific printer to change settings. There is an API solution on the LBPE but setting it manually is easy. If you need to set it programmatically explore the LBPE and Alyce’s site. alycesrestaurant.com//dll.htm#prn
|
|
|
Post by brendan on Jul 17, 2020 18:46:32 GMT -5
Thanks , the link has provided a great sample. I will work it into the program and try. Any improvements to printing functionality in version 5?
Brilliant, codes worked in well.
|
|