473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

S_K
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
Jun 27 '08 #1
10 8808
"S_K" <st***********@yahoo.comwrote in message
news:df**********************************@u69g2000 hse.googlegroups.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

Jun 27 '08 #2
S_K
On Apr 22, 2:24*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"S_K" <steve_kers...@yahoo.comwrote in message

news:df**********************************@u69g2000 hse.googlegroups.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 MVPhttp://www.markrae.net
I'm sorry. It's an ASP.NET web application.

Thanks
Jun 27 '08 #3
"S_K" <st***********@yahoo.comwrote in message
news:34**********************************@e39g2000 hsf.googlegroups.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

Jun 27 '08 #4
S_K
On Apr 22, 3:06*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"S_K" <steve_kers...@yahoo.comwrote in message

news:34**********************************@e39g2000 hsf.googlegroups.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
Jun 27 '08 #5
"S_K" <st***********@yahoo.comwrote in message
news:9b**********************************@p25g2000 pri.googlegroups.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?sourc...3%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

Jun 27 '08 #6
S_K
On Apr 23, 1:14*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"S_K" <steve_kers...@yahoo.comwrote in message

news:9b**********************************@p25g2000 pri.googlegroups.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?sourc...-GB&ie=UTF-8&r...

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 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
Jun 27 '08 #7
"S_K" <st***********@yahoo.comwrote in message
news:b4**********************************@x41g2000 hsb.googlegroups.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

Jun 27 '08 #8
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/devs...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" <st***********@yahoo.comwrote in message
news:9b**********************************@p25g2000 pri.googlegroups.com...
On Apr 22, 3:06 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"S_K" <steve_kers...@yahoo.comwrote in message

news:34**********************************@e39g2000 hsf.googlegroups.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
Jun 27 '08 #9
On Apr 24, 6:16*pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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 linkhttp://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" <steve_kers...@yahoo.comwrote in message

news:9b**********************************@p25g2000 pri.googlegroups.com...
On Apr 22, 3:06 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:


"S_K" <steve_kers...@yahoo.comwrote in message
news:34**********************************@e39g2000 hsf.googlegroups.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...


Create a small thick client application (let's call it the print
manager) that gets installed on the dealers machine's. This can be a
simple executable that need not run as a service or even in the task
tray. Once all of the documents have been generated (as separate
documents on the server) and saved to the appropriate location on the
server (preferably in the database) a special document should be
downloaded to the client (called a manifest) that contains a list of
all the files (or file IDs) that need to be printed as well as their
print options. The manifest should have a unique extension that is
recognized and associated with the print manager such that when the
file is opened, the print manager automatically launches. The print
manager will download each document listed in the manifest and
automatically print it. Because the print manager runs as a thick
client, it can directly communicate with the printer, setting the
approprate page size, orientation and duplex settings. Alternatively,
the manifest file could contain only the list of documents and the
print options could be sent as meta-data along with the document.
Prefered method for communicating with the server

Jun 27 '08 #10
On Apr 23, 12:55*am, S_K <steve_kers...@yahoo.comwrote:
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
Hi

I have a number of pdf files in a directory. i want to print all and
want a .ps file.

please suggest me.

How can i do this in C#?

Hoping to hear from your side.

thanks in advance
Jun 27 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RoDzZzZ | last post by:
when i try print (ctrl +p) my webpage, my printer not print the backgrounds and bgcolors of my tables.... what i need make to show the backgrounds and bgcolors in my paper when the user print...
3
by: Felix Natter | last post by:
hi, is there a way (html/css/javascript) to force IE to print background-colors exactly as specified in html/stylesheets? I tried to use @media print { ... } to override IE's "print background...
5
by: Lee K. Seitz | last post by:
I have a set of pages with a special stylesheet used to override some styles for printing. One of the things I've tried to do is reverse the colors of my navigation. On the screen, I have a black...
2
by: Wim van Iersel | last post by:
I hope somebody knows what I´m doing wrong here I have a page with two stylesheets: - default.css media="screen, print" http://www.tilburg.nl/development/stylesheets/default2.css - print.css...
3
by: SpamProof | last post by:
I'd like to be able to print multiple documents are once using vb.net. What is the best way to do this with out having to print each document one at a time via a loop . Can't I send them all to...
9
by: Rhino | last post by:
How hard (and desireable) would it be to give the user certain choices when it comes to printing web pages? The pages on my site use colours and pictures and contain an imbedded menu, among...
4
by: zz | last post by:
Sorry for posting this here but unfortunatly I couldn't find any appropriate newsgroup for this and since I've been active here with .net question I figured you guys might be able to help. ...
21
by: tradmusic.com | last post by:
Hi, We have the following in our stylesheet, which acts as a page header: #homepageheader { left: 0px; top: 0px; right: 0px; height: 183px; background-image:...
66
by: happyse27 | last post by:
Hi All, my html code is sno 1) and perl code is sno 2). a) I tried to print $filename and it cant print out the value, only blank was displayed, and the file could not be uploaded. And it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.