I believe you also want to make sure to set it as attachment.  If I'm not
mistaken it defaults to inline which will render the pdf in the browser.



On 1/17/07, Bjørn T Johansen <[EMAIL PROTECTED]> wrote:

I am talking about printing to a printer... :)

But thanks for the suggestion on how to go around the open/save as dialog
box... :)


BTJ

On Wed, 17 Jan 2007 10:59:41 +0100
<[EMAIL PROTECTED]> wrote:

> Hi
>
> Is he talking about printing to a printer or to the screen?
>
> Hermod
>
> -----Original Message-----
> From: Beelen, Marco [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 17, 2007 10:50 AM
> To: MyFaces Discussion
> Subject: RE: [ABOT] Sending pdf file from webserver to browser?
>
>
> Hello Bjørn T Johansen,
>
> In order to achieve what you want, you've got two problems.
>
> 1) A printer is considered as a local devices, which isn't directly
accessible from a loaded page in
> browser. A browser can request a page to be printed, but the security
model of a browser enforces the
> required 'Print dialog'. 2) Your are not trying to print an HTML-page
but a .pdf-file, which can't invoke
> the print-command onLoad.
>
> For the first problem there are some (IE-only) solutions like ScriptX:
> http://www.meadroid.com/scriptx/index.asp, but the second will remain.
By setting the correct response
> header you could get the pdf to open correctly in a browser, but the
user will have to choose to print it
> themselves.
>
> IMHO: It can't be done.
>
> If you ever fid a way around these problems, please let me know!
>
> With kind regards,
>   Marco
>
>
>
>
>
>
> -----Original Message-----
> From: Bjørn T Johansen [mailto:[EMAIL PROTECTED]
> Sent: woensdag 17 januari 2007 10:37
> To: [email protected]
> Subject: Re: [ABOT] Sending pdf file from webserver to browser?
>
> Yes, I am setting it to application/pdf... Why?
>
> BTJ
>
> On Wed, 17 Jan 2007 10:30:38 +0100
> <[EMAIL PROTECTED]> wrote:
>
> > Hi
> >
> > Are you setting the content-type on the response?
> >
> > Hermod
> >
> > -----Original Message-----
> > From: Thorbjørn Ravn Andersen [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, January 17, 2007 10:13 AM
> > To: MyFaces Discussion
> > Subject: Re: [ABOT] Sending pdf file from webserver to browser?
> >
> >
> > Bjørn T Johansen skrev  den 16-01-2007 14:42:
> > > I have a myfaces webapp that uses a report component to generate a
pdf file on the server. This file is
> > > sent to the browser and the user then get a choice of saving the
file or opening the file, eg. in
> > > Acrobat.
> > >
> > > And I was wondering, it is possible to skip the opening og saving
dialog and go straight to printing the
> > > pdf file? As far as I can tell, this isn't possible..
> > I don't think so, unless you can print to the users printer from the
server.
> >
>
>
>
>
>
------------------------------------------------------------------------------
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New Jersey, USA 08889), and/or its affiliates (which may be known
> outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
> and in Japan, as Banyu - direct contact information for affiliates is
> available at http://www.merck.com/contact/contacts.html) that may be
> confidential, proprietary copyrighted and/or legally privileged. It is
> intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and then
> delete it from your system.
>
>
------------------------------------------------------------------------------
>
>
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
>
> This email with attachments is solely for the use of the individual or
> entity to whom it is addressed. Please also be aware that the DnB NOR
Group
> cannot accept any payment orders or other legally binding correspondence
with
> customers as a part of an email.
>
> This email message has been virus checked by the anti virus programs
used
> in the DnB NOR Group.
>
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
>

Reply via email to