Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Printing

From: greggirwin:mindspring at: 12-Sep-2003 10:35

Hi Matt, MM> Ok, I know this gets asked alot, but does anybody know how to print in rebol MM> using the windows print dialog. I can't just hard code what port or printer MM> to use because I am making an application for varying users. All help would MM> be appreciated. A lot of people use either Gabriele's PDFMaker or write HTML and let Acrobat or the browser deal with the details. If you want to call the print dialog to set the printer, that should be doable (with View/Pro or command for API access), but then you still have the issue of how to render the data. Do you know how you're going to do that? In any case, here's the function: PrintDlg: make routine! compose/deep/only [ ; pointer to structure with initialization data lppd [struct! (LPPRINTDLG-def)] ;LPPRINTDLG return: [integer!] ;BOOL ] comdlg32.dll "PrintDlg" and the main struct you'd need: PRINTDLG: make struct! PRINTDLG-def: compose/deep [ lStructSize [integer!] ; DWORD hwndOwner [integer!] ; HWND hDevMode [integer!] ; HANDLE (NULL or pointer to struct) hDevNames [integer!] ; HANDLE (NULL or pointer to struct) hDC [integer!] ; HDC Flags [integer!] ; DWORD nFromPage [short] ; WORD nToPage [short] ; WORD nMinPage [short] ; WORD nMaxPage [short] ; WORD nCopies [short] ; WORD hInstance [integer!] ; HINSTANCE lCustData [integer!] ; DWORD lpfnPrintHook [integer!] ; LPPRINTHOOKPROC (decl for NULL, not struct) lpfnSetupHook [integer!] ; LPSETUPHOOKPROC (decl for NULL, not struct) lpPrintTemplateName [string!] ; LPCTSTR lpSetupTemplateName [string!] ; LPCTSTR hPrintTemplate [integer!] ; HANDLE hSetupTemplate [integer!] ; HANDLE ] none I've used it from other languages, but not REBOL, so this is all untested stuff here. -- Gregg