summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pdf/ghostpdf.h1
-rw-r--r--pdf/pdf_int.c3
-rw-r--r--pdf/pdf_page.c3
-rw-r--r--pdf/pdftop.c5
4 files changed, 12 insertions, 0 deletions
diff --git a/pdf/ghostpdf.h b/pdf/ghostpdf.h
index 9d10d0f74..625dca7dd 100644
--- a/pdf/ghostpdf.h
+++ b/pdf/ghostpdf.h
@@ -191,6 +191,7 @@ typedef struct cmd_args_s {
bool renderttnotdef;
bool pdfinfo;
bool UsePDFX3Profile;
+ bool NOSUBSTDEVICECOLORS;
bool ditherppi;
int PDFX3Profile_num;
char *UseOutputIntent;
diff --git a/pdf/pdf_int.c b/pdf/pdf_int.c
index 4ac7a5177..a8e31facf 100644
--- a/pdf/pdf_int.c
+++ b/pdf/pdf_int.c
@@ -1768,6 +1768,9 @@ static int setup_stream_DefaultSpaces(pdf_context *ctx, pdf_dict *stream_dict)
* spaces.
*/
+ if (ctx->args.NOSUBSTDEVICECOLORS)
+ return 0;
+
code = pdfi_dict_knownget(ctx, stream_dict, "Resources", (pdf_obj **)&resources_dict);
if (code > 0) {
code = pdfi_dict_knownget(ctx, resources_dict, "ColorSpace", (pdf_obj **)&colorspaces_dict);
diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c
index 7e5b45244..9439b6e34 100644
--- a/pdf/pdf_page.c
+++ b/pdf/pdf_page.c
@@ -692,6 +692,9 @@ static int setup_page_DefaultSpaces(pdf_context *ctx, pdf_dict *page_dict)
/* First off, discard any dangling Default* colour spaces, just in case. */
release_page_DefaultSpaces(ctx);
+ if (ctx->args.NOSUBSTDEVICECOLORS)
+ return 0;
+
/* Create any required DefaultGray, DefaultRGB or DefaultCMYK
* spaces.
*/
diff --git a/pdf/pdftop.c b/pdf/pdftop.c
index 66baf722a..feb8e8b3e 100644
--- a/pdf/pdftop.c
+++ b/pdf/pdftop.c
@@ -655,6 +655,11 @@ pdf_impl_set_param(pl_interp_implementation_t *impl,
if (code < 0)
return code;
}
+ if (!strncmp(param, "NOSUBSTDEVICECOLORS", strlen("NOSUBSTDEVICECOLORS"))) {
+ code = plist_value_get_bool(&pvalue, &ctx->args.NOSUBSTDEVICECOLORS);
+ if (code < 0)
+ return code;
+ }
if (!strncmp(param, "UseOutputIntent", strlen("UseOutputIntent"))) {
code = plist_value_get_string_or_name(ctx, &pvalue, &ctx->args.UseOutputIntent, &len);
if (code < 0)