Writing printer driver
Select Check for updates at the top of the page. Select Driver updates if available. Need more help? Join the discussion. Was this information helpful? Yes No. Thank you! Any more feedback? The more you tell us the more we can help. Can you help us improve? Resolved my issue. Clear instructions.
Easy to follow. No jargon. Call the first if your driver contains auxiliary programs to be executed by normal users. The third you should use if you ship man pages. Before executing the commands in the build section, the following environment variables are set:.
Stock RPM does not provide this macro. They will be available in the ppd subdirectory of the source tree. It sets all important system directories using the RPM macros via the command line. This is a macro of stock RPM. The printer driver packages usually provide simply the software to make a certain class of printers and multi-function devices work.
They do not supply libraries which can be used by other programs. So they do not need to ship C headers, static libraries, or pkgconfig files. It must contain a comma-separated list of all executable names. In addition, the NickNames of the PPDs are modified to contain standardized information about manufacturer, model, driver name and version, supplier, and LSB version.
So these links are set by the post-install andremoved by the pre-uninstall scripts using the LSB tools. Command which should only be executed during an update and not during a removal of the package should be bracketed by these two. This way it is assured that the paths for executables and man pages are set for the programs of this package being used when a login shell is started. This macro does not symlink the PPD files. Updates PPD files of already existing local print queues which are using the driver supplied with this package.
This assures that if the PPDs change in the new driver version for example added or removed options or choices that also already set up printers get the updated PPD files. Sets up system services coming with this package to be started at boot. With this macro all services of this package are restarted. These two macros bracket steps not to be done on an RPM update. This has to be done on things removing infrastructure, as on an update RPM runs the post-install of the new package before the uninstall scripts of the old package, which makes the stuff set up by the post-install removed again.
So a clean removal of the package is assured. Same as already shown for the pre-install script. Bracketed commands are not executed on an upgrade of RPM packages. Same as already shown for the post-install script. Contains a shared library with C headers and pkgconfig files, but simply the driver should be provided, not development sources.
Before a package gets released it should naturally be tested. Here are the recommended testing steps:. To do so you simply call. If there are complaints about interfaces being used which are not provided by the LSB, take care that libraries providing these symbols get either statically linked or shipped with your package.
To do this, run the command. Also test the use of the PPD extensions. Use both the Qt and GTK versions of the dialog. Especially check whether option and choice names appear translated, the options are presented with the right widgets, appear under the desired tags, icons show up correctly, …. To test whether your driver package really works, install it in the LSB Build Environment chroot and also in real distributions.
Unfortunately, the chroot is not completely set up from RPMs, so most software which exists in the chroot does not exist in the RPM database of the chroot. So a simple RPM installation of your package will fail due to dependencies not being fulfilled.
To test actual printing out of the chroot, stop your system's CUPS daemon and then start the one inside the chroot. For testing in a real distribution installation of the package should work as described in the user instructions on the OpenPrinting web site. After having installed your package, try to set up print queues with the printer setup tools which come with the distribution.
Your driver should then appear as one of the possible choices, or it will be automatically selected by the tools if it is the only driver for the printer with which you are testing.
If your package ships CUPS backends, check whether tey appear under the device connection types in the setup tool and whether they detect your printer correctly.
Try to print from different applications and with different option settings, to see whether everything works as it should work. Try also if your driver's auxiliary programs work correctly.
They were used for generating the appropriate binary packages in the OpenPrinting database. To make your new packages auto-downloadable via the OpenPrinting web site, you usually do not upload them to the OpenPrinting web server. You sign the packages in the way the packages coming with Linux distributions get signed and you set up an RPM and a Debian package repository on your server.
Then you link to these repositories in a driver XML file a Foomatic XML file which will be added to the OpenPrinting database which you create for your driver later we will also give you the possibility to fill a web form instead of writing an XML file. The driver XML file will also hold information about the driver's license,.
It is also highly recommended to supply printer XML files for this there will be also a web form later for each printer, as they can carry the exact IEEE device ID for matching with auto-detection results, a driver recommendation, and a lot of information useful for the user who browses the OpenPrinting web site. Submit the XML files to us for review and import into the database and as soon as your entries are imported or beginning from a release date you supply to us users find your driver and printers on our web site or the driver gets even downloaded automatically when they plug in their printer.
Your files do not only need to get packaged but also put up on your download server as indexed package repositories, so that the package manager tools of the distributions yum, apt, zypper, … can easily download them and also automatically update them if you put up a newer version, for example a bug fix or security update. Make sure that you have installed lsb, rpm with rpmbuild , dpkg, fakeroot, alien, linux32 util-linux , ialibs, apt-utils apt-ftparchive , createrepo.
The package names are for Ubuntu and they are most probably the same names for Debian. If you use Ubuntu, please activate the Universe repository as some of the packages are in Universe.
On RPM-based distributions the names of the packages can be different. It is no problem to generate both RPMs and Debian packages on the same machine, only installing packages is only possible using one of the two systems depending on your machine's distribution. But you do not need to install any of your packages on the server. You start with RPM packages which you generate as described above. These packages must be arranged in directories similar as they are arranged when they are generated.
Architecture-independent packages, for example packages with only PPD files and perhaps also scripts PostScript printers go into noarch. Place the RPMs inside there and do not rename them. This looks more or less like this:. If you want to provide source RPMs as well, put them directly into an SRPMS subdirectory of your base directory, without subdirectories for architectures. Going to a URL like.
This is important so that our site can find your packages with links containing wildcards. Now your RPM repository is indexed and so it can get added to yum or zypper source repository lists on client machines. Then the RPM packages can be easily installed with yum or zypper and if you update packages they get updated on clients by the daily automatic update mechanism.
For adding your driver repository to zypper the user or the printer setup tool on the client has to run the following command:. You do not need to do anything for the clients to do this we take care about that but this data could be useful for you to test your archive.
Next step is converting the RPM packages into the Debian package format. This is rather complex as well as the indexing of the repositories, so we have prepared the mkrepodeb script with component repository assignment rules components. Also here you do not need to do anything for the clients to do this we take care about that but also this data could be useful for you to test your archive.
Very important : Avoid as much as possible to move your package repositories to another URL. Once, the links in our database would not work any more, but we can quickly fix this if you inform us in time or you can even fix this by yourself if we give you appropriate user rights.
Second, users whose package managers are configured for using your package repositories as download source will get error messages instead of automatic updates. To make sure that the auto-downloaded driver packages are really yours they need to get signed. In general Linux distributions do not let packages get automatically downloaded if they are not signed and the key not trusted by them. A printer driver should not rely on this; instead, it should return NULL.
A raster printer driver, for example, can use the BPicture objects for each page and draw them into a BBitmap object and convert the pixels in the BBitmap object into the format the printer understands. The driver can make changes to the content of the BPicture, including dithering and color correction. There is no standard or common code for these features in R5. When a printer driver is requested to print a print job it uses a transport add-on to transfer data to the printer.
Transport add-ons know how to write to an individual device parallel, USB, network, etc. Separating transports from drivers allows R5 to work with, for example, a printer on a USB port or the same printer on a parallel port with only one driver. It also makes writing the drivers simpler: the driver outputs a "stream" of data, without having to know how it is delivered.
To install a printer driver, the driver has to be moved into one of the printer driver folders. Printer drivers should not link to shared libraries other than those provided by the OS — third-party libraries should be statically linked instead.
This helps to avoid version conflicts. Users add a new printer to the system using the Printers preflet. They select a printer name , printer type , and transport add-on. The name of the transport add-on is stored in the spool folder's file attribute named transport. The function prototype within the printer driver for this is:.
This gives the printer driver the chance to open a window for configuration of the printer model. The configuration can be stored in the attributes of the spool folder. When you submit the print job, spooler generates the spool data in XPS format and sent it to your driver. Your driver process the driver and write out to the spooler or save it to file depends on the port configuration.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 12 years, 10 months ago. Active 1 month ago. Viewed 23k times.
I think there may be some interfaces that Windows provide to write printer drivers. A9S6 A9S6 6, 10 10 gold badges 48 48 silver badges 81 81 bronze badges. Did you figure out how to do it? Add a comment. Active Oldest Votes.
0コメント