The question and answer __linux of Linux print driver

Source: Internet
Author: User

First wave

> 1>. Through the above demo know, this is suitable for HP printer, then I want to use the Epson printer, want to use Ijsgutenprint, here also requires the transplant gutenprint,

Yes, it is. Need to transplant gutenprint.

> So here, gutenprint compilation only needs ijsgutenprint, or what other files (as I understand it requires other files, but do not know how other configuration files should be set).

is the need to compile gutenprint on it.

2>. When cups prints, it is found that a PPD file is generated when the printer is set up, what does the PPD file have to do with the printer driver?

It is because Cups has ppd,cups is a big housekeeper, all models it is managed, how to manage is to rely on PPD files. The PPD file determines who should be sent to the cups at each step.

3>. As I understand it, the printer driver, like Hpijs, Ijsgutenprint, is what the PPD file does when it prints.

Hpijs Ijsgutenprint is just the bucket of the whole drive. ppd file is applied in the Cups macro-control, such as the decision to call Hpijs or Ijsgutenprint at the last minute.

4>. Please order: $ gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "Hewlett-Packard"-sDeviceModel= " DeskJet 5550 "-r300x300-dnopause-dsafer-soutputfile="/dev/lp0./tiger.ps-c quit

The-sdevicemanufacturer-sdevicemodel is generated by what rules.

This is written in the Hpijs. As the Hpijs development time is relatively early, the new model driver does not, so for the use of the model "DeskJet 5550" is to try out.


20140926 MORE: Supplementary Netizen's question

Second Wave

Recently also want to implement the USB printer function on the exynos4412-linux3.5 platform, now have the conditions as follows: (1) HP HP Deskjet 1000 j110a color Inkjet printer (procurement, the machine has not yet arrived) (2) own statically compiled ghostscript-9.04 software and Hpijs software (3) 4412-linux development platform
        The compiler I use is the friendly arm of the arm-linux-gcc-4.5.1, support based on ARM v7 instruction set, the problem is as follows:   (1) I just need to implement it under Linux, Configuring the build kernel supports USB printers and automatically creates lp0 device files. The rest of the work is not to run the following command.         gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "Hewlett-Packard"- Sdevicemodel= "DeskJet 5550"-r300x300-dnopause-dsafer-soutputfile= "/dev/lp0"  /xxx/sample.ps-c quit Yes, Run directly on it. Note, however, that/xxx/sample.ps is the file to be printed. Don't think of it as part of a fixed command.         is it necessary to do some preparatory work before executing this command, such as creating a TMP directory, but there is a TMP directory directly under Linux, and some libraries need to be prepared. You are standard embedded Linux do not need to create these things, I am porting to non-standard Linux systems such as Android without the/tmp directory to create their own. (2) I plug in the USB printer directly in the Dev directory generated lp0 device node, not in the/DEV/USB directory generated, whether the same.      Well, this is the same, no matter where it's built. Own Mknod is also possible, the corresponding driver source code is the kernel of usblp.c this file in the kernel source code in some years did not update, I estimate. (3) The above command is not only for HP Deskjet 1000 j110a This printer, how other printers should fit. Hpijs Source has a file that describes all the printer models it supports, replacing-sdevicemodel. Then you will ask "DeskJet 5550" instead of "DeskJet 1000", because Hpijs is not maintained early, DeskJet 1000 is listed in recent years, the model can not be in the Hpijs. But are some new models, the old model of one try to try. :) (4) Now I just realize that with exyNos4412--linux platform to control the USB printer, the maintenance is the beginning (such as to achieve better print quality, etc.), then I should learn what information. Yes, it will compile and implement printing in fact, and on the PC so-called technical curtilage will configure the printer driver is the same, there is no deep technology, are the things that make perfect. But if you want to print well, you need to understand its principles. The printer language PDL is also called the page description language, which simply converts a fixed format (PDF or PS) file into a page description language for transmission to the printer, while the user is in a variety of formats such as txt word jpg png exl ppt, etc. How to deal with them as a "fixed format" is also the focus. Give some more keywords: PPI DPI PDL PPD CUPS POSTSCRIPT gutenprint ....
Enjoy it.

Third Wave

1. I use Linux3.5, then the USB printer subsystem under Linux is just the usblp.c source file you mentioned above. There's nothing else. The kernel does the job more simply by transferring "final data" to the printer. You can see from this link that it has been modified by the historical usblp.c. The kernel only provides this, the kernel doesn't care what type of printer you want to data, after all, it's just the kernel. It only does the function that everybody is universal.
2. I have a canon of mf4830d laser printer, plug in the Development Board after the console output this printer-related information. I want to ask is that these printer information is the Linux kernel itself, or plug in the USB interface by the printer to the printer and other information to the kernel, and then the kernel to identify and then output information. USB devices are introduced herself. There is a special print protocol in the USB protocol, the kernel is "No production information is just between the hardware and software porter." The difference between the models is by running SUDO/USR/LIB/CUPS/BACKEND/USB output information. And not the logo of the person who posted the printer. 3. So at the Linux kernel level, the USB printer driver only needs to usblp.c. Understand what this drive I will reap. Understand the knowledge that drives me. (Understand a frame first) I also did not fully understand, and do not need to understand the very mature things have not changed for many years; but it is also good to know, you can understand the kernel of USB communication implementation. Using the kernel's usblp.c is only because it is a channel, not an end, to transfer data to the printer. Using the LIBUSB (Application layer USB communication Library) direct transmission is the same, see the implementation of Hplip; it's the same with the USB host API in Android, see the USB print app in Google Play. Of course, I have some of the above schemes to achieve verification, local conditions are good. 4. From the above question, you can help me to sum up where I am in the lack of knowledge. Linux, for example, is driven by the kernel. or the USB protocol.
If the usblp.c is used, the kernel driver does not need any consideration. The USB protocol is also without any consideration. That's not the point. The emphasis is on "How to handle printing data at the application layer." More search in the previous article mentioned that a few keywords is good, that is the application layer printing related. But also suggest what problems to find a solution is also good, after all, do not use to understand, there will be no purpose.


20141010 MORE:

4th wave:

Hello, some time ago based on your ideas to achieve the Arm-linux platform under the USB printer, the use of a Gs-hpijs, printer for deskjet1000. Very interested in this piece, once again to consult a few questions:

1. A general understanding of the Linux print system, as long as the Linux kernel supports the USB Print communication protocol, and then use the print system Cups→gs→hpijs can be entered on the command line to print the command, the problem is that three software has been ported, And only use the GS and Hpijs can achieve command line printing, and cups do not know how to call the GS software, also do not know how to use, please guide twos. (only presumably the GS through the Ijs interface calls Hpijs)

This is used to refer to the previous "PPD file", you need to add "printer" to cups, the process of specifying PPD files (included in the Hpijs source code), so you can use the generic lpr xxx.ps command to print. The cups automatically executes the print commands that were manually executed before they were invoked in the PPD file.

2. Hpijs is for HP inkjet printer driver, if I want to implement Epson, Canon printer on Arm-linux platform, is it still possible to use GS--XXX scheme, this xxx can be other drive.

Gutenprint contains a ijsgutenprint and Hpijs similar ijs based implementation that supports various vendor 70% printer models available on the market.

3. The command line when printing, is the PS format file to/dev/lp0, if you want to print commonly used txt, JPG and other formats of the file, should be txt, JPG files first converted to PS format files, and then use the command line to print, you can use GS software conversion it. Do not know how to convert, without a little thought, please remind.

PS format is relatively original intermediate format, GS also support the PDF format as an intermediate format, txt,jpg and other format files converted to PDF is relatively easy. The whole idea is to use other libraries or tools to convert common format such as txt,jpg and so on to PDF, and then to the GS processing is good.

4. I want to understand, but only to see the GS and Hpijs software source code in the documentation, need to see the GS and Hpijs software code. How to strike.

These open source project is very mature, the individual present view is to be able to use just fine.



There are still a few things here:

Embedded Linux Development Board:

-dfirstpage=2-dlastpage=3

/system/usr/bin/gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "HEWLETT-PACKARD"- Sdevicemodel= "DeskJet 5550"-r300x300-dnopause-dsafer-sstdout=%stderr-soutputfile= "/dev/lp0"/sdcard/ruler.pdf-c Quit

/system/usr/bin/gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "HEWLETT-PACKARD"- Sdevicemodel= "DeskJet 5550"-r300x300-dnopause-dsafer-sstdout=%stderr-soutputfile=--</sdcard/ruler.pdf >/de V/lp0

/SYSTEM/USR/BIN/GS \

-sdevice=ijs \

-sijsserver=hpijs \

-DIJSUSEOUTPUTFD \

-sdevicemanufacturer= "Hewlett-Packard" \

-sdevicemodel= "DeskJet 5550" \

-R300X300 \

-dnopause \

-dsafer \

-sstdout=%stderr \

-soutputfile=--<

/sdcard/ruler.pdf \

>/dev/lp0

Android:

/system/usr/bin/gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "HEWLETT-PACKARD"- Sdevicemodel= "DeskJet 5550"-r300x300-dnopause-dsafer-sstdout=%stderr-soutputfile= "/dev/usb/lp0"/mnt/external_sd /chinese.pdf-c quit

Gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "Hewlett-Packard"-sDeviceModel= "DeskJet 5550 "-r300x300-dnopause-dsafer-sstdout=%stderr-soutputfile=--</mnt/external_sd/chinese.pdf >/dev/usb/lp0

Pc:

/system/usr/bin/gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "HEWLETT-PACKARD"- Sdevicemodel= "DeskJet 5550"-r300x300-dnopause-dsafer-soutputfile= "/dev/usb/lp0"/home/kangear/work/printer/res/ Ruler/ruler.pdf-c quit

Gs-sdevice=ijs-sijsserver=hpijs-dijsuseoutputfd-sdevicemanufacturer= "Hewlett-Packard"-sDeviceModel= "DeskJet 5550 "-r300x300-dnopause-dsafer-sstdout=%stderr-soutputfile=%stdout ~/helloworld.pdf-c quit > HelloWorld.PCL3GUI


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.