diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2012-03-13 09:20:59 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2012-03-15 11:54:25 +0000 |
commit | 5ef6b834ef7c5d03a482d0aa5df94b1f602be903 (patch) | |
tree | 9cff503b5b6b3adb5e11a174186c046329dcee9e /gs | |
parent | 75ef35c843a99bc9d7022a0bc27e7cd4ffc37abd (diff) |
pdfwrite - first pass at PDF/A-2 output
This is the first part of making it possible to produce PDF/A-2b output from
pdfwrite.
The PDFA switch has changed from a boolean to an integer, where the value gives
the level of PDF/A compatibility. This has knock-on effects throughout the
C and PostScript code which has been revised to expect an integer instead
of boolean value.
When PDFA has the value 2 we no longer flatten transparency, and we write
'2' in the pdfaid field in the XMP metadata.
PDF/A-1b output still seems to work correctly, but it is unlikely that the
work so far is sufficient for correct PDF/A-2 output.
No differences expected as the cluster does not test PDF/A output.
Diffstat (limited to 'gs')
-rw-r--r-- | gs/Resource/Init/gs_cspace.ps | 2 | ||||
-rw-r--r-- | gs/Resource/Init/gs_pdfwr.ps | 2 | ||||
-rw-r--r-- | gs/base/gdevpdfb.c | 2 | ||||
-rw-r--r-- | gs/base/gdevpdfc.c | 4 | ||||
-rw-r--r-- | gs/base/gdevpdfe.c | 9 | ||||
-rw-r--r-- | gs/base/gdevpdfg.c | 2 | ||||
-rw-r--r-- | gs/base/gdevpdfj.c | 2 | ||||
-rw-r--r-- | gs/base/gdevpdfm.c | 6 | ||||
-rw-r--r-- | gs/base/gdevpdfo.c | 20 | ||||
-rw-r--r-- | gs/base/gdevpdfp.c | 16 | ||||
-rw-r--r-- | gs/base/gdevpdfu.c | 2 | ||||
-rw-r--r-- | gs/base/gdevpdfx.h | 2 | ||||
-rw-r--r-- | gs/base/gdevpdtb.c | 6 | ||||
-rw-r--r-- | gs/base/gdevpdtd.c | 6 | ||||
-rw-r--r-- | gs/base/gdevpdte.c | 6 | ||||
-rw-r--r-- | gs/base/gdevpdtf.c | 4 | ||||
-rw-r--r-- | gs/base/gdevpdti.c | 2 | ||||
-rw-r--r-- | gs/base/gdevpdtt.c | 4 | ||||
-rw-r--r-- | gs/base/gdevpdtw.c | 2 | ||||
-rw-r--r-- | gs/doc/Ps2pdf.htm | 6 |
20 files changed, 54 insertions, 51 deletions
diff --git a/gs/Resource/Init/gs_cspace.ps b/gs/Resource/Init/gs_cspace.ps index 6b6ef3b6c..944410c78 100644 --- a/gs/Resource/Init/gs_cspace.ps +++ b/gs/Resource/Init/gs_cspace.ps @@ -165,7 +165,7 @@ bind def % /cs_substitute_DeviceRGB_for_PDFX_or_PDFA { systemdict /PDFX .knownget not { //false } if - systemdict /PDFA .knownget not { //false } if + systemdict /PDFA .knownget not { //false } {pop //true} ifelse or { dup /ColorSpace resourcestatus { pop pop diff --git a/gs/Resource/Init/gs_pdfwr.ps b/gs/Resource/Init/gs_pdfwr.ps index 94f916be2..dbdfe256e 100644 --- a/gs/Resource/Init/gs_pdfwr.ps +++ b/gs/Resource/Init/gs_pdfwr.ps @@ -475,7 +475,7 @@ userdict /.pdfcvstring () put grestore } if dup /PS eq systemdict /PDFX .knownget not { //false } if - systemdict /PDFA .knownget not { //false } if or and { + systemdict /PDFA .knownget not { //false }{pop //true} ifelse or and { % Execute it since PDF/X doesn't allow to embed it. pop { dup mark eq { diff --git a/gs/base/gdevpdfb.c b/gs/base/gdevpdfb.c index 46343cc0c..0552b6a65 100644 --- a/gs/base/gdevpdfb.c +++ b/gs/base/gdevpdfb.c @@ -585,7 +585,7 @@ gdev_pdf_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles, sprintf(buf, "/R%ld Do\n", image_id); pprintd1(s, "%d>>stream\n", strlen(buf)); - if (pdev->PDFA) + if (pdev->PDFA != 0) pprints1(s, "%s\nendstream\n", buf); else pprints1(s, "%sendstream\n", buf); diff --git a/gs/base/gdevpdfc.c b/gs/base/gdevpdfc.c index 97631f9cb..bd75b865e 100644 --- a/gs/base/gdevpdfc.c +++ b/gs/base/gdevpdfc.c @@ -481,7 +481,7 @@ pdf_separation_color_space(gx_device_pdf *pdev, csi = gsicc_get_default_type(alt_space->cmm_icc_profile_data); } if (csi == gs_color_space_index_DeviceRGB && (pdev->PDFX || - (pdev->PDFA && (pdev->pcm_color_info_index == gs_color_space_index_DeviceCMYK)))) { + (pdev->PDFA != 0 && (pdev->pcm_color_info_index == gs_color_space_index_DeviceCMYK)))) { /* We have a DeviceRGB alternate, but are producing either PDF/X or * PDF/A with a DeviceCMYK process color model. So we need to convert @@ -530,7 +530,7 @@ pdf_separation_color_space(gx_device_pdf *pdev, return code; } if (csi == gs_color_space_index_DeviceCMYK && - (pdev->PDFA && (pdev->pcm_color_info_index == gs_color_space_index_DeviceRGB))) { + (pdev->PDFA != 0 && (pdev->pcm_color_info_index == gs_color_space_index_DeviceRGB))) { /* We have a DeviceCMYK alternate, but are producingPDF/A with a * DeviceRGB process color model. See comment above re DviceRGB. */ diff --git a/gs/base/gdevpdfe.c b/gs/base/gdevpdfe.c index e76de6d0d..dca7b3e61 100644 --- a/gs/base/gdevpdfe.c +++ b/gs/base/gdevpdfe.c @@ -562,7 +562,7 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) return code; /* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */ - if (pdev->PDFA) + if (pdev->PDFA != 0) instance_uuid[0] = 0x00; cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time)); @@ -745,14 +745,17 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) } pdf_xml_tag_close(s, "rdf:Description"); pdf_xml_newline(s); - if (pdev->PDFA) { + if (pdev->PDFA != 0) { pdf_xml_tag_open_beg(s, "rdf:Description"); pdf_xml_attribute_name(s, "rdf:about"); 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/"); pdf_xml_attribute_name(s, "pdfaid:part"); - pdf_xml_attribute_value(s,"1"); + if (pdev->PDFA == 1) + pdf_xml_attribute_value(s,"1"); + else + pdf_xml_attribute_value(s,"2"); pdf_xml_attribute_name(s, "pdfaid:conformance"); pdf_xml_attribute_value(s,"B"); pdf_xml_tag_end_empty(s); diff --git a/gs/base/gdevpdfg.c b/gs/base/gdevpdfg.c index 90fd3e770..4e8723682 100644 --- a/gs/base/gdevpdfg.c +++ b/gs/base/gdevpdfg.c @@ -1488,7 +1488,7 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_imager_state *pis, return code; } if (pdev->params.TransferFunctionInfo == tfi_Preserve && - !pdev->PDFX && !pdev->PDFA + !pdev->PDFX && pdev->PDFA == 0 ) { code = pdf_update_transfer(pdev, pis, trs); if (code < 0) diff --git a/gs/base/gdevpdfj.c b/gs/base/gdevpdfj.c index bb2c8ce96..72fed988e 100644 --- a/gs/base/gdevpdfj.c +++ b/gs/base/gdevpdfj.c @@ -132,7 +132,7 @@ pdf_put_pixel_image_values(cos_dict_t *pcd, gx_device_pdf *pdev, } } if (pim->Interpolate) { - if (pdev->PDFA) + if (pdev->PDFA != 0) emprintf(pdev->memory, "PDFA doesn't allow images with Interpolate true.\n"); else diff --git a/gs/base/gdevpdfm.c b/gs/base/gdevpdfm.c index 741d55271..aad3bbd88 100644 --- a/gs/base/gdevpdfm.c +++ b/gs/base/gdevpdfm.c @@ -713,7 +713,7 @@ pdfmark_annot(gx_device_pdf * pdev, gs_param_string * pairs, uint count, /* Annotations are only permitted in PDF/A if they have the * Print flag enabled, so we need to prescan for that here. */ - if(pdev->PDFA) { + if(pdev->PDFA != 0) { int i, Flags = 0; /* Check all the keys to see if we have a /F (Flags) key/value pair defined */ for (i = 0; i < count; i += 2) { @@ -737,7 +737,7 @@ pdfmark_annot(gx_device_pdf * pdev, gs_param_string * pairs, uint count, emprintf(pdev->memory, "Annotation set to non-printing,\n not permitted in PDF/A, reverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; /* Since the annotation would break PDF/A compatibility, do not * include it, but warn the user that it has been dropped. @@ -756,7 +756,7 @@ pdfmark_annot(gx_device_pdf * pdev, gs_param_string * pairs, uint count, emprintf(pdev->memory, "Annotation set to non-printing,\n not permitted in PDF/A, unrecognised PDFACompatibilityLevel,\nreverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; } } diff --git a/gs/base/gdevpdfo.c b/gs/base/gdevpdfo.c index b069c8415..20c3a1d86 100644 --- a/gs/base/gdevpdfo.c +++ b/gs/base/gdevpdfo.c @@ -512,19 +512,19 @@ cos_array_write(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id) for (pcae = first; pcae; ++last_index, pcae = pcae->next) { Element_Count++; - if(pdev->PDFA && Element_Count > 8191) { + if(pdev->PDFA != 0 && Element_Count > 8191) { switch (pdev->PDFACompatibilityPolicy) { case 0: emprintf(pdev->memory, "Too many entries in array,\n max 8191 in PDF/A, reverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; case 1: emprintf(pdev->memory, "Too many entries in array,\n max 8191 in PDF/A. Cannot simply elide dictionary, reverting to normal output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; case 2: emprintf(pdev->memory, @@ -538,7 +538,7 @@ cos_array_write(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id) emprintf(pdev->memory, "Too many entries in array,\n max 8191 in PDF/A. Unrecognised PDFACompatibilityLevel,\nreverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; } } @@ -550,7 +550,7 @@ cos_array_write(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id) } DISCARD(cos_array_reorder(pca, first)); stream_puts(s, "]"); - if (pdev->PDFA) + if (pdev->PDFA != 0) stream_puts(s, "\n"); return 0; } @@ -821,19 +821,19 @@ cos_elements_write(stream *s, const cos_dict_element_t *pcde, Element_Count++; - if(pdev->PDFA && Element_Count > 4095) { + if(pdev->PDFA != 0 && Element_Count > 4095) { switch (pdev->PDFACompatibilityPolicy) { case 0: emprintf(pdev->memory, "Too many entries in dictionary,\n max 4095 in PDF/A, reverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; case 1: emprintf(pdev->memory, "Too many entries in dictionary,\n max 4095 in PDF/A. Cannot simply elide dictionary, reverting to normal output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; case 2: emprintf(pdev->memory, @@ -847,7 +847,7 @@ cos_elements_write(stream *s, const cos_dict_element_t *pcde, emprintf(pdev->memory, "Too many entries in dictionary,\n max 4095 in PDF/A. Unrecognised PDFACompatibilityLevel,\nreverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; } } @@ -878,7 +878,7 @@ cos_dict_write(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id) stream_puts(s, "<<"); cos_elements_write(s, ((const cos_dict_t *)pco)->elements, pdev, false, object_id); stream_puts(s, ">>"); - if (pdev->PDFA) + if (pdev->PDFA != 0) stream_puts(s, "\n"); return 0; } diff --git a/gs/base/gdevpdfp.c b/gs/base/gdevpdfp.c index 0a40a98e5..6a397b5e0 100644 --- a/gs/base/gdevpdfp.c +++ b/gs/base/gdevpdfp.c @@ -94,7 +94,7 @@ static const gs_param_item_t pdf_param_items[] = { pi("HaveTransparency", gs_param_type_bool, HaveTransparency), pi("CompressEntireFile", gs_param_type_bool, CompressEntireFile), pi("PDFX", gs_param_type_bool, PDFX), - pi("PDFA", gs_param_type_bool, PDFA), + pi("PDFA", gs_param_type_int, PDFA), pi("DocumentUUID", gs_param_type_string, DocumentUUID), pi("InstanceUUID", gs_param_type_string, InstanceUUID), pi("DocumentTimeSeq", gs_param_type_int, DocumentTimeSeq), @@ -416,11 +416,11 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par * or less impossible to alter the setting in the (potentially saved) page * device dictionary, so we use this rather clunky method. */ - if(pdev->PDFA && pdev->AbortPDFAX) - pdev->PDFA = false; + if(pdev->PDFA != 0 && pdev->AbortPDFAX) + pdev->PDFA = 0; if(pdev->PDFX && pdev->AbortPDFAX) - pdev->PDFX = false; - if (pdev->PDFX && pdev->PDFA) { + pdev->PDFX = 0; + if (pdev->PDFX && pdev->PDFA != 0) { ecode = gs_note_error(gs_error_rangecheck); param_signal_error(plist, "PDFA", ecode); goto fail; @@ -430,12 +430,12 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par param_signal_error(plist, "PDFX", ecode); goto fail; } - if (pdev->PDFA && pdev->ForOPDFRead) { + if (pdev->PDFA != 0 && pdev->ForOPDFRead) { ecode = gs_note_error(gs_error_rangecheck); param_signal_error(plist, "PDFA", ecode); goto fail; } - if (pdev->PDFA) + if (pdev->PDFA == 1) pdev->HaveTransparency = false; /* * We have to set version to the new value, because the set of @@ -444,7 +444,7 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par */ if (pdev->PDFX) cl = (float)1.3; /* Instead pdev->CompatibilityLevel = 1.2; - see below. */ - if (pdev->PDFA && cl < 1.4) + if (pdev->PDFA != 0 && cl < 1.4) cl = (float)1.4; pdev->version = (cl < 1.2 ? psdf_version_level2 : psdf_version_ll3); if (pdev->ForOPDFRead) { diff --git a/gs/base/gdevpdfu.c b/gs/base/gdevpdfu.c index dfebc60b0..2d8564574 100644 --- a/gs/base/gdevpdfu.c +++ b/gs/base/gdevpdfu.c @@ -1021,7 +1021,7 @@ stream_to_none(gx_device_pdf * pdev) pdf_end_encrypt(pdev); s = pdev->strm; length = pdf_stell(pdev) - pdev->contents_pos; - if (pdev->PDFA) + if (pdev->PDFA != 0) stream_puts(s, "\n"); stream_puts(s, "endstream\n"); pdf_end_obj(pdev, resourceStream); diff --git a/gs/base/gdevpdfx.h b/gs/base/gdevpdfx.h index 41906dec7..886ce5c18 100644 --- a/gs/base/gdevpdfx.h +++ b/gs/base/gdevpdfx.h @@ -465,7 +465,7 @@ struct gx_device_pdf_s { bool PatternImagemask; /* The target viewer|printer handles imagemask with pattern color. */ bool PDFX; /* Generate PDF/X */ - bool PDFA; /* Generate PDF/A */ + int PDFA; /* Generate PDF/A 0 = don't produce, otherwise level of PDF/A */ bool AbortPDFAX; /* Abort generation of PDFA or X, produce regular PDF */ long MaxClipPathSize; /* The maximal number of elements of a clipping path that the target viewer|printer can handle. */ diff --git a/gs/base/gdevpdtb.c b/gs/base/gdevpdtb.c index 1608dfc7b..dca3dd251 100644 --- a/gs/base/gdevpdtb.c +++ b/gs/base/gdevpdtb.c @@ -562,7 +562,7 @@ pdf_write_embedded_font(gx_device_pdf *pdev, pdf_base_font_t *pbfont, font_type DATA_STREAM_COMPRESS : 0), 0); if (code < 0) return code; - if (pdev->PDFA) { + if (pdev->PDFA != 0) { stream *s = s_MD5C_make_stream(pdev->pdf_memory, writer.binary.strm); if (s == NULL) @@ -653,7 +653,7 @@ pdf_write_embedded_font(gx_device_pdf *pdev, pdf_base_font_t *pbfont, font_type #define TRUETYPE_OPTIONS (WRITE_TRUETYPE_NAME | WRITE_TRUETYPE_HVMTX) /* Acrobat Reader 3 doesn't handle cmap format 6 correctly. */ const int options = TRUETYPE_OPTIONS | - (pdev->PDFA ? WRITE_TRUETYPE_UNICODE_CMAP : 0) | + (pdev->PDFA != 0 ? WRITE_TRUETYPE_UNICODE_CMAP : 0) | (pdev->CompatibilityLevel <= 1.2 ? WRITE_TRUETYPE_NO_TRIMMED_TABLE : 0) | /* Generate a cmap only for incrementally downloaded fonts @@ -697,7 +697,7 @@ pdf_write_embedded_font(gx_device_pdf *pdev, pdf_base_font_t *pbfont, font_type (gs_font_cid2 *)out_font, CID2_OPTIONS, NULL, 0, &fnstr); finish: - if (pdev->PDFA) { + if (pdev->PDFA != 0) { sflush(writer.binary.strm); s_MD5C_get_digest(writer.binary.strm, digest, sizeof(digest)); } diff --git a/gs/base/gdevpdtd.c b/gs/base/gdevpdtd.c index 91e3cedd3..9ebe7d676 100644 --- a/gs/base/gdevpdtd.c +++ b/gs/base/gdevpdtd.c @@ -526,7 +526,7 @@ pdf_compute_font_descriptor(gx_device_pdf *pdev, pdf_font_descriptor_t *pfd) if (!(desc.Flags & FONT_IS_SYMBOLIC)) { desc.Flags |= FONT_IS_ADOBE_ROMAN; /* required if not symbolic */ desc.XHeight = (int)x_height; - if (!small_present && (!pdev->PDFA || bfont->FontType != ft_TrueType)) + if (!small_present && (!pdev->PDFA != 0 || bfont->FontType != ft_TrueType)) desc.Flags |= FONT_IS_ALL_CAPS; desc.CapHeight = cap_height; /* @@ -577,10 +577,10 @@ pdf_compute_font_descriptor(gx_device_pdf *pdev, pdf_font_descriptor_t *pfd) desc.Descent = desc.FontBBox.p.y; if (!(desc.Flags & (FONT_IS_SYMBOLIC | FONT_IS_ALL_CAPS)) && (small_descent > desc.Descent / 3 || desc.XHeight > small_height * 0.9) && - (!pdev->PDFA || bfont->FontType != ft_TrueType) + (!pdev->PDFA != 0 || bfont->FontType != ft_TrueType) ) desc.Flags |= FONT_IS_SMALL_CAPS; - if (fixed_width > 0 && (!pdev->PDFA || bfont->FontType != ft_TrueType)) { + if (fixed_width > 0 && (!pdev->PDFA != 0 || bfont->FontType != ft_TrueType)) { desc.Flags |= FONT_IS_FIXED_WIDTH; desc.AvgWidth = desc.MaxWidth = desc.MissingWidth = fixed_width; } diff --git a/gs/base/gdevpdte.c b/gs/base/gdevpdte.c index 6ffd58120..8d78c3d1c 100644 --- a/gs/base/gdevpdte.c +++ b/gs/base/gdevpdte.c @@ -246,13 +246,13 @@ pdf_encode_string_element(gx_device_pdf *pdev, gs_font *font, pdf_font_resource_ if (code < 0 && code != gs_error_undefined) return code; if (code == gs_error_undefined) { - if (pdev->PDFA || pdev->PDFX) { + if (pdev->PDFA != 0 || pdev->PDFX) { switch (pdev->PDFACompatibilityPolicy) { case 0: emprintf(pdev->memory, "Requested glyph not present in source font,\n not permitted in PDF/A, reverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; case 1: emprintf(pdev->memory, @@ -276,7 +276,7 @@ pdf_encode_string_element(gx_device_pdf *pdev, gs_font *font, pdf_font_resource_ emprintf(pdev->memory, "Requested glyph not present in source font,\n not permitted in PDF/A, unrecognised PDFACompatibilityLevel,\nreverting to normal PDF output\n"); pdev->AbortPDFAX = true; - pdev->PDFA = false; + pdev->PDFA = 0; break; } } diff --git a/gs/base/gdevpdtf.c b/gs/base/gdevpdtf.c index 6f6bd3f52..0d2be2bc4 100644 --- a/gs/base/gdevpdtf.c +++ b/gs/base/gdevpdtf.c @@ -704,7 +704,7 @@ pdf_font_embed_status(gx_device_pdf *pdev, gs_font *font, int *pindex, */ if (pindex) *pindex = index; - if (pdev->PDFX || pdev->PDFA) + if (pdev->PDFX || pdev->PDFA != 0) return FONT_EMBED_YES; if (pdev->CompatibilityLevel < 1.3) { if (index >= 0 && @@ -1028,7 +1028,7 @@ pdf_obtain_cidfont_widths_arrays(gx_device_pdf *pdev, pdf_font_resource_t *pdfon int pdf_convert_truetype_font(gx_device_pdf *pdev, pdf_resource_t *pres) { - if (!pdev->PDFA) + if (pdev->PDFA == 0) return 0; else { pdf_font_resource_t *pdfont = (pdf_font_resource_t *)pres; diff --git a/gs/base/gdevpdti.c b/gs/base/gdevpdti.c index 2fc12bf2d..2c6de9882 100644 --- a/gs/base/gdevpdti.c +++ b/gs/base/gdevpdti.c @@ -454,7 +454,7 @@ pdf_end_char_proc(gx_device_pdf * pdev, pdf_stream_position_t * ppos) sseek(s, start_pos - 15); pprintd1(s, "%d", length); sseek(s, end_pos); - if (pdev->PDFA) + if (pdev->PDFA != 0) stream_puts(s, "\n"); stream_puts(s, "endstream\n"); pdf_end_separate(pdev, resourceCharProc); diff --git a/gs/base/gdevpdtt.c b/gs/base/gdevpdtt.c index 90c0dbc7d..396b5a019 100644 --- a/gs/base/gdevpdtt.c +++ b/gs/base/gdevpdtt.c @@ -1518,9 +1518,9 @@ pdf_make_font_resource(gx_device_pdf *pdev, gs_font *font, pdfont->mark_glyph = font->dir->ccache.mark_glyph; } - if (pdev->PDFA && font->FontType == ft_TrueType) { + if (pdev->PDFA != 0 && font->FontType == ft_TrueType) { /* The Adobe preflight tool for PDF/A - checks whether Widht or W include elements + checks whether Width or W include elements for all characters in the True Type font. Due to that we need to provide a width for .notdef glyph. diff --git a/gs/base/gdevpdtw.c b/gs/base/gdevpdtw.c index a5321198b..daa07b772 100644 --- a/gs/base/gdevpdtw.c +++ b/gs/base/gdevpdtw.c @@ -378,7 +378,7 @@ pdf_write_CIDFont_widths(gx_device_pdf *pdev, pprintd3(s, "\n%d %d %d", width, vx, vy); } else pprintd1(s, "\n%d", width); - } else if (!pdev->PDFA && width == dw && + } else if (pdev->PDFA == 0 && width == dw && (!wmode || (int)(pdfont->u.cidfont.v[cid * 2 + 0] + 0.5) == (int)(pdfont->Widths[cid] / 2 + 0.5)) && (!wmode || (int)(pdfont->u.cidfont.v[cid * 2 + 1] + 0.5) == dv)) diff --git a/gs/doc/Ps2pdf.htm b/gs/doc/Ps2pdf.htm index 2f4eda10a..5ec99fdc1 100644 --- a/gs/doc/Ps2pdf.htm +++ b/gs/doc/Ps2pdf.htm @@ -891,12 +891,12 @@ Please also see the <code>PDFACompatibilityPolicy</code> control described under <h2><a name="PDFA"></a>Creating a PDF/A document</h2> <p> -To create a PDF/A document, please follow instructions about <a href="#PDFX">creating a PDF/X-3 document</a>, +To create a PDF/A document, please follow the instructions for <a href="#PDFX">creating a PDF/X-3 document</a>, with the following exceptions : <ul> <li> Specify the <code>pdfwrite</code> device or use the <code>ps2pdf</code> script. -<li> Specify the <code>-dPDFA</code> option. +<li> Specify the <code>-dPDFA</code> option to specify PDF/A-1 or PDF/A-2. <li> Specify <code>-sProcessColorModel=DeviceGray</code>, <code>-sProcessColorModel=DeviceRGB</code> or <code>-sProcessColorModel=DeviceCMYK</code> You must specify a ProcessColorModel, even if you plan to create a device-independent colour PDF file using -dUseCIEColor. @@ -929,7 +929,7 @@ depending on the nature of the PDF/A incompatibility. Here is a sample command line to invoke Ghostscript for generating a PDF/A document : <blockquote><code> -gs -dPDFA -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sOutputFile=out-a.pdf PDFA_def.ps input.ps +gs -dPDFA=1 -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sOutputFile=out-a.pdf PDFA_def.ps input.ps </code></blockquote> <p> |