diff options
-rw-r--r-- | devices/vector/gdevpdfm.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/devices/vector/gdevpdfm.c b/devices/vector/gdevpdfm.c index 29f20bacc..b12fe117f 100644 --- a/devices/vector/gdevpdfm.c +++ b/devices/vector/gdevpdfm.c | |||
@@ -1984,6 +1984,35 @@ pdfmark_DOCINFO(gx_device_pdf * pdev, gs_param_string * pairs, uint count, | |||
1984 | 1984 | ||
1985 | vsize = 0x0badf00d; /* Quiet compiler. */ | 1985 | vsize = 0x0badf00d; /* Quiet compiler. */ |
1986 | 1986 | ||
1987 | if (pdev->PDFA !=0) { | ||
1988 | const gs_param_string *p = pairs + i + 1; | ||
1989 | if (p->size > 9 && memcmp(p->data, "(\\376\\377", 9) == 0) { | ||
1990 | /* Can't handle UTF16BE in PDF/A1, so abort this pair or abort PDF/A or just abort, | ||
1991 | * depending on PDFACompatibilityPolicy | ||
1992 | */ | ||
1993 | switch (pdev->PDFACompatibilityPolicy) { | ||
1994 | case 0: | ||
1995 | emprintf(pdev->memory, | ||
1996 | "UTF16BE text string detected in DOCINFO cannot be represented in XMP for PDF/A1, reverting to normal PDF output\n"); | ||
1997 | pdev->AbortPDFAX = true; | ||
1998 | pdev->PDFX = 0; | ||
1999 | break; | ||
2000 | case 1: | ||
2001 | emprintf(pdev->memory, | ||
2002 | "UTF16BE text string detected in DOCINFO cannot be represented in XMP for PDF/A1, discarding DOCINFO\n"); | ||
2003 | continue; | ||
2004 | break; | ||
2005 | case 2: | ||
2006 | emprintf(pdev->memory, | ||
2007 | "UTF16BE text string detected in DOCINFO cannot be represented in XMP for PDF/A1, aborting conversion.\n"); | ||
2008 | /* If we don't return a fatal error then zputdeviceparams simply ignores it (!) */ | ||
2009 | return_error(gs_error_Fatal); | ||
2010 | break; | ||
2011 | default: | ||
2012 | break; | ||
2013 | } | ||
2014 | } | ||
2015 | } | ||
1987 | if (pdf_key_eq(pairs + i, "/Producer")) { | 2016 | if (pdf_key_eq(pairs + i, "/Producer")) { |
1988 | /* | 2017 | /* |
1989 | * If the string "Distiller" appears anywhere in the Producer, | 2018 | * If the string "Distiller" appears anywhere in the Producer, |