Adobe Acrobat does not render SVG
Adobe Acrobat does not render and complains with the following error if we open svg_example.pdf generated by example/svg.rs, though browsers render it.
As far as I have investigated, this is caused by the following ColorSpace resource being defined incorrectly.
https://github.com/fschutt/printpdf/blob/ac411a8ef7b30ea20924c258d655d5baefd9ec45/src/svg.rs#L85-L95
It should be defined something like below.
https://github.com/kyasu1/printpdf/blob/2cca445ddbcb672a0f8d75e9cb717431f11ca644/src/svg.rs#L85-L102
(
"Resources",
DictItem::Dict {
map: [(
"ColorSpace".to_string(),
DictItem::Dict {
map: [(
"cs0".to_string(),
DictItem::Name(ColorSpace::Rgb.as_string().into()),
)]
.into_iter()
.collect(),
},
)]
.into_iter()
.collect(),
},
),
With this modification, the pdf is rendered as expected.
However, the error dialog is still shown. It is caused by the camera svg which contains unsupportedPattern and Shading resources. Supporting them is another story.
Anyway, hardcoding the name cs0 is not the correct approach. Instead, we need to figure out how to look up all ColorSpaces defined in the PDF file.
Yeah, I didn't want to do proper color management for this release.