|
Printing a PDF from a webpage
Message-ID:<92c650d3-b232-4517-8670-31ca4cfbfc74@u18g2000pro.googlegroups.com>
Subject:Printing a PDF from a webpage
Date:Mon, 2 Feb 2009 17:36:25 +0100
I have a web app where the users will sometimes need to print out a
PDF file. We don't want to have to display the PDF in the webpage and
have the user click on the print button within the PDF. We want to be
able to automate Acrobat Reader and get it to print out without the
user having to do anything but say yes.
We can do this with Microsoft Word. We can open it invisibly and
trigger the print method. But we haven't found any way to automate
Acrobat Reader from within the webpage, using Javascript or VBscript
(this is an IE only environment).
Is there a way to do this?
Thanks,
Lisa
Message-ID:<6upf18Fg9o2cU1@mid.individual.net>
Subject:Re: Printing a PDF from a webpage
Date:Tue, 3 Feb 2009 00:47:51 +0100
lisa.liel@gmail.com wrote:
> I have a web app where the users will sometimes need to print out a
> PDF file. We don't want to have to display the PDF in the webpage and
> have the user click on the print button within the PDF. We want to be
> able to automate Acrobat Reader and get it to print out without the
> user having to do anything but say yes.
>
> We can do this with Microsoft Word. We can open it invisibly and
> trigger the print method. But we haven't found any way to automate
> Acrobat Reader from within the webpage, using Javascript or VBscript
> (this is an IE only environment).
>
> Is there a way to do this?
Not if the user doesn't have Acrobat Reader installed :-)
What you describe involves writing to the operating system (in this
case, a print queue), and that isn't usually possible inside the
web-based sandboxes, for obvious security reasons. It normally requires
a human to intervene. But maybe someone has a way round this...and maybe
there's an exploitable hole in IE that you could use...
///Peter
Message-ID:<bf1e5ace-b1bb-4520-b017-f43c4ea61f97@w24g2000prd.googlegroups.com>
Subject:Re: Printing a PDF from a webpage
Date:Tue, 3 Feb 2009 18:06:57 +0100
On Feb 2, 3:47=A0pm, Peter Flynn <peter.n...@m.silmaril.ie> wrote:
> lisa.l...@gmail.com wrote:
> > I have a web app where the users will sometimes need to print out a
> > PDF file. =A0We don't want to have to display the PDF in the webpage an=
d
> > have the user click on the print button within the PDF. =A0We want to b=
e
> > able to automate Acrobat Reader and get it to print out without the
> > user having to do anything but say yes.
>
> > We can do this with Microsoft Word. =A0We can open it invisibly and
> > trigger the print method. =A0But we haven't found any way to automate
> > Acrobat Reader from within the webpage, using Javascript or VBscript
> > (this is an IE only environment).
>
> > Is there a way to do this?
>
> Not if the user doesn't have Acrobat Reader installed :-)
> What you describe involves writing to the operating system (in this
> case, a print queue), and that isn't usually possible inside the
> web-based sandboxes, for obvious security reasons. It normally requires
> a human to intervene. But maybe someone has a way round this...and maybe
> there's an exploitable hole in IE that you could use...
Thanks, Peter. Actually, the computer will have Acrobat Reader on
it. Every workstation that runs this page will. So my question is
really, how can I activate an instance of Reader in the background,
get it to print, and then close it. From script on a webpage. This
is what I do with Word, but I don't know how to do it with PDFs. I've
looked at PDFLib.dll, but I haven't found a way to make it work.
Lisa
Message-ID:<8c0il.6662$nx.893@newsfe10.ams2>
Subject:Re: Printing a PDF from a webpage
Date:Tue, 3 Feb 2009 19:40:02 +0100
It isn't what you asked, but you can (by using javascript) get one pdf
"the master" to control the printing of others. (This is the PDF version
of Javascript which works in PDF viewers )
This "master" pdf could be very small and quick to download, therefore
reasonably unobtrusive.
It might have a buttons for the user to confirm printing, abort it,
etc. I certainly would not wish to allow it bash on regardless if i
were your user.
Ken.
lisa.liel@gmail.com wrote:
> On Feb 2, 3:47 pm, Peter Flynn <peter.n...@m.silmaril.ie> wrote:
>> lisa.l...@gmail.com wrote:
>>> I have a web app where the users will sometimes need to print out a
>>> PDF file. We don't want to have to display the PDF in the webpage and
>>> have the user click on the print button within the PDF. We want to be
>>> able to automate Acrobat Reader and get it to print out without the
>>> user having to do anything but say yes.
>>> We can do this with Microsoft Word. We can open it invisibly and
>>> trigger the print method. But we haven't found any way to automate
>>> Acrobat Reader from within the webpage, using Javascript or VBscript
>>> (this is an IE only environment).
>>> Is there a way to do this?
>> Not if the user doesn't have Acrobat Reader installed :-)
>> What you describe involves writing to the operating system (in this
>> case, a print queue), and that isn't usually possible inside the
>> web-based sandboxes, for obvious security reasons. It normally requires
>> a human to intervene. But maybe someone has a way round this...and maybe
>> there's an exploitable hole in IE that you could use...
>
> Thanks, Peter. Actually, the computer will have Acrobat Reader on
> it. Every workstation that runs this page will. So my question is
> really, how can I activate an instance of Reader in the background,
> get it to print, and then close it. From script on a webpage. This
> is what I do with Word, but I don't know how to do it with PDFs. I've
> looked at PDFLib.dll, but I haven't found a way to make it work.
>
> Lisa
Message-ID:<6us0jqFgj04qU1@mid.individual.net>
Subject:Re: Printing a PDF from a webpage
Date:Wed, 4 Feb 2009 00:00:09 +0100
lisa.liel@gmail.com wrote:
[...]
> Thanks, Peter. Actually, the computer will have Acrobat Reader on
> it. Every workstation that runs this page will. So my question is
> really, how can I activate an instance of Reader in the background,
> get it to print, and then close it. From script on a webpage. This
> is what I do with Word, but I don't know how to do it with PDFs. I've
> looked at PDFLib.dll, but I haven't found a way to make it work.
My point was that I don't think the environment provided by web browser
for in-page scripting allows the script to access the operating system
(and the printer queues), regardless of the facilities provided by the
third-party application library. It might be easier with a standalone
Java applet or something, but these days the user is likely to be
queried when a foreign application tries to execute.
In any event, people are accustomed to clicking a Print button and then
having to click the printer-driver's own Print button, and to seeing the
application display the first page, if any. Is this such a big deal?
Personally, I would refuse to use an application that tried to sneak
past me and print without my having explicitly authorised it (and seen
what it wanted to print)...but then I'm suspicious that way :-)
///Peter
Message-ID:<92c650d3-b232-4517-8670-31ca4cfbfc74@u18g2000pro.googlegroups.com>
Subject:Printing a PDF from a webpage
Date:Mon, 2 Feb 2009 17:36:25 +0100
I have a web app where the users will sometimes need to print out a
PDF file. We don't want to have to display the PDF in the webpage and
have the user click on the print button within the PDF. We want to be
able to automate Acrobat Reader and get it to print out without the
user having to do anything but say yes.
We can do this with Microsoft Word. We can open it invisibly and
trigger the print method. But we haven't found any way to automate
Acrobat Reader from within the webpage, using Javascript or VBscript
(this is an IE only environment).
Is there a way to do this?
Thanks,
Lisa
Message-ID:<6upf18Fg9o2cU1@mid.individual.net>
Subject:Re: Printing a PDF from a webpage
Date:Tue, 3 Feb 2009 00:47:51 +0100
lisa.liel@gmail.com wrote:
> I have a web app where the users will sometimes need to print out a
> PDF file. We don't want to have to display the PDF in the webpage and
> have the user click on the print button within the PDF. We want to be
> able to automate Acrobat Reader and get it to print out without the
> user having to do anything but say yes.
>
> We can do this with Microsoft Word. We can open it invisibly and
> trigger the print method. But we haven't found any way to automate
> Acrobat Reader from within the webpage, using Javascript or VBscript
> (this is an IE only environment).
>
> Is there a way to do this?
Not if the user doesn't have Acrobat Reader installed :-)
What you describe involves writing to the operating system (in this
case, a print queue), and that isn't usually possible inside the
web-based sandboxes, for obvious security reasons. It normally requires
a human to intervene. But maybe someone has a way round this...and maybe
there's an exploitable hole in IE that you could use...
///Peter
Message-ID:<bf1e5ace-b1bb-4520-b017-f43c4ea61f97@w24g2000prd.googlegroups.com>
Subject:Re: Printing a PDF from a webpage
Date:Tue, 3 Feb 2009 18:06:57 +0100
On Feb 2, 3:47=A0pm, Peter Flynn <peter.n...@m.silmaril.ie> wrote:
> lisa.l...@gmail.com wrote:
> > I have a web app where the users will sometimes need to print out a
> > PDF file. =A0We don't want to have to display the PDF in the webpage an=
d
> > have the user click on the print button within the PDF. =A0We want to b=
e
> > able to automate Acrobat Reader and get it to print out without the
> > user having to do anything but say yes.
>
> > We can do this with Microsoft Word. =A0We can open it invisibly and
> > trigger the print method. =A0But we haven't found any way to automate
> > Acrobat Reader from within the webpage, using Javascript or VBscript
> > (this is an IE only environment).
>
> > Is there a way to do this?
>
> Not if the user doesn't have Acrobat Reader installed :-)
> What you describe involves writing to the operating system (in this
> case, a print queue), and that isn't usually possible inside the
> web-based sandboxes, for obvious security reasons. It normally requires
> a human to intervene. But maybe someone has a way round this...and maybe
> there's an exploitable hole in IE that you could use...
Thanks, Peter. Actually, the computer will have Acrobat Reader on
it. Every workstation that runs this page will. So my question is
really, how can I activate an instance of Reader in the background,
get it to print, and then close it. From script on a webpage. This
is what I do with Word, but I don't know how to do it with PDFs. I've
looked at PDFLib.dll, but I haven't found a way to make it work.
Lisa
Message-ID:<8c0il.6662$nx.893@newsfe10.ams2>
Subject:Re: Printing a PDF from a webpage
Date:Tue, 3 Feb 2009 19:40:02 +0100
It isn't what you asked, but you can (by using javascript) get one pdf
"the master" to control the printing of others. (This is the PDF version
of Javascript which works in PDF viewers )
This "master" pdf could be very small and quick to download, therefore
reasonably unobtrusive.
It might have a buttons for the user to confirm printing, abort it,
etc. I certainly would not wish to allow it bash on regardless if i
were your user.
Ken.
lisa.liel@gmail.com wrote:
> On Feb 2, 3:47 pm, Peter Flynn <peter.n...@m.silmaril.ie> wrote:
>> lisa.l...@gmail.com wrote:
>>> I have a web app where the users will sometimes need to print out a
>>> PDF file. We don't want to have to display the PDF in the webpage and
>>> have the user click on the print button within the PDF. We want to be
>>> able to automate Acrobat Reader and get it to print out without the
>>> user having to do anything but say yes.
>>> We can do this with Microsoft Word. We can open it invisibly and
>>> trigger the print method. But we haven't found any way to automate
>>> Acrobat Reader from within the webpage, using Javascript or VBscript
>>> (this is an IE only environment).
>>> Is there a way to do this?
>> Not if the user doesn't have Acrobat Reader installed :-)
>> What you describe involves writing to the operating system (in this
>> case, a print queue), and that isn't usually possible inside the
>> web-based sandboxes, for obvious security reasons. It normally requires
>> a human to intervene. But maybe someone has a way round this...and maybe
>> there's an exploitable hole in IE that you could use...
>
> Thanks, Peter. Actually, the computer will have Acrobat Reader on
> it. Every workstation that runs this page will. So my question is
> really, how can I activate an instance of Reader in the background,
> get it to print, and then close it. From script on a webpage. This
> is what I do with Word, but I don't know how to do it with PDFs. I've
> looked at PDFLib.dll, but I haven't found a way to make it work.
>
> Lisa
Message-ID:<6us0jqFgj04qU1@mid.individual.net>
Subject:Re: Printing a PDF from a webpage
Date:Wed, 4 Feb 2009 00:00:09 +0100
lisa.liel@gmail.com wrote:
[...]
> Thanks, Peter. Actually, the computer will have Acrobat Reader on
> it. Every workstation that runs this page will. So my question is
> really, how can I activate an instance of Reader in the background,
> get it to print, and then close it. From script on a webpage. This
> is what I do with Word, but I don't know how to do it with PDFs. I've
> looked at PDFLib.dll, but I haven't found a way to make it work.
My point was that I don't think the environment provided by web browser
for in-page scripting allows the script to access the operating system
(and the printer queues), regardless of the facilities provided by the
third-party application library. It might be easier with a standalone
Java applet or something, but these days the user is likely to be
queried when a foreign application tries to execute.
In any event, people are accustomed to clicking a Print button and then
having to click the printer-driver's own Print button, and to seeing the
application display the first page, if any. Is this such a big deal?
Personally, I would refuse to use an application that tried to sneak
past me and print without my having explicitly authorised it (and seen
what it wanted to print)...but then I'm suspicious that way :-)
///Peter
|