How to print .PDF files in the background using C#

How to print .PDF files in the background using C#

am 22.04.2008 21:55:21 von Steve Kershaw

Hi,

I have a directory full of a number of .PDF files that I need to
print.
Is there any simple way to do this?
Using PdfReader purhaps?

Thanks in advance.
Steve

Re: How to print .PDF files in the background using C#

am 22.04.2008 22:24:45 von mark

"S_K" wrote in message
news:df6303b1-cf31-4154-b342-14d4c33e2d38@u69g2000hse.google groups.com...

> I have a directory full of a number of .PDF files that I need to
> print.
> Is there any simple way to do this?
> Using PdfReader purhaps?

As this is an ASP.NET newsgroup, are you trying to print these documents via
a web application i.e. through a web browser...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Re: How to print .PDF files in the background using C#

am 22.04.2008 22:52:26 von Steve Kershaw

On Apr 22, 2:24=A0pm, "Mark Rae [MVP]" wrote:
> "S_K" wrote in message
>
> news:df6303b1-cf31-4154-b342-14d4c33e2d38@u69g2000hse.google groups.com...
>
> > I have a directory full of a number of .PDF files that I need to
> > print.
> > Is there any simple way to do this?
> > Using PdfReader purhaps?
>
> As this is an ASP.NET newsgroup, are you trying to print these documents v=
ia
> a web application i.e. through a web browser...?
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

I'm sorry. It's an ASP.NET web application.

Thanks

Re: How to print .PDF files in the background using C#

am 22.04.2008 23:06:33 von mark

"S_K" wrote in message
news:3482a319-6f63-4549-8607-1b9bbc09840f@e39g2000hsf.google groups.com...

>>> I have a directory full of a number of .PDF files that I need to
>>> print. Is there any simple way to do this?
>>> Using PdfReader purhaps?
>>>
>> As this is an ASP.NET newsgroup, are you trying to print these documents
>> via
>> a web application i.e. through a web browser...?
>
> I'm sorry. It's an ASP.NET web application.

You're not going to be able to persuade a web application to control a
printer automatically for security reasons - all modern web browsers are
designed specifically to prevent this...

Your best bet would be to make the PDF documents available as hyperlinks.
This would allow the user to display the documents individually and print
them as required...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Re: How to print .PDF files in the background using C#

am 23.04.2008 17:01:13 von Steve Kershaw

On Apr 22, 3:06=A0pm, "Mark Rae [MVP]" wrote:
> "S_K" wrote in message
>
> news:3482a319-6f63-4549-8607-1b9bbc09840f@e39g2000hsf.google groups.com...
>
> >>> I have a directory full of a number of .PDF files that I need to
> >>> print. Is there any simple way to do this?
> >>> Using PdfReader purhaps?
>
> >> As this is an ASP.NET newsgroup, are you trying to print these document=
s
> >> via
> >> a web application i.e. through a web browser...?
>
> > I'm sorry. It's an ASP.NET web application.
>
> You're not going to be able to persuade a web application to control a
> printer automatically for security reasons - all modern web browsers are
> designed specifically to prevent this...
>
> Your best bet would be to make the PDF documents available as hyperlinks.
> This would allow the user to display the documents individually and print
> them as required...
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

I'm sorry, there are over 300 .PDF documents stored on a remote
server. Displaying them indivitually and printing them is completely
out of the question! Is there anyway to print them on the server (not
client-web browser) side?

Steve

Re: How to print .PDF files in the background using C#

am 23.04.2008 21:14:46 von mark

"S_K" wrote in message
news:9b4bce03-e5aa-4568-a0c3-4e3432658f1b@p25g2000pri.google groups.com...

> I'm sorry,

There's no need to apologise...

> there are over 300 .PDF documents stored on a remote server.
> Displaying them individually and printing them is completely
> out of the question! Is there anyway to print them on the server (not
> client-web browser) side?

Yes, but not natively as PDF support isn't built into the .NET Framework.
However, there are many 3rd-party add-ins which you can use:
http://www.google.co.uk/search?sourceid=navclient&hl=en-GB&i e=UTF-8&rlz=1T4GZEZ_en-GBGB252GB252&q=%22C%23%22+PDF+print

Alternatively, if this is a one-off exercise and you have networked or even
direct access to the server in question, maybe bespoke software is not the
most cost-effective solution...? Have you considered maybe just getting a
temp in and printing the documents manually? 300 documents isn't that
many...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Re: How to print .PDF files in the background using C#

am 23.04.2008 22:27:57 von Steve Kershaw

On Apr 23, 1:14=A0pm, "Mark Rae [MVP]" wrote:
> "S_K" wrote in message
>
> news:9b4bce03-e5aa-4568-a0c3-4e3432658f1b@p25g2000pri.google groups.com...
>
> > I'm sorry,
>
> There's no need to apologise...
>
> > there are over 300 .PDF documents stored on a remote server.
> > Displaying them individually and printing them is completely
> > out of the question! Is there anyway to print them on the server (not
> > client-web browser) side?
>
> Yes, but not natively as PDF support isn't built into the .NET Framework.
> However, there are many 3rd-party add-ins which you can use:http://www.goo=
gle.co.uk/search?sourceid=3Dnavclient&hl=3Den-GB&ie=3DUTF-8& r...
>
> Alternatively, if this is a one-off exercise and you have networked or eve=
n
> direct access to the server in question, maybe bespoke software is not the=

> most cost-effective solution...? Have you considered maybe just getting a
> temp in and printing the documents manually? 300 documents isn't that
> many...
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

Thanks Mark for your solution. I'll imediately look into it.
I do have direct access to the server in question.

By the way, thats 300 documents per week! While it would help the
unemployement rate to hire a temp to print the 300 documents, I would
rather just give my user a PRINT button that prints everything in the
server directory.

Thanks again. As always you have been very helpful!

Steve

Re: How to print .PDF files in the background using C#

am 23.04.2008 23:39:49 von mark

"S_K" wrote in message
news:b4fa6487-474b-42f4-89a0-4180fefd0979@x41g2000hsb.google groups.com...

> By the way, thats 300 documents per week! While it would help the
> unemployement rate to hire a temp to print the 300 documents, I would
> rather just give my user a PRINT button that prints everything in the
> server directory.

OK. In that case, and since you have direct access to the server in
question, I would strongly suggest that ASP.NET is not the right platform
for this...

Instead, I would recommend a WinForms app so that the printing exercise does
not put unnecessary strain on the web application...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Re: How to print .PDF files in the background using C#

am 24.04.2008 15:16:54 von George Ter-Saakov

It's going to be hard to print document from server to clients printer.
Although it's possible.
1st step: You need to register printer on a server. Google "print from
Windows service" to see how to do it.
2nd step: Adobe Arobat support "DDE automation" or simple command string. So
something like
AcroRd32.exe /t "C:\test.pdf" "\\servername\printername" "AdobePS Tektronix
Phaser 840" "123.45.678.910"
will work

Visit this link http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm

------------------------------------------------------------ -----------------------

How about merging all 300 pdfs into 1 big PDF file? Then you can open up it
in browser and have user to click "Print" button only once.
Then you do not need to mess with the printers/adobe....
Look for ITextSharp - free C# library to work with PDF.



George.


"S_K" wrote in message
news:9b4bce03-e5aa-4568-a0c3-4e3432658f1b@p25g2000pri.google groups.com...
On Apr 22, 3:06 pm, "Mark Rae [MVP]" wrote:
> "S_K" wrote in message
>
> news:3482a319-6f63-4549-8607-1b9bbc09840f@e39g2000hsf.google groups.com...
>
> >>> I have a directory full of a number of .PDF files that I need to
> >>> print. Is there any simple way to do this?
> >>> Using PdfReader purhaps?
>
> >> As this is an ASP.NET newsgroup, are you trying to print these
> >> documents
> >> via
> >> a web application i.e. through a web browser...?
>
> > I'm sorry. It's an ASP.NET web application.
>
> You're not going to be able to persuade a web application to control a
> printer automatically for security reasons - all modern web browsers are
> designed specifically to prevent this...
>
> Your best bet would be to make the PDF documents available as hyperlinks.
> This would allow the user to display the documents individually and print
> them as required...
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

I'm sorry, there are over 300 .PDF documents stored on a remote
server. Displaying them indivitually and printing them is completely
out of the question! Is there anyway to print them on the server (not
client-web browser) side?

Steve