New topic: HTMLViewer printing
<http://forums.realsoftware.com/viewtopic.php?t=38304> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message danf Post subject: HTMLViewer printingPosted: Thu Mar 24, 2011 3:21 pm Joined: Thu Mar 24, 2011 3:13 pm Posts: 3 Would like to have a bit more control over printing the HTML rendered by HTMLViewer. the HTMLViewer.print method does not let me switch page orientation. thought I would do this, but end up printing a blank page. I'm pretty new to working with graphics/pictures etc so maybe I'm just doing it wrong...or perhaps drawInto does not work with HTMLViewer ? Dim pict As Picture Dim ps As PrinterSetup Dim g As Graphics Dim cc,c As Integer pict = new Picture(self.HTMLViewer1.width, self.HTMLViewer1.height, 32) self.HTMLViewer1.DrawInto( pict.Graphics, 0, 0 ) ps = New PrinterSetup ps.Landscape =True If ps.pageSetupDialog then g = OpenPrinterDialog(ps) If g <> Nil Then c=g.Copies For cc=1 To c if c>1 then g.next page g.DrawPicture(pict, 0,0,ps.Width,ps.Height,0,0,pict.Width,pict.Height) Next cc g=nil End If End If Top swort Post subject: Re: HTMLViewer printingPosted: Thu Mar 24, 2011 3:42 pm Joined: Mon May 31, 2010 5:35 am Posts: 840 make a html button onclick='print();' _________________ SWORTâ¢, it stands for Secure Web Object Realtime Transfer⢠- Windows Vista AND Linux Ubuntu 10.04 LTS - REAL Studio Enterprise(latest) and WEB Edition(latest) - REAL SQL Server 2009 For Dutch User Groups ask me to enter! Top danf Post subject: Re: HTMLViewer printingPosted: Thu Mar 24, 2011 6:17 pm Joined: Thu Mar 24, 2011 3:13 pm Posts: 3 Thanks for the idea SWORT, but it does not seem to work in HTMLViewer I tried the same HTML I am generating to display in HTMLViewer, in Safari. In Safari, the button does the job. but the button that renders in HTML viewer does nothing. I wonder if there is some setting someplace that turns javascript on/off for HTMLViewer ? Top swort Post subject: Re: HTMLViewer printingPosted: Thu Mar 24, 2011 6:44 pm Joined: Mon May 31, 2010 5:35 am Posts: 840 danf wrote:Thanks for the idea SWORT, but it does not seem to work in HTMLViewer I tried the same HTML I am generating to display in HTMLViewer, in Safari. In Safari, the button does the job. but the button that renders in HTML viewer does nothing. I wonder if there is some setting someplace that turns javascript on/off for HTMLViewer ? sorry, i was on android again so no time for big messages... here is a link: http://www.htmlgoodies.com/beyond/javascript/article.php/3471121/Print-a-Web-Page-Using-JavaScript.htm you need a tag like this <button id="mybutton-01" onclick="javascript:window.print()">Print this page</button> or make it a link, have fun! _________________ SWORTâ¢, it stands for Secure Web Object Realtime Transfer⢠- Windows Vista AND Linux Ubuntu 10.04 LTS - REAL Studio Enterprise(latest) and WEB Edition(latest) - REAL SQL Server 2009 For Dutch User Groups ask me to enter! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ]
-- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
