mirror of
https://github.com/storytold/craft-libs.git
synced 2026-10-31 15:49:54 +00:00
krilla: PDF/A ledgers state DeviceN and the print output intent
Patch 06 records that DeviceN fails export under PDF/A-1 to -3 (its tint transform is PostScript) and is written under PDF/A-4; patch 08 records the second output intent and the caller's CMYK destination profile.
This commit is contained in:
1 parent
1afbab004e
commit
0fe6156614
7 files changed
+184
-19
No files matched your search
Vendored
+6
-3
@@ -15,9 +15,9 @@ itself omits those texts. Its examples and four CC0 ICC profiles are retained wi
|
||||
| `patches/03-overprint.patch` | Overprint | `configure/{PDF_A2.md,PDF_A4.md,validate.rs}`, `content.rs`, `graphics/{blend,graphics_state}.rs`, `surface.rs` |
|
||||
| `patches/04-knockout.patch` | Knockout groups | `content.rs`, `graphics/{blend,xobject}.rs`, `surface.rs` |
|
||||
| `patches/05-soft-mask-backdrop.patch` | Soft-mask backdrop and transfer function | `configure/{PDF_A2,PDF_A4}.md`, `graphics/mask.rs` |
|
||||
| `patches/06-device-n.patch` | DeviceN colors | `configure/validate.rs`, `graphics/{color,device_n,mod,paint}.rs`, `serialize.rs` |
|
||||
| `patches/06-device-n.patch` | DeviceN colors | `configure/{PDF_A1.md,PDF_A2.md,PDF_A4.md,validate.rs}`, `graphics/{color,device_n,mod,paint}.rs`, `serialize.rs` |
|
||||
| `patches/07-device-n-images-shadings.patch` | DeviceN images and shadings | `graphics/{image,paint,shading_function}.rs` |
|
||||
| `patches/08-print-output-intent.patch` | Print output intent and PDF/X markers | `chunk_container.rs`, `interchange/metadata.rs`, `lib.rs`, `serialize.rs` |
|
||||
| `patches/08-print-output-intent.patch` | Print output intent and PDF/X markers | `chunk_container.rs`, `configure/{PDF_A1,PDF_A2,PDF_A4}.md`, `interchange/metadata.rs`, `lib.rs`, `serialize.rs` |
|
||||
| `patches/09-rendition-class.patch` | Master rendition in XMP | `chunk_container.rs` |
|
||||
| `patches/10-mesh-gradients.patch` | Mesh gradients | `content.rs`, `error.rs`, `graphics/{mask,paint,shading_function}.rs`, `serialize.rs`, `surface.rs` |
|
||||
|
||||
@@ -176,7 +176,8 @@ written as CMYK, which knocks out or replaces the other plates.
|
||||
- Validation: a spot's CMYK alternate counts as its Separation fallback, so one colorant
|
||||
name keeps one alternate across Separation and DeviceN spaces
|
||||
(`ValidationError::InconsistentSeparationFallback`). `/All` and `/None` are Separation-only
|
||||
and checked as before.
|
||||
and checked as before. The PDF/A ledgers state that DeviceN fails export under PDF/A-1, -2
|
||||
and -3 and is written under PDF/A-4.
|
||||
- `Color::to_regular` (annotations, tags) gives the alternate CMYK; `Paint::as_rgb` gives
|
||||
`None`, as for CMYK.
|
||||
|
||||
@@ -233,6 +234,8 @@ version. DesignCraft and VectorCraft added these by rewriting the serialized byt
|
||||
- The dictionary entries follow the dictionary's PDF 2.0 deprecation: from PDF 2.0 only XMP
|
||||
carries them. The dictionary is written without `Metadata` when it has print markers.
|
||||
- All three default to `None`, which keeps upstream's output.
|
||||
- The PDF/A ledgers state the two output intents and the CMYK destination profile; krilla
|
||||
checks only that the profile has four components.
|
||||
|
||||
krilla does not check PDF/X conformance; callers do. `CRAFT_PRINT_COLOR` marks the fork's
|
||||
print color patches (02 to 08) so craft-pdf fails to build against an unpatched Krilla.
|
||||
|
||||
Vendored
+3
-3
@@ -77,12 +77,12 @@
|
||||
{
|
||||
"path": "src/configure/PDF_A1.md",
|
||||
"upstream_sha256": "e6ea127125ec0984f3fcd57f9886fc960aa90c9f751dd59cd61fe9cbc2cdb903",
|
||||
"sha256": "e6ea127125ec0984f3fcd57f9886fc960aa90c9f751dd59cd61fe9cbc2cdb903"
|
||||
"sha256": "422807bc786591d1b1599d7abb38874478fb34afab583f885011f200d239fa27"
|
||||
},
|
||||
{
|
||||
"path": "src/configure/PDF_A2.md",
|
||||
"upstream_sha256": "47c87d3b29aff6e87703ba6f6021a2cfa88b4faf7f2c35101719b8b9f1bb9705",
|
||||
"sha256": "6239a0bc643c59f19c13f09def57e8c84c6bf761698b383bb6a5b4c17350c119"
|
||||
"sha256": "cc6cc2184d21165fc36fbd635681a8c0c8d3abb76f0f7e5adbb7131fb3921f37"
|
||||
},
|
||||
{
|
||||
"path": "src/configure/PDF_A3.md",
|
||||
@@ -92,7 +92,7 @@
|
||||
{
|
||||
"path": "src/configure/PDF_A4.md",
|
||||
"upstream_sha256": "27710cf95e6ef83714cfa372e09796c9ec0d5455ceb31c101a7dccfdd8ee1b5b",
|
||||
"sha256": "2e071f227cd052cef21484923b5a52ae5ce4c0a0709a22fde117de5ab9100141"
|
||||
"sha256": "f3a6ed247033124a8ad583e665e532e736841f2997974425688ced2c156fc6c6"
|
||||
},
|
||||
{
|
||||
"path": "src/configure/PDF_UA1.md",
|
||||
|
||||
+57
@@ -1,3 +1,60 @@
|
||||
diff --git a/src/configure/PDF_A1.md b/src/configure/PDF_A1.md
|
||||
index 2ade327..c525953 100644
|
||||
--- a/src/configure/PDF_A1.md
|
||||
+++ b/src/configure/PDF_A1.md
|
||||
@@ -54,7 +54,8 @@ with an even number of characters and without whitespaces. 🟢
|
||||
- krilla does check the maximum entries of a dictionary. 🟢
|
||||
- krilla fails export if more than 8388607 indirect objects exist. 🟢
|
||||
- krilla fails export if a higher nesting-level than 28 exists. 🔵
|
||||
-- krilla does not use the DeviceN color space. 🟢
|
||||
+- krilla fails export if a DeviceN color space is used (see 6.2.3.4), so the limit of 8
|
||||
+ DeviceN colorants is never reached. 🟢
|
||||
- krilla only uses u16 for CIDs. 🟢
|
||||
|
||||
6.1.13: krilla does not support optional content. 🔵
|
||||
@@ -81,7 +82,8 @@ in case CMYK is used but no profile was provided, export fails. 🟢
|
||||
6.2.3.4:
|
||||
- krilla ensures the Alternate space in Separation color spaces obeys the restrictions
|
||||
in the applicable clauses 🟢
|
||||
-- krilla does not support DeviceN color spaces. 🔵
|
||||
+- krilla fails export if a DeviceN color space is used: its tint transform is a PostScript
|
||||
+ calculator function (`ValidationError::ContainsPostScript`). 🟢
|
||||
|
||||
6.2.4:
|
||||
- krilla does not use the `Alternates`/`Intent` keys for images. 🔵
|
||||
diff --git a/src/configure/PDF_A2.md b/src/configure/PDF_A2.md
|
||||
index 6157896..9ff3593 100644
|
||||
--- a/src/configure/PDF_A2.md
|
||||
+++ b/src/configure/PDF_A2.md
|
||||
@@ -80,7 +80,8 @@ in case CMYK is used but no profile was provided, export fails.
|
||||
6.2.4.4:
|
||||
- krilla ensures the Alternate space in Separation color spaces obeys the restrictions
|
||||
in the applicable clauses 🟢
|
||||
-- krilla does not support DeviceN color spaces. 🔵
|
||||
+- krilla fails export if a DeviceN color space is used: its tint transform is a PostScript
|
||||
+ calculator function (`ValidationError::ContainsPostScript`). 🟢
|
||||
- krilla fails export if a Separation colorant is associated with multiple different
|
||||
fallback color spaces 🟢
|
||||
- krilla manages the `tintTransform` function and will always write the same function for
|
||||
diff --git a/src/configure/PDF_A4.md b/src/configure/PDF_A4.md
|
||||
index 91727cb..7cd5df3 100644
|
||||
--- a/src/configure/PDF_A4.md
|
||||
+++ b/src/configure/PDF_A4.md
|
||||
@@ -72,9 +72,12 @@ See `README.md` for the meaning of each color.
|
||||
- krilla does not use device color spaces in this mode. 🟢
|
||||
- krilla ensures the Alternate space in Separation color spaces obeys the restrictions
|
||||
in the applicable clauses 🟢
|
||||
-- krilla does not support DeviceN color spaces. 🔵
|
||||
+- krilla writes DeviceN color spaces with the CMYK ICC profile as their alternate in this
|
||||
+ mode. Each spot colorant is also listed under `/Colorants` as a Separation space with the
|
||||
+ same alternate, and a space mixing spot and process colorants is `/Subtype /NChannel`.
|
||||
+ The tint transform is a PostScript calculator function, which PDF/A-4 allows. 🟢
|
||||
- krilla fails export if a Separation colorant is associated with multiple different
|
||||
- fallback color spaces 🟢
|
||||
+ fallback color spaces, a DeviceN spot colorant's alternate included 🟢
|
||||
- krilla manages the `tintTransform` function and will always write the same function for
|
||||
the same color space 🟢
|
||||
|
||||
diff --git a/src/configure/validate.rs b/src/configure/validate.rs
|
||||
index 175a011..a0b1136 100644
|
||||
--- a/src/configure/validate.rs
|
||||
|
||||
+84
@@ -31,6 +31,90 @@ index 0530dd2..593302b 100644
|
||||
|
||||
xmp.num_pages(sc.page_infos().len() as u32);
|
||||
xmp.format("application/pdf");
|
||||
diff --git a/src/configure/PDF_A1.md b/src/configure/PDF_A1.md
|
||||
index c525953..2df1775 100644
|
||||
--- a/src/configure/PDF_A1.md
|
||||
+++ b/src/configure/PDF_A1.md
|
||||
@@ -64,7 +64,10 @@ with an even number of characters and without whitespaces. 🟢
|
||||
|
||||
6.2.2:
|
||||
- krilla always writes a valid output intent. 🟢
|
||||
-- krilla always only writes one output intent. 🟢
|
||||
+- krilla writes one output intent, or with `SerializeSettings::output_intent` two
|
||||
+ (`GTS_PDFA1` and `GTS_PDFX`) that name the same destination profile object. 🟢
|
||||
+- krilla checks only that a profile given in `SerializeSettings::output_intent` has four
|
||||
+ components; that it is an output (`prtr`) profile is up to the caller. 🟣
|
||||
|
||||
6.2.3.1: krilla overrides the `no_device_cs` property if PDF/A is selected, and
|
||||
in case CMYK is used but no profile was provided, export fails. 🟢
|
||||
@@ -73,7 +76,8 @@ in case CMYK is used but no profile was provided, export fails. 🟢
|
||||
- sRGB/sGrey ICC profiles conform to ICC v2 specification. 🟢
|
||||
|
||||
6.2.4.3:
|
||||
-- krilla always uses sRGB for RGB, and in addition also embeds an sRGB output intent. 🟢
|
||||
+- krilla always uses sRGB for RGB, with an sRGB output intent unless
|
||||
+ `SerializeSettings::output_intent` gives a CMYK one. 🟢
|
||||
- krilla always uses sGrey (except for encoding the alpha channel in images, where DeviceGray
|
||||
is required), and in addition always embeds an output intent. 🟢
|
||||
- krilla always uses an CMYK ICC profile, and always sets CMYK as the output intent. 🟢
|
||||
diff --git a/src/configure/PDF_A2.md b/src/configure/PDF_A2.md
|
||||
index 9ff3593..5e208d7 100644
|
||||
--- a/src/configure/PDF_A2.md
|
||||
+++ b/src/configure/PDF_A2.md
|
||||
@@ -60,7 +60,13 @@ user enables `ascii_compatible`, we still write a binary header marker. 🟢
|
||||
- krilla doesn't use the `ri` or `i` operator. 🟢
|
||||
- krilla ensure that content stream has their own associated resource dictionary. 🟢
|
||||
|
||||
-6.2.3: krilla always write an `sRGB` output intent for PDF/A. 🟢
|
||||
+6.2.3:
|
||||
+- krilla writes an `sRGB` output intent for PDF/A, or the CMYK profile given in
|
||||
+ `SerializeSettings::output_intent`. 🟢
|
||||
+- krilla writes one output intent, or with `SerializeSettings::output_intent` two
|
||||
+ (`GTS_PDFA1` and `GTS_PDFX`) that name the same destination profile object. 🟢
|
||||
+- krilla checks only that a profile given in `SerializeSettings::output_intent` has four
|
||||
+ components; that it is an output (`prtr`) profile is up to the caller. 🟣
|
||||
|
||||
6.2.4.1: krilla overrides the `no_device_cs` property if PDF/A is selected, and
|
||||
in case CMYK is used but no profile was provided, export fails.
|
||||
@@ -71,7 +77,8 @@ in case CMYK is used but no profile was provided, export fails.
|
||||
all CMYK is ICCBased in this mode. 🟢
|
||||
|
||||
6.2.4.3:
|
||||
-- krilla always uses sRGB for RGB, and in addition also embeds an sRGB output intent. 🟢
|
||||
+- krilla always uses sRGB for RGB, with an sRGB output intent unless
|
||||
+ `SerializeSettings::output_intent` gives a CMYK one. 🟢
|
||||
- krilla always uses sGrey (except for encoding the alpha channel in images, where DeviceGray
|
||||
is required), and in addition always embeds an output intent. 🟢
|
||||
- krilla always uses an CMYK ICC profile, and always sets CMYK as the output intent. 🟢
|
||||
diff --git a/src/configure/PDF_A4.md b/src/configure/PDF_A4.md
|
||||
index 7cd5df3..aac8008 100644
|
||||
--- a/src/configure/PDF_A4.md
|
||||
+++ b/src/configure/PDF_A4.md
|
||||
@@ -59,16 +59,20 @@ See `README.md` for the meaning of each color.
|
||||
### 6.2.3 Output intent
|
||||
- krilla always writes the output intent for this export mode. 🟢
|
||||
- krilla does not use the `DestOutputProfileRef` attribute. 🟢
|
||||
-- krilla does not write multiple output intents (since PDF/X and PDF/E are not supported). 🟢
|
||||
-- krilla only uses a Display ICC profile for output intent. 🟢
|
||||
-- krilla only uses RGB for output intents. 🟢
|
||||
+- krilla writes one output intent, or with `SerializeSettings::output_intent` two
|
||||
+ (`GTS_PDFA1` and `GTS_PDFX`) that name the same destination profile object. 🟢
|
||||
+- krilla uses the sRGB display profile for the output intent, or the CMYK profile given in
|
||||
+ `SerializeSettings::output_intent`. 🟢
|
||||
+- krilla checks only that a profile given in `SerializeSettings::output_intent` has four
|
||||
+ components; that it is an output (`prtr`) profile is up to the caller. 🟣
|
||||
|
||||
### 6.2.4 Colour spaces
|
||||
- krilla only uses device-independent colors in this export mode. 🟢
|
||||
- krilla uses compatible ICC profiles. 🟢
|
||||
- krilla fails export if overprint mode 1 is combined with fill or stroke overprint, since
|
||||
all CMYK is ICCBased in this mode. 🟢
|
||||
-- krilla never uses CMYK profiles as the destination profile. 🟢
|
||||
+- krilla uses a CMYK profile as the destination profile only when
|
||||
+ `SerializeSettings::output_intent` gives one. 🟢
|
||||
- krilla does not use device color spaces in this mode. 🟢
|
||||
- krilla ensures the Alternate space in Separation color spaces obeys the restrictions
|
||||
in the applicable clauses 🟢
|
||||
diff --git a/src/interchange/metadata.rs b/src/interchange/metadata.rs
|
||||
index 18dde72..4cfc8e5 100644
|
||||
--- a/src/interchange/metadata.rs
|
||||
|
||||
+10
-4
@@ -54,7 +54,8 @@ with an even number of characters and without whitespaces. 🟢
|
||||
- krilla does check the maximum entries of a dictionary. 🟢
|
||||
- krilla fails export if more than 8388607 indirect objects exist. 🟢
|
||||
- krilla fails export if a higher nesting-level than 28 exists. 🔵
|
||||
- krilla does not use the DeviceN color space. 🟢
|
||||
- krilla fails export if a DeviceN color space is used (see 6.2.3.4), so the limit of 8
|
||||
DeviceN colorants is never reached. 🟢
|
||||
- krilla only uses u16 for CIDs. 🟢
|
||||
|
||||
6.1.13: krilla does not support optional content. 🔵
|
||||
@@ -63,7 +64,10 @@ with an even number of characters and without whitespaces. 🟢
|
||||
|
||||
6.2.2:
|
||||
- krilla always writes a valid output intent. 🟢
|
||||
- krilla always only writes one output intent. 🟢
|
||||
- krilla writes one output intent, or with `SerializeSettings::output_intent` two
|
||||
(`GTS_PDFA1` and `GTS_PDFX`) that name the same destination profile object. 🟢
|
||||
- krilla checks only that a profile given in `SerializeSettings::output_intent` has four
|
||||
components; that it is an output (`prtr`) profile is up to the caller. 🟣
|
||||
|
||||
6.2.3.1: krilla overrides the `no_device_cs` property if PDF/A is selected, and
|
||||
in case CMYK is used but no profile was provided, export fails. 🟢
|
||||
@@ -72,7 +76,8 @@ in case CMYK is used but no profile was provided, export fails. 🟢
|
||||
- sRGB/sGrey ICC profiles conform to ICC v2 specification. 🟢
|
||||
|
||||
6.2.4.3:
|
||||
- krilla always uses sRGB for RGB, and in addition also embeds an sRGB output intent. 🟢
|
||||
- krilla always uses sRGB for RGB, with an sRGB output intent unless
|
||||
`SerializeSettings::output_intent` gives a CMYK one. 🟢
|
||||
- krilla always uses sGrey (except for encoding the alpha channel in images, where DeviceGray
|
||||
is required), and in addition always embeds an output intent. 🟢
|
||||
- krilla always uses an CMYK ICC profile, and always sets CMYK as the output intent. 🟢
|
||||
@@ -81,7 +86,8 @@ in case CMYK is used but no profile was provided, export fails. 🟢
|
||||
6.2.3.4:
|
||||
- krilla ensures the Alternate space in Separation color spaces obeys the restrictions
|
||||
in the applicable clauses 🟢
|
||||
- krilla does not support DeviceN color spaces. 🔵
|
||||
- krilla fails export if a DeviceN color space is used: its tint transform is a PostScript
|
||||
calculator function (`ValidationError::ContainsPostScript`). 🟢
|
||||
|
||||
6.2.4:
|
||||
- krilla does not use the `Alternates`/`Intent` keys for images. 🔵
|
||||
|
||||
+11
-3
@@ -60,7 +60,13 @@ user enables `ascii_compatible`, we still write a binary header marker. 🟢
|
||||
- krilla doesn't use the `ri` or `i` operator. 🟢
|
||||
- krilla ensure that content stream has their own associated resource dictionary. 🟢
|
||||
|
||||
6.2.3: krilla always write an `sRGB` output intent for PDF/A. 🟢
|
||||
6.2.3:
|
||||
- krilla writes an `sRGB` output intent for PDF/A, or the CMYK profile given in
|
||||
`SerializeSettings::output_intent`. 🟢
|
||||
- krilla writes one output intent, or with `SerializeSettings::output_intent` two
|
||||
(`GTS_PDFA1` and `GTS_PDFX`) that name the same destination profile object. 🟢
|
||||
- krilla checks only that a profile given in `SerializeSettings::output_intent` has four
|
||||
components; that it is an output (`prtr`) profile is up to the caller. 🟣
|
||||
|
||||
6.2.4.1: krilla overrides the `no_device_cs` property if PDF/A is selected, and
|
||||
in case CMYK is used but no profile was provided, export fails.
|
||||
@@ -71,7 +77,8 @@ in case CMYK is used but no profile was provided, export fails.
|
||||
all CMYK is ICCBased in this mode. 🟢
|
||||
|
||||
6.2.4.3:
|
||||
- krilla always uses sRGB for RGB, and in addition also embeds an sRGB output intent. 🟢
|
||||
- krilla always uses sRGB for RGB, with an sRGB output intent unless
|
||||
`SerializeSettings::output_intent` gives a CMYK one. 🟢
|
||||
- krilla always uses sGrey (except for encoding the alpha channel in images, where DeviceGray
|
||||
is required), and in addition always embeds an output intent. 🟢
|
||||
- krilla always uses an CMYK ICC profile, and always sets CMYK as the output intent. 🟢
|
||||
@@ -80,7 +87,8 @@ in case CMYK is used but no profile was provided, export fails.
|
||||
6.2.4.4:
|
||||
- krilla ensures the Alternate space in Separation color spaces obeys the restrictions
|
||||
in the applicable clauses 🟢
|
||||
- krilla does not support DeviceN color spaces. 🔵
|
||||
- krilla fails export if a DeviceN color space is used: its tint transform is a PostScript
|
||||
calculator function (`ValidationError::ContainsPostScript`). 🟢
|
||||
- krilla fails export if a Separation colorant is associated with multiple different
|
||||
fallback color spaces 🟢
|
||||
- krilla manages the `tintTransform` function and will always write the same function for
|
||||
|
||||
+13
-6
@@ -59,22 +59,29 @@ See `README.md` for the meaning of each color.
|
||||
### 6.2.3 Output intent
|
||||
- krilla always writes the output intent for this export mode. 🟢
|
||||
- krilla does not use the `DestOutputProfileRef` attribute. 🟢
|
||||
- krilla does not write multiple output intents (since PDF/X and PDF/E are not supported). 🟢
|
||||
- krilla only uses a Display ICC profile for output intent. 🟢
|
||||
- krilla only uses RGB for output intents. 🟢
|
||||
- krilla writes one output intent, or with `SerializeSettings::output_intent` two
|
||||
(`GTS_PDFA1` and `GTS_PDFX`) that name the same destination profile object. 🟢
|
||||
- krilla uses the sRGB display profile for the output intent, or the CMYK profile given in
|
||||
`SerializeSettings::output_intent`. 🟢
|
||||
- krilla checks only that a profile given in `SerializeSettings::output_intent` has four
|
||||
components; that it is an output (`prtr`) profile is up to the caller. 🟣
|
||||
|
||||
### 6.2.4 Colour spaces
|
||||
- krilla only uses device-independent colors in this export mode. 🟢
|
||||
- krilla uses compatible ICC profiles. 🟢
|
||||
- krilla fails export if overprint mode 1 is combined with fill or stroke overprint, since
|
||||
all CMYK is ICCBased in this mode. 🟢
|
||||
- krilla never uses CMYK profiles as the destination profile. 🟢
|
||||
- krilla uses a CMYK profile as the destination profile only when
|
||||
`SerializeSettings::output_intent` gives one. 🟢
|
||||
- krilla does not use device color spaces in this mode. 🟢
|
||||
- krilla ensures the Alternate space in Separation color spaces obeys the restrictions
|
||||
in the applicable clauses 🟢
|
||||
- krilla does not support DeviceN color spaces. 🔵
|
||||
- krilla writes DeviceN color spaces with the CMYK ICC profile as their alternate in this
|
||||
mode. Each spot colorant is also listed under `/Colorants` as a Separation space with the
|
||||
same alternate, and a space mixing spot and process colorants is `/Subtype /NChannel`.
|
||||
The tint transform is a PostScript calculator function, which PDF/A-4 allows. 🟢
|
||||
- krilla fails export if a Separation colorant is associated with multiple different
|
||||
fallback color spaces 🟢
|
||||
fallback color spaces, a DeviceN spot colorant's alternate included 🟢
|
||||
- krilla manages the `tintTransform` function and will always write the same function for
|
||||
the same color space 🟢
|
||||
|
||||
|
||||
Reference in new issue
Block a user