Sver
Full Member
Posts: 145
|
Post by Sver on Feb 1, 2020 7:58:56 GMT -5
#form "print svga" (graphics window)
Work's fine, but is it possible to print double side?
|
|
|
Post by Rod on Feb 1, 2020 10:13:19 GMT -5
Taking control of the print driver programmatically is a daunting task. There are a couple of API driven printer demos on the LBPE but these really just allow you to select a printer and set the number of copies. Even setting the orientation from portrait to landscape is there but it is wrapped in a .dll to keep it real simple.
I have no doubt that if your printer has the capability then it can be set via API. I have just never seen it done.
You should be able to set it via Windows in your printer dialog but then it is set for all print jobs.
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Feb 1, 2020 10:27:39 GMT -5
"You should be able to set it via Windows in your printer dialog but then it is set for all print jobs."
No problem, but then i have to tell, when page 1 stops, page 2 starts and printing have to stop in one command, when i have two graphics windows or one big one.
|
|
|
Post by Rod on Feb 1, 2020 10:52:32 GMT -5
I think you need to show us some code. You will have a graphicbox, normally you will draw onto that and then use print size to print one page. A second page, or the reverse, would need the graphicbox redrawn and printed again. So you will be issuing a series of print commands. Its up to the printer driver to print alternate pages to the reverse is it not?
|
|
|
Post by Rod on Feb 1, 2020 11:21:57 GMT -5
Also you can start dialogs with rundll32.dll If you explore rundll32.dll on MSDN you will find a huge scripting resource for setting print parameters. Nearly as complex as API!
run "Rundll32.exe Printui.dll,PrintUIEntry /?"
running this code will get the help file up for the scripting resource. Lots of reading.
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Feb 1, 2020 12:21:01 GMT -5
WindowWidth = 800
WindowHeight = DisplayHeight
open "Print" for graphics as #form
#form "trapclose [quit]"
#form "place 50 70"
#form, "font arial 10"
'---
for i = 1 to 90
no$=str$(i)+" Line______________________________________________________________________________"
print #form, "\"+no$
next i '>60 next page double side
#form "flush"
#form "print svga"
wait
[quit]
close #form
end
|
|
|
Post by Rod on Feb 1, 2020 16:04:26 GMT -5
No you can’t do it like that. Graphic box printing has no concept of number of lines.
You must draw a perfect page and print it, then draw the next perfect page and print it.
You draw and print a sheet at a time.
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Feb 7, 2020 3:02:53 GMT -5
The lines are only text.
I have a other solution. Create a word document (office) with your (long) text, pictures,...... Doesn't matter how much sides.
Make this .docx file a merge data document (mail merge) with a data.txt file created by your LB program.
Example: data.txt
City, Street, Number 'the header Groningen, Kerkstraat, 10 'record
Open this .docx with Run in your LB program and you can print double side,.... with your LB data.
|
|
|
Post by Rod on Feb 7, 2020 4:48:06 GMT -5
Ok smart solution. Mail merge allows an easy integration of Liberty data and text data. Only one thing, when we use print (size) we are not really printing text. We can draw text to the graphicbox but when we print it its really one big bitmap that gets raster printed a pixel line at a time. If I had to do it all in Liberty I would probably arrange for the front and back of the pages to be "ordered". Then I would print all the front pages, put the paper back in the printer upside down and then print all the rear pages. Old fashioned double sided printing! Many pages wasted till you get the paper change right!
|
|