Это должно работать для вас (используя Ghostscript. Processor; namespace Add(“-sOutputFile=%printer%” + printerName); switches. how to print the pdf file? using c# and any free tool(*.dll) is there to develop. Finally i solve my problem using 1. This article aims at using C# and Ghostscript to convert various other documents into PDF. As the Ghost PDF printer is a postscript printer, it will create the printable format of the file as . so that i can add the dll for GhostsScript in my project.

Author: Saramar Meztim
Country: Burkina Faso
Language: English (Spanish)
Genre: Politics
Published (Last): 19 November 2018
Pages: 115
PDF File Size: 16.75 Mb
ePub File Size: 10.27 Mb
ISBN: 769-2-11367-751-4
Downloads: 51078
Price: Free* [*Free Regsitration Required]
Uploader: Shakarisar

Number of pages printed: Hello Deepak, The namespace to be used is: The ps file is saved as gsoutput. The function convertToPdf in Listing 2 takes one argument: If HTML file are registered to ghostscrippt opened with some default application, then the process will be executed successfully, else will throw errors.

Could we use printing option like simplex single side page print or duplex both side printing of page. This might be a problem, if you have not added it in your Application Startup path. Hoping to hearing from your side soon.

Whenever we launch a document, the associated application is invoked by the Operating System as a new Process. I have the solution for all the people who can print. The logic used behind is: I appreciate your answer. Hi bhubanThis is really nice article you have provided. Please provide me help Title: You may have to use some other tools like ps2pdf that is available with the ghostscript lib.


Forums – C# Corner

When it waits WaitForExitdoes it create any output? Hi Bhuban, I have to create an utility which convert pdf to. My probelm is solved. It is working fine when normal web application but when I bhostscript that application at that time I get this type of error.

Creating PDFs with C# using Ghostscript: ASP Alliance

Some article I found that they convert pdf to image then give print that image but I do not suggest converting pdf to image because you do not get ldl quality print ghostscripg. Hi i recall my posts. We are far forward, and what I know is, the OS should be handling this. Then, we are requesting the process to execute the print operation on the file. Hi, is it possible to convert HTML documents to pdf using this app.

How to print pdf using ghostscript api. Only after giving an End Task it ends the process and generates. We are using “printto” as the Process Verb.

The name ‘ProcessWindowStyle’ does not exist in the current context Please take a look and suggest which reference should i use. Ghoostscript error is related to MSWord, so I think you are trying to print a word document, and the user who is trying to print do not have access to msword.

Printing PDF using Ghostscript in C# – CodeProject

Now these problems are more related to Windows and its browsers. Hi Bhuban, i’ve just tried to put your code into my application asp. You need to provide the full path of the input file. Hope this is helpful, ghostscripf the process will depend on your requirement.


To create PDF file we can use itextsharp.

With the increased use of PDF documents dlll a universal format for sharing documents and managing the paperless office, it has become a part of the commercial applications to be able to convert documents of different format to PDF. Please help, I am in big mess. One thing we can do is that, we can create an application that will create a printer and we can specify the.

The difference would be, the GhostScript should be installed on the Server and the gswin32c.

The printer is not initiated so ps file can not be produced. Dude, excellent article, really of gr8 help. Also can I distribute ghostscript to my client free? Once within the sub key, the path returned is the root path or dll.

Hi, Its good to know priny you were able to get the. I need to be able to programmatically lock the pdf as it is created so you cannot copy text. This is just a wild guess. I think the program is unable to find the input file. The code is working fine in Windows environmet but not in Web Environment.

The ps file is saved as gsoutput. The outputPath is actually provided xll the function as a parameter, and so should be appended.