Open flensrocker opened 4 years ago
In addition, I am getting "Spec. ISO_19005_3 clause 6.2.11.3 test 2" ISO 32000-1:2008, 9.7.4, Table 117 requires that all embedded Type 2 CIDFonts in the CIDFont dictionary shall contain a CIDToGIDMap entry that shall be a stream mapping from CIDs to glyph indices or the name Identity, as described in ISO 32000-1:2008, 9.7.4, Table 117. Would be a very easy fix, need to add descendantFontDictionary.Elements.SetName("/CIDToGIDMap", "/Identity"), which is a default anyway.
In reference to https://forum.pdfsharp.net/viewtopic.php?f=4&t=3031
I am evaluating the needed changes to PdfSharp, to create documents compliant to PDF/A-3b. For now I stumble through various specifications with mostly trial&error.
My usecase:
XGraphics
.What I don't want:
Here is, what I have discovered by now, actually the code changes are not in a good shape, because frist I want to create a valid document somehow, and not in a robust way...
Think of it as some random notes, so they want get lost.
PDF Version
Must be 1.7 (as far as I know)
XMP Metadata changes
Replace old metadata in
PdfMetadata.cs
with this:No interactive elements allowed
So I think, everything around AcroForms must not be used. Since I only create "printable" documents without any of this functionality, I just ignore them. For a "real" solution, PdfSharp should throw an error, if you try to use something not valid to PDF/A.
Catalog improvements
The catalog must include an
/OutputIntents
array with at least one/Type /OutputIntent /S /GTS_PDFA1 /OutputConditionIdentifier (sRGB2014) /DestOutputProfile ...
where theDestOutputProfile
is an embeded ICC color profile. I use the "sRGB2014.icc" from http://www.color.org/srgbprofiles.xalterThe ICC must be a stream object with
/N 3 /Alternate /DeviceRGB /Filter /FlateDecode /Length ...
.Link Annotation
Weblinks must have a key
/F 4
, I don't really know, why. It seems some "printable" link annotation.With these changes the various validators, e.g. veraPDF, declare my generated document as "compliant".
For ZUGFeRD there are some changes needed on attachments like
/Relationship
and an/AF
array (associated files) and other things. That's next on my list...Here some code dumps, if anyone is interested. It isn't clean, it's not beautiful, but it works...
Additions to
PdfCatalog.cs
PdfLinkAnnotation.cs
If I will come to a point where I can submit a pull request, I will do...