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/base/gdevpdfp.c | |
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/base/gdevpdfp.c')
-rw-r--r-- | gs/base/gdevpdfp.c | 16 |
1 files changed, 8 insertions, 8 deletions
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) { |