[gs-cvs] rev 6894 - in trunk/gs: lib src

leonardo at ghostscript.com leonardo at ghostscript.com
Wed Jul 5 13:28:10 PDT 2006


Author: leonardo
Date: 2006-07-05 13:28:10 -0700 (Wed, 05 Jul 2006)
New Revision: 6894

Modified:
   trunk/gs/lib/gs_devcs.ps
   trunk/gs/src/gdevpdfe.c
Log:
Fix (pdfwrite) : More PDF/A-1b complience, continued.

DETAILS :

Bug 688742 "PDF/A label missing error in Acrobat preflight", part 3.

1. Substitute the DeviceRGB color space.
2. Write the instance ID into the pdfaid item.
3. /Type/Metadata/Subtype/XML is required for metadata stream dictionary.

DIFFERENCES :

None.


Modified: trunk/gs/lib/gs_devcs.ps
===================================================================
--- trunk/gs/lib/gs_devcs.ps	2006-07-05 18:17:52 UTC (rev 6893)
+++ trunk/gs/lib/gs_devcs.ps	2006-07-05 20:28:10 UTC (rev 6894)
@@ -82,14 +82,16 @@
 }
 bind def
 
-% <color_space> <color_space_name> cs_substitute_DeviceRGB_for_PDFX <color_space1> <color_space2>
-/cs_substitute_DeviceRGB_for_PDFX
-{ systemdict /PDFX .knownget not { false } if {
+% <color_space> <color_space_name> cs_substitute_DeviceRGB_for_PDFX_or_PDFA <color_space1> <color_space2>
+/cs_substitute_DeviceRGB_for_PDFX_or_PDFA
+{ systemdict /PDFX .knownget not { false } if
+  systemdict /PDFA .knownget not { false } if
+  or {
     dup /ColorSpace resourcestatus {
       pop pop
     } {
-      (Error: Need a /DefaultRGB /ColorSpace resource for generating a PDF/X document.) =
-      /cs_substitute_DeviceRGB_for_PDFX cvx /undefined signalerror
+      (Error: Need a /DefaultRGB /ColorSpace resource for generating a PDF/X or PDF/A document.) =
+      /cs_substitute_DeviceRGB_for_PDFX_or_PDFA cvx /undefined signalerror
     } ifelse
     /ColorSpace findresource
   } {
@@ -174,7 +176,7 @@
     /cs_validate {}
 
     /cs_substitute
-      { /DefaultRGB //cs_substitute_DeviceRGB_for_PDFX exec
+      { /DefaultRGB //cs_substitute_DeviceRGB_for_PDFX_or_PDFA exec
       }
     bind
 

Modified: trunk/gs/src/gdevpdfe.c
===================================================================
--- trunk/gs/src/gdevpdfe.c	2006-07-05 18:17:52 UTC (rev 6893)
+++ trunk/gs/src/gdevpdfe.c	2006-07-05 20:28:10 UTC (rev 6894)
@@ -485,7 +485,7 @@
 	    if (pdev->PDFA) {
 		pdf_xml_tag_open_beg(s, "rdf:Description");
 		pdf_xml_attribute_name(s, "rdf:about");
-		pdf_xml_attribute_value(s, "");
+		pdf_xml_attribute_value(s, instance_uuid);
 		pdf_xml_attribute_name(s, "xmlns:pdfaid");
 		pdf_xml_attribute_value(s, "http://www.aiim.org/pdfa/ns/id.html");
 		pdf_xml_attribute_name(s, "pdfaid:part");
@@ -524,6 +524,12 @@
 	code = pdf_open_aside(pdev, resourceOther, gs_no_id, &pres, true, options);
 	if (code < 0)
 	    return code;
+	code = cos_dict_put_c_key_string((cos_dict_t *)pres->object, "/Type", (const byte *)"/Metadata", 9);
+	if (code < 0)
+	    return code;
+	code = cos_dict_put_c_key_string((cos_dict_t *)pres->object, "/Subtype", (const byte *)"/XML", 4);
+	if (code < 0)
+	    return code;
 	code = pdf_write_document_metadata(pdev, digest);
 	if (code < 0)
 	    return code;



More information about the gs-cvs mailing list