Print document

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Print document

dtrussardi@tiscali.it
Hi All,
 
i need to print web page in background.
 
For now,  i open a popup window with popupAnchor.
 
At the top of this new window i put:
 
        html anchor
                attributeAt: 'href' put : 'javascript: window.print()':
                with: 'Print'.
 
With this i open the Printer dialog.
 
 
It work fine but :
 
    1) i open new window
 
    2) the user need click on 'Print' anchor and after answer to Printer dialog
 
I can do this in background ?
 
With only one clic do all it?
 

Any pointers would be greatly appreciated!

Thanks!

    Dario

 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Print document

Lukas Renggli
>     2) the user need click on 'Print' anchor and after answer to Printer
> dialog

You can avoid that by adding the Javascript call to the onLoad
scripts. This means you add the following code to the top:

self session addLoadScript: 'window.print()'

> I can do this in background ?
>
> With only one clic do all it?

No, you still get the print dialog.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Print document

Martin Polák
In reply to this post by dtrussardi@tiscali.it
Hi Dario,
        I'm using this scheme: I have a "printComponent", which display the  
page I want to print. Then I have following code to call that component:

        html anchor
                                                callback: [self session
                                                                addLoadScript: (SUStream on: 'javascript:print()').
                                                        self call: self printComponent];
                                                 with: 'Print'.

and in "printComponent" inside renderContentOn: I have code:

        html anchor
                                callback: [self session clearLoadScripts.
                                        self answer: true];
                                 with: 'Close'

and everything works OK. Hope this help.


Martin


On 15.6.2009, at 16:23, Dario Trussardi wrote:

> Hi All,
>
> i need to print web page in background.
>
> For now,  i open a popup window with popupAnchor.
>
> At the top of this new window i put:
>
>         html anchor
>                 attributeAt: 'href' put : 'javascript:  
> window.print()':
>                 with: 'Print'.
>
> With this i open the Printer dialog.
>
>
> It work fine but :
>
>     1) i open new window
>
>     2) the user need click on 'Print' anchor and after answer to  
> Printer dialog
>
> I can do this in background ?
>
> With only one clic do all it?
>
> Any pointers would be greatly appreciated!
>
> Thanks!
>
>     Dario
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside