Windows programmable virtual printer "device" - windows

I have no idea how this windows service called or how should I tag it.
But I have seen around some software driven printing devices/configurations at windows, like Send to OneNote or Convert to PDF (from different pdf applications).
So I want to create one like this myself, lets say a virtual printer device that converts documents into PDF file.
How it called? Where I can find some information about it ?
Thank you.

A lot of these applications (on Windows) actually use the built-in Windows PostScript printer driver to produce a PostScript program from the application.
That is then sent to a virtual printer (in versions of Windows before Windows 10, a Port Monitor is used) which stores the program on disk. It then starts up a PostScript interpreter which is capable of creating a PDF file from a PostScript file. Notably these include Adobe Acrobat Distiller, the JAWS PostScript interpreter and Ghostscript. Because Ghostscript is open-source, it is probably the most widely used.
The alternative approach is to write a printer driver. This needs to accept OS native drawing operations (which differ according to the operating system) and then produce PDF equivalents for those drawing operations, and wrap the whole thing up as a PDF file.
The first solution is easiest, because it leverages the work other people (the OS vendor and the PostScript interpreter vendor) have done. The latter is, I think you'll find, much harder.
Of course, since Windows and MacOS can both now produce PDF files, it seems somewhat redundant to implement these now.

Related

How can i make an basic GUI application in PostScript

I have searched in google regards the GUI application for postscript. I was redirected to this page https://www.whoishostingthis.com/resources/postscript/
And got some tools name which is mentioned below:
1)ImageMagick-(Installed successfully,But not working)
2)Pslib- Library
3)Gnuplot- A command-line graphics and data visualization tool
4)Cairo- Library
5)GNUEnscript-Tool which is used to convert ASCII files into PostScript files
6)GNU a2ps- Any to PostScript filter
Please Guide me from here,To make an GUI application in PostScript
Thanks in advance..
There are a few options and a lot of caveats. As Ken rightly says, PostScript has a limited scope for interacting with the operating system. There are a few technologies that extended the basic PostScript environment for GUI applications, namely NeWS (from Sun) and Display PostScript (from Adobe). While these worked somewhat differently, PostScript was primarily intended to be an output-only component of a larger application using the C API.
Some options for a similar kind of setup would be running ToastScript as part of a larger Java application. Or maybe scripting ghostscript with TCL or Python.
Without a lot of extra work, you can use ghostscript for graphical output as long as the input comes from the terminal. Eg. my Mandelbrot Set program.

Maintaining the searchability of a document printed to a virtual printer in Windows

I need to print a document on Windows and record a searchable PDF in a remote database.
Presently, I can print to a remote CUPS server which is modified to save the PDF to a database. But every Windows printer driver I've used makes the document non-searchable (I can test this by printing to a file with the driver, whether it's PostScript or Print to PDF).
I've been thinking that the next step is to write a driver or driver plug-in which will preserve the searchability of a document. This means writing code that converts from an EMF file to RAW, described here https://learn.microsoft.com/en-us/windows-hardware/drivers/print/introduction-to-print-processors.
Writing a Windows Printer Driver would suggest that I could do this with a simple UI plugin.
Is there an easier way to go about this? Would love a second (or third, or fourth) opinion.
Yes, writing a printer driver would be the way to go here. I think writing a driver per-se is not that hard, although I have never personally done it. The fact that they run in user mode makes it much easier than having to write a kernel-level driver.
To convert those GDI calls into PDF, you should look for some kind of library as this is a complex task. Some info for you here, else ... Goooooooooooooogle!

Extract pictures from a table in a PDF

I would like to write a small program, or script, to extract a set of pictures from a pdf.
I have several PDFs, they each have a table of pictures. I would link to have one picture per file. Therefore I need a way to extract them. Due to the nature of the PDF (A table/grid), it seems that it would be much easier to write a program, than do some manual method. However I have no idea what tools are available.
What libraries are available?
Preference Python, then C# or Java, then maybe some other language (My C and C++ is rusty, I have not done them for years).
I am on Debian Gnu/Linux, so have a wide choice of tools.
I went with pdfbox (an Apache project, so Free Software) it is a java library and a command line tool (the app module). I then scripted it with a bit of python to process the extracted text (yes it did that as well), and rename the image files.

command line program to list layers in a DXF/DWG file

I have a CAD file and I'd like to do some scripting with it and was hoping for a little software program that could just give me a list of the layers. I tried (on mac and windows) to get CAD::Drawing from cpan working (perl) to no avail.
Could somebody point me to either a library (more or less any language is fine) or a software program that will allow me to accomplish this. Platform doesn't matter I have access to Linux mac and pc.
Thanks
For standalone applications, the two most common DWG libraries are Teigha and RealDWG. DXF files are text files that can be parsed fairly easily without any special libraries.

Develop Print Driver

I need to develop a print driver to print from any application into a TIFF file. Does someone know of resources or a good SDK vendor that would enable me to do that? Environment is Windows, any language.
The Microsoft Windows Driver Kit (freely available from the linked Microsoft site) has extensive documentation and examples on writing printer drivers. You can check the online printer driver page of the DDK docs before downloading it.
Edit: One commercial alternative that would probably be much quicker to deploy is VeryPDF's DocumentPrinter. It's rather pricy (currently $1500 for a developer license, $399 for a server license), but from what I've heard their support is rather good so if the price is tenable for you this may be a good option.
There's also a SDK from DirectConvert, but I couldn't find any pricing info and don't know anything about them.
Depending on your usage patterns, another option would be something like TechSmith SnagIt, which has printer capture facilities available. This is not a SDK, though.
Create a raster print driver using the Windows DDK. The sample they provide will do just fine. This will generate bitmaps, which can then be converted to TIFF using LibTiff. Your OEMSendPage function is where you'll want to convert the bitmap to TIFF and save it. If you're unfamiliar with the DDK and Windows print drivers, expect to spend quite a bit of time on this.
I have source for a driver I used to sell that does exactly what you want, but I stopped maintaining it after NT 4 so it's seriously out of date and would require some significant work to make it useful on modern Windows platforms.

Resources