I have requirement to create virtual printer which used to register my printer in the printer drive ,Whenever my printer invoked it should generate PDF file for respective page . I had created and invoked my printer functionality,here comes the problem,i could not find how to convert temp file(.PS) to PDF file or any image file.Please let me know if anyway I cld achieve this....
Thanks in advance,
Vinod
You need to find a library that will convert from PS to PDF for you. A quick Google shows that there are libraries available, but they may not be free. It's up to you to go and look for yourself now to see if any suit your requirements.
Related
I need to take a PDF file url, send it as a parameter to a web service that will print it on a network printer. It has to be done server side without any user interaction.
Do you know some libraries that we can use to acheive that ? We look at different options like iTextSharp but it looks like there's no way to print from that library.
Thanks.
If you can download the file and save it as a PDF and have Acrobat Reader installed you can use a command line to print it (shell it).
http://www.robvanderwoude.com/commandlineswitches.php#Acrobat
Print a PDF file silently:
AcroRd32.exe /N /T PdfFile PrinterName [ PrinterDriver [ PrinterPort ] ]
It would be nice to know what commercial component you used...
I had to something like that, but using PCL. We used winspool.drv to open the printer, start a document then a page, write out the bytes, then end the page & document and close the printer. We installed PCL drivers for the printer on the local machine to print to a network printer.
You might be able to do something like that with Postscript drivers. A quick test would be to to a binary copy of a PDF to the printer using the command prompt and the /B switch on copy. I think you specify the PDF and the printers network share as source/destination. Use a small PDF to avoid getting a ream of random characters in case it doesn't work.
We'll finally use a commercial component that does all this by itself.
Thanks for your help.
I am working on a application which requires me to create a printer type driver, which offers to decrease the quality of document, and then prints the document.
Where document can be anything like image, word, pdf. And this application should be listed as new printer in the documents printers menu.
What I was thinking to create an application that will be installed as printer driver, and when this printer is selected for print then this application consider print documents as image and decrease the image quality based on user input. then these can be copied into new pdf and then print this newly created pdf silently using default printer drivers.
Can anyone tell me if I am thinking on the right track, and if I am thinking on right then please help me out in this, as I have no idea how to do this stuff.
I am using C# and .NET for creating this application.
thanks in advance
It's a good approach but it's not possible to create a printer driver in C# and .NET. You will need the Windows Driver Kit and C/C++.
I have searched for this but cant find anything to help.
I have a WordprocessingDocument - using DocumentFormat.OpenXml.Wordprocessing.
Is there a way to print this straight off to a printer, I dont want to save it at all?
Thanks
No, you'll need some sort of program to take the Open XML and translate into how it should be displayed for the printer. In its raw form its just XML and without the translation the printer won't print it how you would expect.
I need an algorithm that converts any file format to its .PRN file equivalent which will be compatible for a specific printer (for example, only in CANON printers).
Or I need a source code or way to know how printer drivers work. Printer drivers are the one who specifies or creates the .PRN file of any type. So please help me. Thanks!
Since you said, from any format to .prn format, I am taking two cases here assuming Windows environment:
Let's say your source is MS_WORD (.doc) file. If you have the appopriate printer installed, you can easily get the .prn file, by opening the file in MS-WORD and doing print using the appropriate printer. However, before this, set the port to "File" in Control Panel for the particular driver.
However assuming you have a file in some xyz format, for which there is no rendering application needed, you may have to identify a converter on a case to case basis probably
Consider dowloading the windows driver kit (WDK), it has free printer driver sample code,
you can find the full list of sample code it has here. Also, you can look at the printer driver docs here
I'm not sure if this is possible but as I was looking for a way to convert docx -> pdf serverside (Aspose is a bit expensive), I wondered if I could do this by printing my document to a Pdf Printer.
Altho, I would need a decent one then, as it shouldn't show dialogs when trying to print ofc.
Does anyone know if:
This is possible
There exists such a printer which can be easily used in a WCF Service
Thanks
Try pdfcreator.
PDFCreator is a free tool to create PDF files from nearly any Windows application.
Key Features:
Create PDFs from any program that is able to print
...
Terminal Server: PDFCreator also runs on Terminal Servers without problems
If you can read DOCX content and print from your WCF service, the pdfcreator printer driver will generate PDF from anything.