![]() |
CAPS Universe documentation
1.0.4
All you need to know to be successful
|
ML-1640/ML-2240. Monochrome Laser Printer, second generation, SPL2 (aka 'QPDL') language. More...
Functions | |
| static void | samsung_ml1640_feature_selection_add (struct caps_ppd_selection *selection) |
| static void | samsung_ml1640_options_add (struct caps_ppd_option *option, size_t entries) |
| static ssize_t | samsung_spl2_selection_entry_get (const struct caps_ppd_selection_entry *selection_list, size_t selection_cnt, const char *entry) |
| static void | samsung_spl2_adapt_paper_type (struct caps_drv *drvi) |
| static void | samsung_spl2_adapt_jam_recovery (struct caps_drv *drvi, struct spl2_drv *info) |
| static void | samsung_spl2_adapt_econo_mode (struct caps_drv *drvi) |
| static void | samsung_spl2_adapt_powersave (struct caps_drv *drvi) |
| static void | samsung_spl2_adapt_altitude (struct caps_drv *drvi, struct spl2_drv *info) |
| static void | samsung_spl2_adapt_paper_name (struct caps_drv *drvi) |
| static unsigned | samsung_spl2_opc_width (struct caps_drv *drvi, const char *key) |
| static void | samsung_spl2_opc_default (unsigned dflt, unsigned res, const char *key) |
| static void | samsung_spl2_adapt_resolution (struct caps_drv *drvi, struct spl2_drv *info) |
| int | printer_driver_module_init (struct caps_drv *drvi, struct spl2_drv *info) |
| int | printer_driver_runtime_adaptions (struct caps_drv *drvi, struct spl2_drv *info) |
| static enum format_type | samsung_ml1640_paper_format_assign (const char *paper_name) |
| static void | drv_spl2_pjl_header_create (FILE *prn_stream, const struct spl2_drv *info) |
| static void | drv_spl2_pjl_footer_create (FILE *prn_stream) |
| static int | ml1640_driver_job_setup (struct caps_drv *drvi, void *d) |
| static int | ml1640_driver_page_setup (struct caps_drv *drvi, void *d) |
| static int | ml1640_driver_job_finish (struct caps_drv *drvi, void *d) |
Variables | |
| static size_t | samsung_ml1640_features_selections_count = 0 |
| static struct caps_ppd_selection * | samsung_ml1640_features_selections [3] |
| static size_t | samsung_ml1640_options_count = 0 |
| static struct caps_ppd_option | samsung_ml1640_options [3] |
| static const struct caps_ppd_selection_entry | samsung_spl2_paper_type_selections [] |
| static struct caps_ppd_selection | drv_spl2_media_type_selection |
| static const struct caps_ppd_selection_entry | samsung_spl2_econo_mode_selections [] |
| static struct caps_ppd_selection | samsung_spl2_econo_mode_selection |
| static const struct caps_ppd_selection_entry | samsung_spl2_powersave_selections [] |
| static struct caps_ppd_selection | samsung_spl2_powersave_selection |
| static const struct caps_ppd_media_size | samsung_ml1640_printable_media |
| static const struct caps_ppd_media_margins | samsung_ml1640_printable_margins |
| static struct caps_ppd_base | samsung_ml1640_features |
| const struct caps_generic_driver | caps_spl2_driver |
This driver creates wire data in the format SPL2 (Samsung Printer Language 2) aka 'QPDL' (e.g. Quick Page Description Language). It supports the ML-1640 and ML-2240 monochrome laser printer.
|
static |
|
static |
|
static |
Search for a specific selection name (via .option)
| [in] | selection_list | The list to search in |
| [in] | selection_cnt | Entries in the selection list |
| [in] | entry | The entry to search for, or negative index if not found |
|
static |
Handle default paper type (like 'plain' or 'label')
| [in] | drvi | The framework handle |
Setup the paper type if only one paper is provided (due to single input tray) If not set, a list of supprted media types are included into the PPD and the user must select one
|
static |
Setup the 'paper jam recovery' setting for the printer
| [in] | drvi | The framework handle |
| [in,out] | info | Our private data |
|
static |
Setup the PPD's default for the economic setting
| [in] | drvi | The framework handle |
|
static |
Setup the 'power saving' setting for the printer
| [in] | drvi | The framework handle |
Setup the 'altitude' setting for the printer
| [in] | drvi | The framework handle |
| [in] | info | Our private data |
It's unclear what the values LOW and HIGH mean. The manual states "Printing is possible below 1000 m".
|
static |
Setup the paper format which is fed into the printer
| [in] | drvi | The framework handle |
The user can set in the [paper].format INI entry the loaded paper. The used paper format name must be one of the paper format names known by 'libpaper'. The user can refer 'man paperconf' or 'paperconf -a' for the available format names.
|
static |
Extract an integer from the INI settings set
| [in] | drvi | The framework handle |
| [in] | key | The key variable to extract its value |
| Positive | Extracted value |
| 0 | Key not available or invalid value |
|
static |
Just emit a warning about undefined OPC width
| [in] | dflt | The default value for the print head's dot count |
| [in] | res | The resolution value dflt is for |
| [in] | key | The keyname a user should define instead |
Just convenience to avoid code duplication.
Setup the resolutions the printer is capable to print
| [in] | drvi | The framework handle |
| [in,out] | info | Our driver info |
Three resolutions are known, but not supported by all printers:
Here the supported resolutions are enabled based on INI file settings.
Printer driver specific initialisation, in contrast to the generic spl2_driver_module_init()
Called by the generic spl2_driver_module_init().
Printer driver specific run-time adaptions, in contrast to the generic spl2_driver_runtime_adaptions()
Called by the generic spl2_driver_runtime_adaptions().
|
static |
Assign an SPL2 protocol specific value for the paper format
| [in] | paper_name | Paper type as a word |
| type | Paper type (one value from #paper_type) |
| SPL_CUSTOM_TYPE | on error (e.g. unknown paper type) |
The original Samsung driver lists these paper names: Letter, Legal, A4, Executive, Folio, JB5/JIS B5, B5-ISO/ISO B5, A5, COM10/No.10 Env., Monarch, DL/DL Env., C5/C5 Env., C6/C6 Env., A6/A6, Oficio,
|
static |
Send a jobs header, e.g. signal the printer a new print job starts
| [in] | prn_stream | The stream to send the data to |
| [in] | info | Job and printer info |
The strings sent here do not matter it seems. The printer works even if strings are sent, which do not match the corresponding printer. For example for the ML1640 the original Samsung driver does not send the "DUPLEX" value, but sending it even to the ML1640 (which does not have a duplex unit) does not hurt and it is printing the page. And the Samsung driver sends a "line feed" after each line, but for the last line it sends a "carriage return" and "line feed". But also here, it works with "line feed" for all lines.
For the ML1640 printer the original Samsung driver only sends these entries: "@PJL SET PAPERTYPE = OFF" "@PJL SET JAMRECOVERY = OFF" "@PJL DEFAULT POWERSAVE = ON" "@PJL DEFAULT POWERSAVETIME = 5" "@PJL SET ALTITUDE = LOW" "@PJL DEFAULT SERVICEDATE = 20190817" "@PJL ENTER LANGUAGE = QPDL"
There are examples out, were the job's owner is also reported to the printer. Why? To encode this information more or less invisible to the printed paper? So, do not report the printing job's owner to the printer's firmware! The same is valid for the date!
|
static |
Send a job's footer, e.g. signal the printer the current print is done
| [in] | prn_stream | The stream to send the data to |
The leading tab char signals a 0x09 (=JOB_TERMINATE) record type to the printer and let its interpreter stop and return into the PJL mode.
|
static |
Setup internal info for the new job and send a corresponding header to the printer device
| [in] | drvi | The framework handle |
| [in] | d | Our private data |
| 0 | On success |
| -EINVAL | If this job cannot be printed |
With an injected job there is no connected PPD, all settings fall back to their defaults in this case
Up to a width of 204 mm there is no real margin required since the OPC drum covers the full width
Letter (216 mm) has a hard left margin of about 6 mm
A4 (210 mm) has a hard left margin of about 3 mm. No! 6 mm as well Everything starts with an offset of 6 mm, but the start position moves with the SPL_*_TYPE sent to the printer. E.g. with SPL_LETTER_TYPE the start moves about 3 mm to left compared to SPL_DINA4_TYPE, but still 6 mm away from the left Letter paper egde. Same for SPL_DINA4_TYPE. Thus, there is no full compensation possible for media wider than about 204 mm, but for smaller media this offset can be compensated.
Refer Mechanical Restrictions for details.
|
static |
Setup the next page to rasterize
| [in] | drvi | The framework handle |
| [in] | d | Our private data |
| 0 | On success |
| -EINVAL | If this job cannot be printed |
The setup is constant over the whole print job.
|
static |
The job is done somehow, free resources
| [in] | drvi | The framework handle |
| [in] | d | Our private data |
| 0 | On success |
| -EINVAL | If this job cannot be printed |
|
static |
|
static |
|
static |
|
static |
|
static |
The printer can handle some various media differently. This list contains the known media types the printer firmware supports.
This value is used in the "@PJL SET PAPERTYPE = <name>" instruction.
|
static |
|
static |
Selection entries to control the ECO mode when printing
Corresponds to samsung_spl2_econo_mode_selection
|
static |
Handled in the printer's firmware via PJL command
This value is used in the "@PJL SET ECONOMODE = <Value>" instruction.
The default is "Use Printer Default" if not otherwise set in the INI file.
Used by samsung_spl2_adapt_econo_mode()
|
static |
Selection entries to control the power save feature when idling
Corresponds to samsung_spl2_powersave_selection
|
static |
Handled in the printer's firmware via PJL command
This value is used in the "@PJL DEFAULT POWERSAVETIME = <Value>" instruction.
Used by samsung_spl2_adapt_powersave()
|
static |
The input tray supports media up to 'letter'
|
static |
Special hardware margins for the ML-1640
left: about 4 mm (~1.41 pt) right: about 0.5 mm top: TBD bottom: TBD
Printer's margins:
The ML1640 has moveable paper guides at both long edges of the print medium. When moving the one paper guide, both guides move to inner or outer directions. Thus, the print medium is always centered in the printer tray.
It seems the OPC drum can print on a width of 210 mm, e.g. 4960 dots at 600 DPI. But it also seems, the OPC drum has an offset of 6 mm at the left paper edge. The first dot in a line sent to the printer gets printed 6 mm away from the edge of a Letter format paper. Sending 4960 dots in this case means, it can print to the right edge of this paper format without any margin.
Since A4 is 6 mm smaller than Letter, the first dot in a line sent to the printer gets printed 3 mm away from its left edge.
Thus, the margins are medium format dependend and not the same for all formats. At least for a widths less than 204 mm there is no reason for horizontal margins at all.
|
static |
| const struct caps_generic_driver caps_spl2_driver |