This document is supposed to be a short guide of adding paged output to NetSurf. Currently the two pieces of code using the print implementation are PDF export and GTK printing.
The first thing the new paged output has to do is implementing the printer interface located in printer.h. It consists of four elements:
The provided print interface consists of a set of functions which can be used seperately and one integrating them all making the print a matter of one call. If it is enough you can just call print_basic_run and wait for it to return. However, for the case you can't accompish the printing task this way the print interface gives you the possiblity of calling the print steps individually.
Only if you are using print_basic_run you can omit specifying the print settings. If this is the case the default ones will be used.
As you will notice the functions correspond to those you had to implement in the printer. The reason for this is adding some flexibility to the system which occured necessary i.e in the GTK print implementation.
This is where the besic information about the print job is held. You can use one of the predifined sets(DEFAULT and OPTIONS) or add your own. In order to do that you have to follow this steps:
| NetSurf Code Documentation | |
|---|---|
| Organization and Conventions | |
| Features |
|
| Platform-specifics | |
| References | |