LB Booster
« printing to printer »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 05:23am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 hotthread  Author  Topic: printing to printer  (Read 1931 times)
hammerjit
New Member
Image


member is offline

Avatar




PM


Posts: 26
xx Re: printing to printer
« Reply #5 on: Jun 19th, 2015, 06:22am »

thanks tsh73, got my code to work with your help.

Just a quick question, is there a command to forced printout on landscape mode without user interaction?
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: printing to printer
« Reply #6 on: Jun 19th, 2015, 07:13am »

Quote:
is there a command to forced printout on landscape mode without user interaction?

I have no idea but search at Liberty Basic forum returned this thread
Landscape Printing
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: printing to printer
« Reply #7 on: Jun 19th, 2015, 09:22am »

on Jun 19th, 2015, 06:22am, hammerjit wrote:
is there a command to forced printout on landscape mode without user interaction?

It's a bit of a kludge, but you could use the published BBC routine and add the 'BBC BASIC escape' character to every line:

Code:
SUB landscape
!LOCAL psd%, dm%
!DIM psd% LOCAL 83
!!psd% = 84
!psd%!16 = 1024
!SYS "PageSetupDlg", psd%
!SYS "GlobalLock", psd%!8 TO dm%
!dm%!40 = 1
!dm%?44 = 2
!SYS "ResetDC", @prthdc%, dm%
!SYS "GlobalUnlock", psd%!8
!SYS "GlobalFree", psd%!8
!SYS "GlobalFree", psd%!12
!*MARGINS 10,10,10,10
END SUB 

Richard.
User IP Logged

hammerjit
New Member
Image


member is offline

Avatar




PM


Posts: 26
xx Re: printing to printer
« Reply #8 on: Jun 23rd, 2015, 01:57am »

Thanks Richard...it works smiley
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: printing to printer
« Reply #9 on: Jun 23rd, 2015, 05:47am »

In an ideal world there should be some way of setting, in code, all the things that the user can set using PAGESETUPDIALOG (i.e. the paper size, orientation and margins). Can anybody think of a sensible syntax for this?

Richard.
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: printing to printer
« Reply #10 on: Jun 23rd, 2015, 07:00am »

Quote:
Can anybody think of a sensible syntax for this?

Named parameters, like in VBA?
Not listed get default values.
If position accept list, like list of pages, let it be string "1-5, 7, 9".

Or just one big string with named parameters list inside
("pages = 1-5, 7, 9 ; orientation = landscape; leftMargin = 1.5 cm")
« Last Edit: Jun 23rd, 2015, 07:01am by tsh73 » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: printing to printer
« Reply #11 on: Jun 23rd, 2015, 11:36am »

on Jun 23rd, 2015, 07:00am, tsh73 wrote:
Or just one big string with named parameters list inside
("pages = 1-5, 7, 9 ; orientation = landscape; leftMargin = 1.5 cm")

So, for consistency with other LB printer settings, you are proposing something like:

Code:
PrinterSetup$ = "orientation = landscape; leftMargin = 1.5 cm" 

Richard.
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: printing to printer
« Reply #12 on: Jun 23rd, 2015, 12:16pm »

well, kind of.
May be - for consistency with LB GUI commands - get rid of "=", so it becames
Code:
PrinterSetup$ = "orientation landscape; leftMargin 1.5 cm"  

?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: printing to printer
« Reply #13 on: Jun 23rd, 2015, 3:57pm »

on Jun 23rd, 2015, 12:16pm, tsh73 wrote:
May be - for consistency with LB GUI commands

I think I'd be inclined to simplify even further:

Code:
    PrinterName$ = "DoPDF v7"
    PrinterFont$ = "Arial 12 bold"
    PrinterColor$ = "blue"
    PrinterSetup$ = "landscape 15 10 10 10" 

I should add that at present I have no plans for a new release of LBB but I'll make a mental note of the possibility of such additions should the atmosphere change.

Richard.
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: printing to printer
« Reply #14 on: Jun 23rd, 2015, 4:18pm »

Code:
    PrinterName$ = "DoPDF v7"
    PrinterFont$ = "Arial 12 bold"
    PrinterColor$ = "blue"
    PrinterSetup$ = "landscape 15 10 10 10" 
 

Doesn't it look like too many reserved words?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: printing to printer
« Reply #15 on: Jun 23rd, 2015, 7:36pm »

on Jun 23rd, 2015, 4:18pm, tsh73 wrote:
Doesn't it look like too many reserved words?

What problems do you see, and what is the alternative? Combining PrinterColor$ and PrinterSetup$ in a single new command seems to me illogical and inconsistent with the rest of LB, and the compatibility issues arising from having both are minimal.

Richard.
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: printing to printer
« Reply #16 on: Jun 23rd, 2015, 8:03pm »

I see single entity - printer - and several keywords associated with it
PrinterName$
PrinterFont$
PrinterColor$
PrinterSetup$

Suppose you will want to add two side printing or DPI setting or paper size - will you add still another word?

I think pack it all in single string is better, much like OPEN COM from LBB helpfile:
Code:
open "COMn: [baud=b] [parity=p] [data=d] [stop=s]
      [to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off]
      [dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]"
 
« Last Edit: Jun 23rd, 2015, 8:03pm by tsh73 » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: printing to printer
« Reply #17 on: Jun 24th, 2015, 04:10am »

on Jun 23rd, 2015, 8:03pm, tsh73 wrote:
Suppose you will want to add two side printing or DPI setting or paper size - will you add still another word?

Of course not - those are setup features which would be set using PrinterSetup$.

Quote:
I think pack it all in single string is better

Mixing things which can only be changed before you print (e.g. page layout) with things that can be changed within a page (e.g. font and colour) is wrong in my opinion. But since we disagree to such a great extent it is probably better if I forget this feature altogether.

Richard.
« Last Edit: Jun 24th, 2015, 04:18am by Richard Russell » User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: printing to printer
« Reply #18 on: Jun 24th, 2015, 06:59am »

Quote:
Mixing things which can only be changed before you print (e.g. page layout) with things that can be changed within a page (e.g. font and colour) is wrong in my opinion.

Ok I admit I never thought of this from this point.
You are right.
Quote:
But since we disagree to such a great extent it is probably better if I forget this feature altogether.

No-no-no.
You are the boss. You asked for suggestions - here we are - but decision is yours.
And feature implemented in different way is much better then feature non-inplemented, IMHO.
User IP Logged

hammerjit
New Member
Image


member is offline

Avatar




PM


Posts: 26
xx Re: printing to printer
« Reply #19 on: Jun 24th, 2015, 09:09am »

Richard....your suggestion is good, please do consider if there is future enhancement. smiley

btw...another question on this printing....if the output goes more than 2 pages, is there a way for us to put a header for each page? and also page number?
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »


This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls