Can't create pdf file automatically from my application when run from IIS using PDF Printer

Hi everybody,

 I've an application developed in ASP.Net to convert any file to pdf file using Adobe PDF Printer.
In the .aspx page I've kept one button control and in the click event I've written :

protected void Button1_Click(object sender, EventArgs e)
{
try
            {
                Process printProcess = new Process();

                printProcess.StartInfo.FileName = "E:\\Krushna.doc";

                printProcess.StartInfo.Verb = "printto";
                printProcess.StartInfo.Arguments = "\"Adobe PDF\"";

                printProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
                printProcess.StartInfo.CreateNoWindow = true;
                printProcess.Start();

                try
                {
                    //printProcess.WaitForExit();
                }
                catch (InvalidOperationException ex)
                {
                    throw ex;
                }

                printProcess.Dispose();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
}

Please note that I'm using Adobe Acrobat 6.0 Professional and PDF Printer is installed in my system and it is set to default printer.
In the properties of the PDF Printer, in the Port tab, I've set the port to "My Document\*.pdf " . It will save the .pdf file to My Document.

I'm using ASP.Net 2.0 with IIS 5.1 installed.

The issue is :
This is working fine while running the application directly(i.e. the Krushna.doc file is converting to Krushna.pdf and save to My Document Folder) .

But when the application running from IIS, it is asking to save the pdf file i.e. one save dialog window is opened. But I need to directly save the pdf file to the My Document Folder.

How I'll do it so that the pdf file will save automatically when running from IIS ?

Please reply...It is urgent requirment.

Thank you.

0
Krushna
4/2/2009 12:13:20 PM
asp.net.component-discussions 1793 articles. 0 followers. Follow

11 Replies
1142 Views

Similar Articles

[PageSpeed] 37

Krushna Chandra Sahu:
This is working fine while running the application directly(i.e. the Krushna.doc file is converting to Krushna.pdf and save to My Document Folder) .

But when the application running from IIS, it is asking to save the pdf file i.e. one save dialog window is opened. But I need to directly save the pdf file to the My Document Folder.

How I'll do it so that the pdf file will save automatically when running from IIS ?

Please reply...It is urgent requirment.

Thank you.

yes since on client machine you cannot save file without his permission

hence browser will prompt for File save dialog

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
4/2/2009 12:27:44 PM

mudassarkhan:

Krushna Chandra Sahu:
This is working fine while running the application directly(i.e. the Krushna.doc file is converting to Krushna.pdf and save to My Document Folder) .

But when the application running from IIS, it is asking to save the pdf file i.e. one save dialog window is opened. But I need to directly save the pdf file to the My Document Folder.

How I'll do it so that the pdf file will save automatically when running from IIS ?

Please reply...It is urgent requirment.

Thank you.

yes since on client machine you cannot save file without his permission

hence browser will prompt for File save dialog

 

 So, can you please reply how I'll give the permission ?

Or, how I'll set the file path, so that it will save the converted pdf in the particular folder specified ?

Or, anything need to  change in the PDF Printer ?

 Please reply.

Thank you.

0
Krushna
4/3/2009 9:41:25 AM

Krushna Chandra Sahu:

So, can you please reply how I'll give the permission ?

Or, how I'll set the file path, so that it will save the converted pdf in the particular folder specified ?

Or, anything need to  change in the PDF Printer ?

 Please reply.

Thank you.

You cannot since ur application is hosted on server , your page is downloaded on client machine withing a browser and the browser has limited rights

So you cannot do anything without clients permission


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
4/3/2009 9:53:06 AM

mudassarkhan:

Krushna Chandra Sahu:

So, can you please reply how I'll give the permission ?

Or, how I'll set the file path, so that it will save the converted pdf in the particular folder specified ?

Or, anything need to  change in the PDF Printer ?

 Please reply.

Thank you.

You cannot since ur application is hosted on server , your page is downloaded on client machine withing a browser and the browser has limited rights

So you cannot do anything without clients permission

 

Actually my requirement is to convert any type of file(.txt, .doc, .html etc) to pdf file.

The client will hit a button and the file associated with the application will print on the server(i.e. actually it will not print but it will convert to PDF file and will save to the Port or the folder name associated with the PDF printer).

If should not come as a dialog box to save the pdf file. Because at the server side, no one will be there to save the file.

In my application, I'm checking with local server (IIS) . It is on my machine. When running the application, save dialog is coming.

Also, I've given my IIS path to other colleague. When they run the application on their system, the save dialog is appearing on my system(Local server) which is not the requirement. It should save directly to the port provided on PDF Printer on my system(Now it is My Document\*.pdf).

Also, I've change the port of  the PDF Printer to other drives other than C drive. But the save dialog is still coming. And there the default path is showing to the path which is given to the PDF Printer port. And some body should be available to hit the save button on the server side.

Can it be possible with any third party tool (like  iTextSharp) ?
Please guide me if it is possible with detail code.

Thank you.

0
Krushna
4/3/2009 11:03:04 AM

Oh I see you mean server side you are getting Open save dialog

Which tool you are using to convert files?

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
4/3/2009 12:44:52 PM

mudassarkhan:

Oh I see you mean server side you are getting Open save dialog

Which tool you are using to convert files?

 

I'm using Adobe PDF Printer  installed in my system.

No other tool or third party dll I'm using.

What I used, all the code I've posted already in this post. Please check it once more.

Thank you  that you are trying hard for me. Please try to give this a conclusion.

0
Krushna
4/3/2009 1:12:22 PM

Krushna Chandra Sahu:

I'm using Adobe PDF Printer  installed in my system.

No other tool or third party dll I'm using.

What I used, all the code I've posted already in this post. Please check it once more.

Thank you  that you are trying hard for me. Please try to give this a conclusion.

I'll suggest pass the output file path as argument to the exe file

then it will not show save file dialog


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
4/3/2009 1:23:27 PM

mudassarkhan:

I'll suggest pass the output file path as argument to the exe file

then it will not show save file dialog

 

Can you please tell me that how I'll pass the output file path ?

0
Krushna
4/3/2009 1:57:37 PM

Refer here

http://forums.asp.net/p/1346459/2782812.aspx#2782812

some methods discussed


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
4/3/2009 2:11:55 PM

mudassarkhan:
 

This not helpful. I'm not getting how to set the output file path.

I think this option is not there with System.Diagnostic..Process

 Any other method if possible?

Thanks.

0
Krushna
4/3/2009 2:31:05 PM

Bu still Give a try to that method

may be it will be converting without open file dialog

Since I think there's no other way the same can be done I only found this post while googling

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
4/3/2009 2:49:22 PM
Reply:

Similar Artilces:

Installation 'Sybase DataWindow PS' printer on W98 doesn't work (so PDF export can't work either)
I have a problem with export DataWindow content to PDF on W98 systems. (I don't have any problem with PDF export on other systems like as WINNT, W2K, WXP). I found out that the problem is in the Sybase DataWindow PS printer. It looks like installed but it DOESN'T WORK on W98. When I try print something on this printer then no PostScript file is created. So I tried manual installation of it but it occurs an error during manual installation (I used description of instalation from Bruce Armstrong). The error said that printer driver (PSCRIPT.DLL) can't be loaded. I use...

How to Run my .exe file or Application in the Background using .NET Application like explorer.exe file is Running always in the Background...(you can see in task Manager..)
Hi , This is Sundar , i want to develope one small Application in windows or web ,that should send the mail continiously according to at what time scheduled in the application and that should Running in the Background always like windows service,SQL server ........ so , please help me ......................  what;s the problem if you develop an windows service and install it in your system.  http://www.15seconds.com/issue/021007.htmGive a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.  see, i have created the Windows services and wh...

ActiveX component can't create object 'outlook.application'
Hi,        I'm trying to do a web application that will take the info passed by the user, generate an report with excel and automatically send a mail throught outlook. I used vbscript to generate the mail. All works fine on localhost, but on server, I get the following error: ActiveX component can't create object 'outlook.application'. my code : <code> <script language=vbscript type="text/vbscript">Sub SendMailAuto(StrAdress, message, subject, message2, filepath) Dim objOutlook Dim objNameSpace Dim objInbox D...

ver 3.6b4 Firefox browser
Name: info@cosmiccircuit.com Email: infoatcosmiccircuitdotcom Product: Firefox Release Candidate Summary: ver 3.6b4 Firefox browser - can't play Quicktime X files created using 'Save for Web' Comments: Still unable to display Apple's videos created using Quicktime X's 'save for web' feature. See an example at: http://concertvideopro.com/samples/index2.htm These videos play in IE & Safari ok. Browser Details: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2b4) Gecko/20091124 Firefox/3.6b4 From URL: http://hendrix.mozilla.org/ ...

PB 10.0.1 can't create PDF's?
Huh. The first bug I've found since migrating my app to 10.0.1 is that I can no longer create PDF files. Well, I can create them, but they're corrupted (only 3K), and can't be opened. This reminds me of the problems that I had with PB9 when I didn't have ghostscript configured right... maybe I need to do something different? It seems unlikely that Sybase missed this one. Is anyone else seeing this? thanks, Pat By the way, I tried the Windows 2003 fix in the release notes, even though I have Windows XP Pro SP2... didn't work. "Pat Madiga...

Create PDF file using .NET
Hello List, Can someone tell me how can I create PDF file using .NET? Thanks in advance, Peter, Hi, Tale a look @ ABCpd HTH K B ShajudeenAreYaar.comDubai, United Arab Emirates. Also, Siberix PDF Library for .NET is available as a trial download. I had the trial up and running in minutes. Couldn't have been easier ...Alister Below post has some related info http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=380008Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti...

create a PDF-File in a .NET application
Hi How Can I create a pdf file in asp.net dynamically Thanks jj There are several components listed in the Control Gallery that provide that ability.JimMS MVP ASP.NET [VC++/MFC emeritus]Old Dog Learns New TricksPreferred programming language: cuneiform on clay tablets...

Looking for a PDF library or components that creates searchable PDF files
Does anyone know of a good library that creates PDF files that are searchable? This will most likely involve some type of OCR library having to be included. Even if I have to purchase multiple components to get the job done I can live with that. I have seen several PDF libraries, but I have yet to find one that can produce searchable PDF files. TIA I presume that your PDFs are actually bitmaps, not text output to a canvas. I've used the application of ABBYY FineReader for adding OCR'd layers and it works well. They have an SDK version at http://www.abbyy.com/ocr_sdk/ (The...

Can't send out a pdf file
This is a code in my servlets to send out a pdf file (attached here as temp.pdf). There is no problem to open temp.pdf file directly from the disk. But sending out the same file from the servlet ,cause explorer or acrobat to crash. byte pdfblob[]; int pdfLength; // code hiere gets temp.pdf from the disk and populate pdfblob[] ... pdfLength = java.lang.reflect.Array.getLength(pdfblob); response.setContentType("application/pdf"); response.setHeader("Content-Length",Integer.toString(pdfLength)); ServletOutputStream soutputstream = response.ge...

can't download pdf files
Name: Paolo Zanghieri Email: paolodotzanghieriataniadotit Product: Firefox Summary: can't download pdf files Comments: I cannot dodwnolad files. I just get a blank webpage with the "completed" indication. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7 ...

Can't open pdf files
Name: John Hille Email: hjhilleatmindspringdotcom Product: Firefox Summary: Can't open pdf files Comments: Hi Mozilla, We love Firefox but, over the last few days, we have not been able to open online pdf files with Firefox. Regrettably, we will have to switch back to Internet explorer until this block is resolved. Thank you for your help. Best wishes, John Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0 ...

Can't open pdf files
Name: Robert Product: Firefox Summary: Can't open pdf files Comments: Yeah when I ahd FF2 I could open PDF's now all I get is a blank screen. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

Can't download PDF files
Name: Jim Wilkins Email: jamesewilkins_at_earthlink,net Product: Minefield Summary: Can't download PDF files Comments: WHen I click on a URL to loadd a PDF file, the file is either not downloaded, or it is downladed but not openable by Acrobat Reader, or is not recognized as a PDF file. This is also a 2.0 problem. Running a MacPro 2.66 Ghz with OS 10.4.8. Browser Details: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a1) Gecko/20061102 Minefield/3.0a1 ...

Can't open PDF files
Name: Ed Tulloch Product: Firefox Release Candidate Summary: Can't open PDF files Comments: When I open PDF file in Firefox 3 Beta 4, a dialog box says: "Cannot use Adobe reader to view PDF in your web browser. Reader will now exit..." Good work on the new version! Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9b4) Gecko/2008030714 Firefox/3.0b4 From URL: http://hendrix.mozilla.org/ On Mar 22, 8:19=A0pm, Ed Tulloch <hendrix-no-replyatmozilladotorg> wrote: > Name: =A0 =A0Ed Tulloch > Product: Firefox Release Candidate >...

Web resources about - Can't create pdf file automatically from my application when run from IIS using PDF Printer - asp.net.component-discussions

Facebook Users Automatically Checked In To Events They RSVPed Yes To
A reader tipped us off that Facebook is automatically checking in users at events that they RSVPed they would attend. continued… New Career ...

Now Users Can Remove Contacts Automatically Saved by Facebook’s Friend Finder
Two weeks ago, many Facebook users began asking questions about curiously good recommendations suddenly appearing in Facebook’s “People You May ...

App Store - Attachments.me- Gmail inbox software to efficiently manage emails, automatically send/upload ...
Get Attachments.me- Gmail inbox software to efficiently manage emails, automatically send/upload files to cloud storage(Dropbox, Box, and G Drive), ...

Automatically organize your desktop icons into shaded areas called Fences! - YouTube
Fences® is the most popular desktop organization tool used by millions of users worldwide. Create shaded areas called "fences" to automatically ...

CSAIL fixes software bugs automatically, in any language, by copying from safer applications
A new system can repair bugs in software using smart processing that imports functionality from other programs, all without access to source ...


Emailing porn at work not automatically sackable, court finds
Australia's federal court has upheld a ruling that emailing pornography in the workplace is not automatically a sackable offence.

Shazam iPhone app now listens for music, TV shows automatically
Shazam has updated its iPhone app to tag songs, TV shows and more on its own, no longer requiring users to open the app and tap a button.

App of the day: Human for iPhone automatically tracks your movements
Human for the iPhone is an activity tracker that automatically distinguishes between different types of movement.

iPhone 5 automatically rotates using Cycloramic App. - YouTube
[NEW VIDEO] Cycloramic 2.0 update teaser vid with panoramic photo preview: http://www.youtube.com/watch?v=cjHUID07xs4 Cycloramic has been Awarded ...

Resources last updated: 11/24/2015 8:38:34 AM