Print from WebGadget
- doctorized
- Addict
- Posts: 856
- Joined: Fri Mar 27, 2009 9:41 am
- Location: Athens, Greece
Print from WebGadget
I know it has been asked before about printing from webgadget, but I need to ask again. I have many svgz files that I open them with webgadget. The content is displayed correctly. I want to use "Microsoft print to PDF" printer to make them PDFs. How can it be done?
Re: Print from WebGadget
Hi
Code: Select all
#OLECMDID_PRINT = 6
#OLECMDID_PRINTPREVIEW = 7
#OLECMDEXECOPT_PROMPTUSER = 1
#OLECMDEXECOPT_DONTPROMPTUSER = 2
OpenWindow(0, 0,0 , 800, 600, "Print WebGadget", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
ButtonGadget(0, 10, 10, 100, 30, "Print")
WebGadget(1, 10, 50, 780, 540, "http://www.purebasic.com")
WebObject.IWebBrowser2
WebObject = GetWindowLongPtr_(GadgetID(1), #GWL_USERDATA)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit =1
Case #PB_Event_Gadget
Select EventGadget()
Case 0
WebObject\ExecWB(#OLECMDID_PRINT, #OLECMDEXECOPT_PROMPTUSER, 0, 0)
; WebObject\ExecWB(#OLECMDID_PRINT, #OLECMDEXECOPT_DONTPROMPTUSER, 0, 0) ; No PrintRequester
EndSelect
EndSelect
Until Quit = 1
Egypt my love
- doctorized
- Addict
- Posts: 856
- Joined: Fri Mar 27, 2009 9:41 am
- Location: Athens, Greece
Re: Print from WebGadget
As I want to use pdf printer, is there a way to pass the file name to the printer? It opens a windows requesting file name to create, even if I use the second line for no PrintRequester.RASHAD wrote:HiCode: Select all
; WebObject\ExecWB(#OLECMDID_PRINT, #OLECMDEXECOPT_DONTPROMPTUSER, 0, 0) ; No PrintRequester
- doctorized
- Addict
- Posts: 856
- Joined: Fri Mar 27, 2009 9:41 am
- Location: Athens, Greece
Re: Print from WebGadget
I changed some settings to Adobe PDF printer and now I can save the files to pdf without any dialogs. The only problem that I have, is the page number added at the top of the page as header and the file name at the bottom of the page. I did a small search and, according to Adobe here, this addition is done by my app. Solution?