I am using Sumatra only as external print utility to direct print PDF to printer, because Sumatra has better management where I can set some parameters from command line as fit page, format, orientation etc.
This parameters not support PDF Acrobat Reader (no all version) or I do not remember how other problems I had with it to implement Sumatra.
Code: Select all
* read or set default print parameters
if empty(aTlaciarne) .or. len(aTlaciarne)=0
ndialogstyle:=2
lforcedialog:=.F.
aTlaciarne:={,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,lforcedialog,,,ndialogstyle,,,,,,,,,,,,,,,,,,,,,,}
endif
* show dialog for set parameters to print
aTlaciarne:=DC_PRINTERDIALOG(aTlaciarne)
* direct print to printer , in aTlaciarne filename to print is sublvpluschrono,
*************************************************
cestasumatrapdf:=cestahlprg+"SumatraPDF.exe"
if file(cestasumatrapdf)=.T.
if !empty(aTlaciarne) .and. len(aTlaciarne)>0 .and. !empty(aTlaciarne[50])
nDuplexMode:=aTlaciarne[50]
else
nDuplexMode:=1
endif
if nDuplexMode=1
* jednostranná tlač
RunShell("-print-to-default -print-settings shrink,paper=A4 "+sublvpluschrono,cestasumatrapdf,.f.,.t.)
elseif nDuplexMode=2 .or. nDuplexMode=3
* obojstranná tlač
RunShell("-print-to-default -print-settings shrink,duplex,paper=A4 "+sublvpluschrono,cestasumatrapdf,.f.,.t.)
endif
oznam("Print success")
else
oznam("Error, SumatraPDF.exe not found")
endif