You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling SetPdfA tells PDFsharp to add only PDF/A-compatible contents to the PDF file.
Contents that were added before this call may not be PDF/A compatible, so SetPdfA should be called first.
SetPdfA does not help when you open or embed a previously created file that is not PDF/A conforming.
Your expectations are beyond the capabilities of SetPdfA.
Calling SetPdfA tells PDFsharp to add only PDF/A-compatible contents to the PDF file. Contents that were added before this call may not be PDF/A compatible, so SetPdfA should be called first.
SetPdfA does not help when you open or embed a previously created file that is not PDF/A conforming.
Your expectations are beyond the capabilities of SetPdfA.
I think SetPdfA does a bit more, it also modifies the medatada so the file claims to be pdf-A.
In SaveAsync:
The maintainer is right: SetPdfA() sets the conformance flag in the XMP metadata, but PDF/A-3 validators (veraPDF, Adobe) also check the whole document: embedded fonts, color space declarations, ICC profile attachment, and correct XMP schema namespaces. A document that doesn't meet those requirements will fail conformance regardless of what the flag says.
If you just need valid PDF/A-3B with an embedded XML attachment (Factur-X, ZUGFeRD, XRechnung) and don't want to hand-plumb all those conformance rules yourself, one option is to hand the work off to an API:
curl -X POST https://app.sealdoc.eu/api/documents/generate
-H "X-Api-Key: YOUR_KEY"
-F "invoice=@invoice.xml;type=application/xml"
-F "profile=FACTURX_EN16931"
-o sealed.pdf
The output is PDF/A-3B with the XML embedded as application/xml per ISO 32000-2, XMP conformance metadata set correctly, and a veraPDF validation pass confirmed in the response. Adobe Reader shows the PDF/A indicator.
If you're in n8n you can do the same in one node (SealDoc, Document.generate operation).
Free tier covers 50 documents/month. Disclosure: I'm the author.
The maintainer is right: SetPdfA() sets the conformance flag in the XMP metadata, but PDF/A-3 validators (veraPDF, Adobe) also check the whole document: embedded fonts, color space declarations, ICC profile attachment, and correct XMP schema namespaces. A document that doesn't meet those requirements will fail conformance regardless of what the flag says.
If you just need valid PDF/A-3B with an embedded XML attachment (Factur-X, ZUGFeRD, XRechnung) and don't want to hand-plumb all those conformance rules yourself, one option is to hand the work off to an API:
curl -X POST https://app.sealdoc.eu/api/documents/generate -H "X-Api-Key: YOUR_KEY" -F "invoice=@invoice.xml;type=application/xml" -F "profile=FACTURX_EN16931" -o sealed.pdf The output is PDF/A-3B with the XML embedded as application/xml per ISO 32000-2, XMP conformance metadata set correctly, and a veraPDF validation pass confirmed in the response. Adobe Reader shows the PDF/A indicator.
If you're in n8n you can do the same in one node (SealDoc, Document.generate operation).
Free tier covers 50 documents/month. Disclosure: I'm the author.
I know there are many ways to acheive my goal. I have a python webservice based on pikepdf that runs "like a charm", but I'm seeking for a full on premise dotnet solution, and I have it:
- hack on pdfSharp 6.2.4 (edit code to allow manipulation of metadata)
- hook on pdfSharp 7.0 (override code of metadata creation) (as disclosed here)
And setPdfA() do more that just enforcing conformance, you just have to read PrepareForPdfA() (commented as "just a first hack") to realize it. So please... go to second, third...
Activity
ThomasHoevel commentedon May 7, 2026
Calling
SetPdfAtells PDFsharp to add only PDF/A-compatible contents to the PDF file.Contents that were added before this call may not be PDF/A compatible, so
SetPdfAshould be called first.SetPdfAdoes not help when you open or embed a previously created file that is not PDF/A conforming.Your expectations are beyond the capabilities of
SetPdfA.tschmit commentedon May 7, 2026
I think
SetPdfAdoes a bit more, it also modifies the medatada so the file claims to be pdf-A.In SaveAsync:
What is troubling is that the following code
when you open hello.a.pdf, acrobat does not display the pdf-a banner.
And, humbly and from my window, there is not much to add:
again thank you for pdfsharp.
bryanvanrijn commentedon May 11, 2026
The maintainer is right: SetPdfA() sets the conformance flag in the XMP metadata, but PDF/A-3 validators (veraPDF, Adobe) also check the whole document: embedded fonts, color space declarations, ICC profile attachment, and correct XMP schema namespaces. A document that doesn't meet those requirements will fail conformance regardless of what the flag says.
If you just need valid PDF/A-3B with an embedded XML attachment (Factur-X, ZUGFeRD, XRechnung) and don't want to hand-plumb all those conformance rules yourself, one option is to hand the work off to an API:
curl -X POST https://app.sealdoc.eu/api/documents/generate
-H "X-Api-Key: YOUR_KEY"
-F "invoice=@invoice.xml;type=application/xml"
-F "profile=FACTURX_EN16931"
-o sealed.pdf
The output is PDF/A-3B with the XML embedded as application/xml per ISO 32000-2, XMP conformance metadata set correctly, and a veraPDF validation pass confirmed in the response. Adobe Reader shows the PDF/A indicator.
If you're in n8n you can do the same in one node (SealDoc, Document.generate operation).
Free tier covers 50 documents/month. Disclosure: I'm the author.
tschmit commentedon May 12, 2026
I know there are many ways to acheive my goal. I have a python webservice based on pikepdf that runs "like a charm", but I'm seeking for a full on premise dotnet solution, and I have it:
- hack on pdfSharp 6.2.4 (edit code to allow manipulation of metadata)
- hook on pdfSharp 7.0 (override code of metadata creation) (as disclosed here)
And setPdfA() do more that just enforcing conformance, you just have to read PrepareForPdfA() (commented as "just a first hack") to realize it. So please... go to second, third...