[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1716-gb2c1bea
[email protected] (Ken Sharp) Tue, 8 Oct 2019 14:01:52 +0000 (UTC)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via b2c1beac237865bde26c7fa921d24d17ecda6fab (commit)
via faef233630240edfc3ad9f5ea154b5b32ed51c75 (commit)
via 21a10f9e2cb9134c351fd568fc73222f2917e159 (commit)
from 61c489110685f7cab8cbbbca7b15d9b5cb2463d0 (commit)
----------------------------------------------------------------------
commit b2c1beac237865bde26c7fa921d24d17ecda6fab
Author: Ken Sharp <[email protected]>
Date: Mon Oct 7 00:02:27 2019 +0100
pdfwrite - preserve rendering intent
bug #701487 "Renedring intent not preserved by pdfwrite"
The pdfwrite device was not previously handling rendering intent changes
this commit adds a rendering_intent member to the pdfwrite device
structure, initialises it to 1 (absolute colorimetric) and then tracks
changes to the graphics state, emitting /RI entries in ExtGSatet
dictionaries as required.
This shows a number of small progressions in the test suite, and marked
progressions with icc_v4_profile.pdf and icc_rendering_intent.pdf.
diff --git a/devices/vector/gdevpdfb.h b/devices/vector/gdevpdfb.h
index d000ee9..a47fec8 100644
--- a/devices/vector/gdevpdfb.h
+++ b/devices/vector/gdevpdfb.h
@@ -162,6 +162,7 @@ const gx_device_pdf PDF_DEVICE_IDENT =
{-1, -1}, /* page_dsc_info */
0 /*false*/, /* fill_overprint */
0 /*false*/, /* stroke_overprint */
+ 1 /* Absolute Colorimetric */, /* rendering intent */
0 /*false*/, /* remap_fill_coilor */
0 /*false*/, /* remap_stroke_coilor */
0, /* overprint_mode */
diff --git a/devices/vector/gdevpdfg.c b/devices/vector/gdevpdfg.c
index b1109e4..0050aba 100644
--- a/devices/vector/gdevpdfg.c
+++ b/devices/vector/gdevpdfg.c
@@ -3150,12 +3150,29 @@ pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text)
if (code < 0)
return code;
+ if (pdev->rendering_intent != pgs->renderingintent && !pdev->ForOPDFRead) {
+ static const char *const ri_names[] = { "Perceptual", "RelativeColorimetric", "Saturation", "AbsoluteColorimetric" };
+ char buf[32];
+
+ code = pdf_open_gstate(pdev, &pres);
+ if (code < 0)
+ return code;
+
+ buf[0] = '/';
+ strncpy(buf + 1, ri_names[pgs->renderingintent], sizeof(buf) - 2);
+ code = cos_dict_put_string_copy(resource_dict(pres), "/RI", buf);
+ if (code < 0)
+ return code;
+ pdev->rendering_intent = pgs->renderingintent;
+ }
+
/* Update overprint. */
if (pdev->params.PreserveOverprintSettings &&
(pdev->fill_overprint != pgs->overprint ||
pdev->font3) && !pdev->skip_colors
) {
- code = pdf_open_gstate(pdev, &pres);
+ if (pres == 0)
+ code = pdf_open_gstate(pdev, &pres);
if (code < 0)
return code;
/* PDF 1.2 only has a single overprint setting. */
@@ -3198,12 +3215,28 @@ pdf_try_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text)
if (code < 0)
return code;
+ if (pdev->rendering_intent != pgs->renderingintent && !pdev->ForOPDFRead) {
+ static const char *const ri_names[] = { "Perceptual", "RelativeColorimetric", "Saturation", "AbsoluteColorimetric" };
+ char buf[32];
+
+ code = pdf_open_gstate(pdev, &pres);
+ if (code < 0)
+ return code;
+
+ buf[0] = '/';
+ strncpy(buf + 1, ri_names[pgs->renderingintent], sizeof(buf) - 2);
+ code = cos_dict_put_string_copy(resource_dict(pres), "/RI", buf);
+ if (code < 0)
+ return code;
+ pdev->rendering_intent = pgs->renderingintent;
+ }
/* Update overprint, stroke adjustment. */
if (pdev->params.PreserveOverprintSettings &&
pdev->stroke_overprint != pgs->overprint &&
!pdev->skip_colors
) {
- code = pdf_open_gstate(pdev, &pres);
+ if (pres == 0)
+ code = pdf_open_gstate(pdev, &pres);
if (code < 0)
return code;
code = cos_dict_put_c_key_bool(resource_dict(pres), "/OP", pgs->overprint);
diff --git a/devices/vector/gdevpdfx.h b/devices/vector/gdevpdfx.h
index b7e0048..f42d9f1 100644
--- a/devices/vector/gdevpdfx.h
+++ b/devices/vector/gdevpdfx.h
@@ -618,6 +618,7 @@ struct gx_device_pdf_s {
pdf_page_dsc_info_t page_dsc_info; /* current page */
/* Additional graphics state */
bool fill_overprint, stroke_overprint;
+ int rendering_intent;
bool remap_fill_color, remap_stroke_color;
int overprint_mode;
gs_id halftone_id;
----------------------------------------------------------------------
commit faef233630240edfc3ad9f5ea154b5b32ed51c75
Author: Ken Sharp <[email protected]>
Date: Sun Oct 6 17:42:53 2019 +0100
pdfwrite - Use CA and ca for text with transparency
Bug #701631 "pdfwrite: mishandling of alphas with Text render mode 2"
The problem is in both the PDF interpreter and pdfwrite. In the past
the PDF interpreter has never been able to create a fill+stroke
primitive, because PostScript doesn't support that. However we added
the ability for pdfwrite to maintain text rendering modes, for reasons
of quality, which breaks that assumption.
Although we added the stroke and fill constant alpha to the C graphics
state when we moved the PDF graphics state into the C graphics state,
nothing actually ever used them. Instead the PDF interpreter sets a
single 'opacity' alpha channel, based on whether the current operation
is a stroke or a fill. Because we could not emit a combined operation
this worked as we would set the opacity separately for each operation.
Of course for pdfwrite this doesn't work, and looking to the future
when the fill+stroke primitive is available in the graphics library,
we will need to do away with the opacity.alpha and properly use the
fill and stroke alphas stored in the graphics state. For now, however,
we need to continue to use the opacity.alpha, but when we are handling
text (in pdfwrite) actually use the values of stroke and fill alpha
instead of opacity.alpha.
So add a 'for_text' boolean to all the routines whihch need to set or
update the alpha, and when writing the ExtGState, if we are handling
text then use CA and ca instead of opacity.alpha.
This has also mean altering the XPS interpreter so that it sets the
stroke and fill alphas as well as opacity.alpha, otherwise pdfwrite
doesn't know which value to use for text operations.
diff --git a/devices/vector/gdevpdfd.c b/devices/vector/gdevpdfd.c
index 28c6b01..5c8907c 100644
--- a/devices/vector/gdevpdfd.c
+++ b/devices/vector/gdevpdfd.c
@@ -846,7 +846,7 @@ prepare_fill_with_clip(gx_device_pdf *pdev, const gs_gstate * pgs,
if (code < 0)
return code;
}
- code = pdf_prepare_fill(pdev, pgs);
+ code = pdf_prepare_fill(pdev, pgs, false);
if (code < 0)
return code;
return pdf_put_clip_path(pdev, pcpath);
@@ -1743,7 +1743,7 @@ gdev_pdf_stroke_path(gx_device * dev, const gs_gstate * pgs,
code = pdf_open_page(pdev, PDF_IN_STREAM);
if (code < 0)
return code;
- code = pdf_prepare_stroke(pdev, pgs);
+ code = pdf_prepare_stroke(pdev, pgs, false);
if (code == gs_error_rangecheck) {
/* Fallback to the default implermentation for handling
a transparency with CompatibilityLevel<=1.3 . */
diff --git a/devices/vector/gdevpdfg.c b/devices/vector/gdevpdfg.c
index bd06b9f..b1109e4 100644
--- a/devices/vector/gdevpdfg.c
+++ b/devices/vector/gdevpdfg.c
@@ -2869,7 +2869,7 @@ pdf_update_transfer(gx_device_pdf *pdev, const gs_gstate *pgs,
*/
static int
pdf_update_alpha(gx_device_pdf *pdev, const gs_gstate *pgs,
- pdf_resource_t **ppres)
+ pdf_resource_t **ppres, bool for_text)
{
bool ais;
double alpha;
@@ -2933,12 +2933,19 @@ pdf_update_alpha(gx_device_pdf *pdev, const gs_gstate *pgs,
code = cos_dict_put_c_key_bool(resource_dict(*ppres), "/AIS", ais);
if (code < 0)
return code;
+ if (!for_text) {
/* we never do the 'both' operations (b, B, b*, B*) so we set both */
/* CA and ca the same so that we stay in sync with state.*.alpha */
code = cos_dict_put_c_key_real(resource_dict(*ppres), "/CA", alpha);
if (code < 0)
return code;
return cos_dict_put_c_key_real(resource_dict(*ppres), "/ca", alpha);
+ } else {
+ code = cos_dict_put_c_key_real(resource_dict(*ppres), "/CA", pgs->strokeconstantalpha);
+ if (code < 0)
+ return code;
+ return cos_dict_put_c_key_real(resource_dict(*ppres), "/ca", pgs->fillconstantalpha);
+ }
}
/*
@@ -2946,7 +2953,7 @@ pdf_update_alpha(gx_device_pdf *pdev, const gs_gstate *pgs,
*/
int
pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs,
- pdf_resource_t **ppres)
+ pdf_resource_t **ppres, bool for_text)
{
int code = 0;
int bottom;
@@ -2966,7 +2973,7 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs,
return code;
pdev->state.blend_mode = pgs->blend_mode;
}
- code = pdf_update_alpha(pdev, pgs, ppres);
+ code = pdf_update_alpha(pdev, pgs, ppres, for_text);
if (code < 0)
return code;
} else {
@@ -3136,10 +3143,10 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs,
/* Update the graphics state for filling. */
int
-pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs)
+pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text)
{
pdf_resource_t *pres = 0;
- int code = pdf_prepare_drawing(pdev, pgs, &pres);
+ int code = pdf_prepare_drawing(pdev, pgs, &pres, for_text);
if (code < 0)
return code;
@@ -3167,27 +3174,27 @@ pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs)
return pdf_end_gstate(pdev, pres);
}
int
-pdf_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs)
+pdf_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text)
{
int code;
if (pdev->context != PDF_IN_STREAM) {
- code = pdf_try_prepare_fill(pdev, pgs);
+ code = pdf_try_prepare_fill(pdev, pgs, for_text);
if (code != gs_error_interrupt) /* See pdf_open_gstate */
return code;
code = pdf_open_contents(pdev, PDF_IN_STREAM);
if (code < 0)
return code;
}
- return pdf_try_prepare_fill(pdev, pgs);
+ return pdf_try_prepare_fill(pdev, pgs, for_text);
}
/* Update the graphics state for stroking. */
static int
-pdf_try_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs)
+pdf_try_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text)
{
pdf_resource_t *pres = 0;
- int code = pdf_prepare_drawing(pdev, pgs, &pres);
+ int code = pdf_prepare_drawing(pdev, pgs, &pres, for_text);
if (code < 0)
return code;
@@ -3225,19 +3232,19 @@ pdf_try_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs)
return pdf_end_gstate(pdev, pres);
}
int
-pdf_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs)
+pdf_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text)
{
int code;
if (pdev->context != PDF_IN_STREAM) {
- code = pdf_try_prepare_stroke(pdev, pgs);
+ code = pdf_try_prepare_stroke(pdev, pgs, for_text);
if (code != gs_error_interrupt) /* See pdf_open_gstate */
return code;
code = pdf_open_contents(pdev, PDF_IN_STREAM);
if (code < 0)
return code;
}
- return pdf_try_prepare_stroke(pdev, pgs);
+ return pdf_try_prepare_stroke(pdev, pgs, for_text);
}
/* Update the graphics state for an image other than an ImageType 1 mask. */
@@ -3248,7 +3255,7 @@ pdf_prepare_image(gx_device_pdf *pdev, const gs_gstate *pgs)
* As it turns out, this requires updating the same parameters as for
* filling.
*/
- return pdf_prepare_fill(pdev, pgs);
+ return pdf_prepare_fill(pdev, pgs, false);
}
/* Update the graphics state for an ImageType 1 mask. */
diff --git a/devices/vector/gdevpdfg.h b/devices/vector/gdevpdfg.h
index ffa7296..bd12676 100644
--- a/devices/vector/gdevpdfg.h
+++ b/devices/vector/gdevpdfg.h
@@ -150,10 +150,10 @@ int pdf_set_drawing_color(gx_device_pdf * pdev, const gs_gstate * pgs,
* Bring the graphics state up to date for a drawing operation.
* (Text uses either fill or stroke.)
*/
-int pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs);
-int pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs, pdf_resource_t **ppres);
-int pdf_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs);
-int pdf_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs);
+int pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text);
+int pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs, pdf_resource_t **ppres, bool for_text);
+int pdf_prepare_fill(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text);
+int pdf_prepare_stroke(gx_device_pdf *pdev, const gs_gstate *pgs, bool for_text);
int pdf_prepare_image(gx_device_pdf *pdev, const gs_gstate *pgs);
int pdf_prepare_imagemask(gx_device_pdf *pdev, const gs_gstate *pgs,
const gx_drawing_color *pdcolor);
diff --git a/devices/vector/gdevpdft.c b/devices/vector/gdevpdft.c
index e8fb227..46f4d31 100644
--- a/devices/vector/gdevpdft.c
+++ b/devices/vector/gdevpdft.c
@@ -200,7 +200,7 @@ pdf_begin_transparency_group(gs_gstate * pgs, gx_device_pdf * pdev,
pdf_resource_t *pres, *pres_gstate = NULL;
cos_dict_t *pcd = NULL, *pcd_Resources = NULL;
- code = pdf_prepare_drawing(pdev, pgs, &pres_gstate);
+ code = pdf_prepare_drawing(pdev, pgs, &pres_gstate, false);
if (code < 0)
return code;
code = pdf_end_gstate(pdev, pres_gstate);
@@ -282,7 +282,7 @@ pdf_begin_transparency_mask(gs_gstate * pgs, gx_device_pdf * pdev,
* changed, and so doesn't write out the GState
*/
pgs->soft_mask_id = 0;
- code = pdf_prepare_drawing(pdev, pgs, &pres);
+ code = pdf_prepare_drawing(pdev, pgs, &pres, false);
if (code == gs_error_interrupt) {
/* Not in an appropriate context, ignore it but restore
* the old soft_mask_id. Not sure this is correct, but it works for now.
diff --git a/devices/vector/gdevpdts.c b/devices/vector/gdevpdts.c
index 8fba908..055aeb4 100644
--- a/devices/vector/gdevpdts.c
+++ b/devices/vector/gdevpdts.c
@@ -815,7 +815,7 @@ int pdf_set_PaintType0_params (gx_device_pdf *pdev, gs_gstate *pgs, float size,
if (code < 0)
return code;
if (pdev->text->text_state->in.render_mode == ptsv->render_mode){
- code = pdf_prepare_stroke(pdev, pgs);
+ code = pdf_prepare_stroke(pdev, pgs, false);
if (code >= 0)
code = gdev_vector_prepare_stroke((gx_device_vector *)pdev,
pgs, NULL, NULL, 1);
diff --git a/devices/vector/gdevpdtt.c b/devices/vector/gdevpdtt.c
index 2c571de..f248e99 100644
--- a/devices/vector/gdevpdtt.c
+++ b/devices/vector/gdevpdtt.c
@@ -416,7 +416,7 @@ pdf_prepare_text_drawing(gx_device_pdf *const pdev, gs_text_enum_t *pte)
code = 0;
if (code < 0)
return code;
- code = pdf_prepare_fill(pdev, pgs);
+ code = pdf_prepare_fill(pdev, pgs, true);
if (code < 0)
return code;
}
@@ -2535,7 +2535,7 @@ pdf_set_text_process_state(gx_device_pdf *pdev,
if (code < 0)
return code;
- code = pdf_prepare_stroke(pdev, pgs);
+ code = pdf_prepare_stroke(pdev, pgs, true);
if (code >= 0) {
code = gdev_vector_prepare_stroke((gx_device_vector *)pdev,
pgs, NULL, NULL, 1);
diff --git a/xps/xpscolor.c b/xps/xpscolor.c
index 0076a8d..980a717 100644
--- a/xps/xpscolor.c
+++ b/xps/xpscolor.c
@@ -29,6 +29,8 @@ xps_set_color(xps_context_t *ctx, gs_color_space *cs, float *samples)
if (ctx->opacity_only)
{
gs_setopacityalpha(ctx->pgs, 1.0);
+ gs_setfillconstantalpha(ctx->pgs, 1.0);
+ gs_setstrokeconstantalpha(ctx->pgs, 1.0);
gs_setgray(ctx->pgs, samples[0]);
}
else
@@ -39,6 +41,8 @@ xps_set_color(xps_context_t *ctx, gs_color_space *cs, float *samples)
cc.paint.values[i] = samples[i + 1];
gs_setopacityalpha(ctx->pgs, samples[0]);
+ gs_setfillconstantalpha(ctx->pgs, samples[0]);
+ gs_setstrokeconstantalpha(ctx->pgs, samples[0]);
gs_setcolorspace(ctx->pgs, cs);
gs_setcolor(ctx->pgs, &cc);
}
diff --git a/xps/xpsimage.c b/xps/xpsimage.c
index 3b49602..94a8f5f 100644
--- a/xps/xpsimage.c
+++ b/xps/xpsimage.c
@@ -316,6 +316,8 @@ xps_paint_image_brush(xps_context_t *ctx, char *base_uri, xps_resource_t *dict,
/* You do not want the opacity to be used in the image soft mask filling */
gs_setopacityalpha(ctx->pgs, 1.0);
+ gs_setfillconstantalpha(ctx->pgs, 1.0);
+ gs_setstrokeconstantalpha(ctx->pgs, 1.0);
gs_trans_mask_params_init(¶ms, TRANSPARENCY_MASK_Luminosity);
gs_begin_transparency_mask(ctx->pgs, ¶ms, &bbox, 0);
code = xps_paint_image_brush_imp(ctx, image, 1);
diff --git a/xps/xpsopacity.c b/xps/xpsopacity.c
index 11ae52e..64e414b 100644
--- a/xps/xpsopacity.c
+++ b/xps/xpsopacity.c
@@ -79,6 +79,8 @@ xps_begin_opacity(xps_context_t *ctx, char *base_uri, xps_resource_t *dict,
opacity = atof(opacity_att);
gs_setblendmode(ctx->pgs, BLEND_MODE_Normal);
gs_setopacityalpha(ctx->pgs, opacity);
+ gs_setfillconstantalpha(ctx->pgs, opacity);
+ gs_setstrokeconstantalpha(ctx->pgs, opacity);
code = xps_bounds_in_user_space_path_clip(ctx, &bbox, use_path, is_stroke);
if (code < 0)
----------------------------------------------------------------------
commit 21a10f9e2cb9134c351fd568fc73222f2917e159
Author: Ken Sharp <[email protected]>
Date: Sat Oct 5 14:49:18 2019 +0100
PDF interpreter - Improve PreserveAnnots
PreserveAnnots currenlty works in conjunction with ShowAnnotTypes, but
We should really have a separate control for this.
This commit adds a new /PreserveAnnotTypses (must be set from PostScript
in the same way as ShowAnnotTypes). PreserveAnnots and PreserveAnnotTypes
only work with a device which can preserve Annotations (currently this
is the pdfwrite device only).
If the device supports Annotation preservation, and PreserveAnnots is
true (the default0 then for each annotation we consult the Types array,
if the annotation is to be preserved then we pass it to the device. If
not, then we pass the annotation to the 'draw' routines which will
render teh annotation instead.
Using the two separate controls allows us to selectively control, by
type, whther annotations are preserved, rendered, or simply ignored
altogether.
Also fix an omission, and some typos, in the documentation for
ShowAnnots in Use.htm
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
index a359a9c..c0805da 100644
--- a/Resource/Init/pdf_draw.ps
+++ b/Resource/Init/pdf_draw.ps
@@ -4748,6 +4748,25 @@ currentdict end readonly def
ifelse
} bind executeonly def
+/.PDFPreserveAnnotType?
+{
+ //false exch
+ /PreserveAnnotTypes where
+ {
+ /PreserveAnnotTypes get
+ {
+ dup /* eq exch 2 index eq or
+ {
+ pop //true exch
+ exit
+ } if
+ } forall
+ pop
+ }
+ {pop pop //true}
+ ifelse
+} bind executeonly def
+
/drawannot { % <annot> drawannot -
dup annotvisible {
gsave
@@ -5050,7 +5069,7 @@ currentdict end readonly def
gsave
dup dup /Subtype knownoget {
- dup //.PDFDrawAnnotType? exec
+ dup //.PDFPreserveAnnotType? exec
{
//preserveannottypes exch .knownget { exec } { //true } ifelse
{
@@ -5068,7 +5087,13 @@ currentdict end readonly def
}ifelse
} if
}
- {pop} ifelse
+ {
+ % Not preserving this type of annotation
+ % discard teh Subtype
+ pop
+ % copy the Annot dictionary and try drawing it instead
+ dup drawannot
+ } ifelse
% type known
} {
pop
diff --git a/doc/Use.htm b/doc/Use.htm
index 88c33c7..d85a0da 100644
--- a/doc/Use.htm
+++ b/doc/Use.htm
@@ -700,18 +700,18 @@ This option is also set by the <code>-dFitPage</code> option.</p>
<dl>
<dt><code>-dShowAnnots=false</code></dt>
<dd>
- Don't enumerate anntoations associated with the page objects through
- <code>Annots</code> attribute. Annotations are shown by default.</dd>
+ Don't enumerate annotations associated with the page
+ <code>Annots</code> key. Annotations are shown by default.</dd>
<p> In addition, finer control is available by defining an array
-<code>/ShowAnnotTypes</code>. Annoation types listed in this array will
+<code>/ShowAnnotTypes</code>. Annotation types listed in this array will
be drawn, whilst those not listed will not be drawn.</p>
<p> To use this feature:
-<code>-c "/ShowAnnotTypes [....]" -f <input file></code>
+<code>-c "/ShowAnnotTypes [....] def" -f <input file></code>
<br> Where the array can contain one or more of the following names:
<code>/Stamp</code>, <code>/Squiggly</code>, <code>/Underline</code>, <code>/Link</code>, <code>/Text</code>, <code>/Highlight</code>, <code>/Ink</code>, <code>/FreeText</code>, <code>/StrikeOut</code> and <code>/stamp_dict</code>.</p>
<p> For example, adding the follow to the command line:
-<code>-c "/ShowAnnotTypes [/Text /UnderLine]" -f <input file></code>
- <br> would draw only annoations with the subtypes "Text" and "UnderLine"</p>
+<code>-c "/ShowAnnotTypes [/Text /UnderLine] def" -f <input file></code>
+ <br> would draw only annotations with the subtypes "Text" and "UnderLine"</p>
</dl>
<dl>
diff --git a/doc/VectorDevices.htm b/doc/VectorDevices.htm
index acada95..e1d241b 100644
--- a/doc/VectorDevices.htm
+++ b/doc/VectorDevices.htm
@@ -771,6 +771,20 @@ to the old behaviour, or find that the new behaviour leads to problems, you can
inserted into the page content stream, instead of preserved as annotations.
</dd>
</dt>
+<d<p> In addition, finer control is available by defining an array
+<code>/PreserveAnnotTypes</code>. Annotation types listed in this array will
+be preserved, whilst those not listed will be drawn according to the setting os ShowAnnots and ShowAnnotTypes.
+By using the controls PreserveAnnots, PreserveAnnotTypes, ShowAnnots and ShowAnnotTypes it is possible to select
+by annotation type whether annotations are preserved as annotations, drawn into the page, or simply dropped.
+</p>
+<p> To use this feature:
+<code>-c "/PreserveAnnotTypes [....] def" -f <input file></code>
+<br> Where the array can contain one or more of the following names:
+<code>/Stamp</code>, <code>/Squiggly</code>, <code>/Underline</code>, <code>/Link</code>, <code>/Text</code>, <code>/Highlight</code>, <code>/Ink</code>, <code>/FreeText</code>, <code>/StrikeOut</code> and <code>/stamp_dict</code>.</p>
+<p> For example, adding the follow to the command line:
+<code>-c "/PreserveAnnotTypes [/Text /UnderLine] def" -f <input file></code>
+ <br> would preserve only annotations with the subtypes "Text" and "UnderLine"</p>
+</d1>
<p>
The following options are useful for creating PDF 1.2 files:
Summary of changes:
Resource/Init/pdf_draw.ps | 29 +++++++++++++++++--
devices/vector/gdevpdfb.h | 1 +
devices/vector/gdevpdfd.c | 4 +--
devices/vector/gdevpdfg.c | 72 ++++++++++++++++++++++++++++++++++++-----------
devices/vector/gdevpdfg.h | 8 +++---
devices/vector/gdevpdft.c | 4 +--
devices/vector/gdevpdfx.h | 1 +
devices/vector/gdevpdts.c | 2 +-
devices/vector/gdevpdtt.c | 4 +--
doc/Use.htm | 12 ++++----
doc/VectorDevices.htm | 14 +++++++++
xps/xpscolor.c | 4 +++
xps/xpsimage.c | 2 ++
xps/xpsopacity.c | 2 ++
14 files changed, 124 insertions(+), 35 deletions(-)