summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-08-11 15:55:26 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-08-17 13:38:48 +0200
commitc930c80f31a13c2aea907a0d8b4ec24271ca5276 (patch)
treeeeb9156f538401461593ced9154aa1f7f9251d72 /include
parentd447754cc9a6220df1b2f8395101b5d79adac9fe (diff)
downloadmupdf-c930c80f31a13c2aea907a0d8b4ec24271ca5276.tar.xz
Add PCL document writer.
Fix color PCL writing bugs introduced when making alpha channels in pixmaps optional.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/output-pcl.h60
-rw-r--r--include/mupdf/fitz/writer.h2
2 files changed, 23 insertions, 39 deletions
diff --git a/include/mupdf/fitz/output-pcl.h b/include/mupdf/fitz/output-pcl.h
index 7ca6948b..3d6a0336 100644
--- a/include/mupdf/fitz/output-pcl.h
+++ b/include/mupdf/fitz/output-pcl.h
@@ -36,12 +36,11 @@ struct fz_pcl_options_s
};
/*
- fz_pcl_preset: Retrieve a set of fz_pcl_options suitable for a given
- preset.
+ fz_pcl_preset: Initialize PCL option struct for a given preset.
- opts: pointer to options structure to populate.
+ Currently defined presets include:
- preset: Preset to fetch. Currently defined presets include:
+ generic Generic PCL printer
ljet4 HP DeskJet
dj500 HP DeskJet 500
fs600 Kyocera FS-600
@@ -54,53 +53,36 @@ struct fz_pcl_options_s
lj4d HP LaserJet 4d
lp2563b HP 2563B line printer
oce9050 Oce 9050 Line printer
-
- Throws exception on unknown preset.
*/
void fz_pcl_preset(fz_context *ctx, fz_pcl_options *opts, const char *preset);
/*
- fz_pcl_option: Set a given PCL option to a given value in the supplied
- options structure.
-
- opts: The option structure to modify,
-
- option: The option to change.
-
- val: The value that the option should be set to. Acceptable ranges of
- values depend on the option in question.
-
- Throws an exception on attempt to set an unknown option, or an illegal
- value.
-
- Currently defined options/values are as follows:
-
- spacing,0 No vertical spacing capability
- spacing,1 PCL 3 spacing (<ESC>*p+<n>Y)
- spacing,2 PCL 4 spacing (<ESC>*b<n>Y)
- spacing,3 PCL 5 spacing (<ESC>*b<n>Y and clear seed row)
- mode2,0 or 1 Disable/Enable mode 2 graphics compression
- mode3,0 or 1 Disable/Enable mode 3 graphics compression
- mode3,0 or 1 Disable/Enable mode 3 graphics compression
- eog_reset,0 or 1 End of graphics (<ESC>*rB) resets all parameters
- has_duplex,0 or 1 Duplex supported (<ESC>&l<duplex>S)
- has_papersize,0 or 1 Papersize setting supported (<ESC>&l<sizecode>A)
- has_copies,0 or 1 Number of copies supported (<ESC>&l<copies>X)
- is_ljet4pjl,0 or 1 Disable/Enable HP 4PJL model-specific output
- is_oce9050,0 or 1 Disable/Enable Oce 9050 model-specific output
+ fz_parse_pcl_options: Parse PCL options.
+
+ Currently defined options and values are as follows:
+
+ preset=X Either "generic" or one of the presets as for fz_pcl_preset.
+ spacing=0 No vertical spacing capability
+ spacing=1 PCL 3 spacing (<ESC>*p+<n>Y)
+ spacing=2 PCL 4 spacing (<ESC>*b<n>Y)
+ spacing=3 PCL 5 spacing (<ESC>*b<n>Y and clear seed row)
+ mode2 Disable/Enable mode 2 graphics compression
+ mode3 Disable/Enable mode 3 graphics compression
+ eog_reset End of graphics (<ESC>*rB) resets all parameters
+ has_duplex Duplex supported (<ESC>&l<duplex>S)
+ has_papersize Papersize setting supported (<ESC>&l<sizecode>A)
+ has_copies Number of copies supported (<ESC>&l<copies>X)
+ is_ljet4pjl Disable/Enable HP 4PJL model-specific output
+ is_oce9050 Disable/Enable Oce 9050 model-specific output
*/
-void fz_pcl_option(fz_context *ctx, fz_pcl_options *opts, const char *option, int val);
+fz_pcl_options *fz_parse_pcl_options(fz_context *ctx, fz_pcl_options *opts, const char *args);
fz_band_writer *fz_new_mono_pcl_band_writer(fz_context *ctx, fz_output *out, const fz_pcl_options *options);
-
void fz_write_bitmap_as_pcl(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, const fz_pcl_options *pcl);
-
void fz_save_bitmap_as_pcl(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, const fz_pcl_options *pcl);
fz_band_writer *fz_new_color_pcl_band_writer(fz_context *ctx, fz_output *out, const fz_pcl_options *options);
-
void fz_write_pixmap_as_pcl(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pcl_options *pcl);
-
void fz_save_pixmap_as_pcl(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pcl_options *pcl);
#endif
diff --git a/include/mupdf/fitz/writer.h b/include/mupdf/fitz/writer.h
index 3f534783..dcf55bab 100644
--- a/include/mupdf/fitz/writer.h
+++ b/include/mupdf/fitz/writer.h
@@ -96,6 +96,7 @@ fz_document_writer *fz_new_svg_writer(fz_context *ctx, const char *path, const c
fz_document_writer *fz_new_text_writer(fz_context *ctx, const char *format, const char *path, const char *options);
+fz_document_writer *fz_new_pcl_writer(fz_context *ctx, const char *path, const char *options);
fz_document_writer *fz_new_pwg_writer(fz_context *ctx, const char *path, const char *options);
fz_document_writer *fz_new_cbz_writer(fz_context *ctx, const char *path, const char *options);
@@ -149,6 +150,7 @@ fz_document_writer *fz_new_pixmap_writer(fz_context *ctx, const char *path, cons
extern const char *fz_pdf_write_options_usage;
extern const char *fz_svg_write_options_usage;
+extern const char *fz_pcl_write_options_usage;
extern const char *fz_pwg_write_options_usage;
#endif