summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2019-03-15 09:47:45 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-05-13 19:51:04 +0200
commitc0a1b698fbe002f33712fe61f485032acaf50e5d (patch)
treeebc430c4ad289857e639247c59e7343f71985bfc
parent32b3c868d863801efe7d9ed8a0a969d6f8503d6c (diff)
tdf#113448 fix PDF forms export
This fixes verapdf A-2 validation error '6.3.3-2 annotation appearance dict is wrong'. Controls that use type /FT/Btn must have sub-dicts as /N content, instead of a direct stream reference. Change-Id: If985644fe3d583e98a0b3a703e4b33dbf652f165
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index cd553e2fe7fe..108f9199ce4f 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -4555,6 +4555,19 @@ bool PDFWriterImpl::emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDi
rAnnotDict.append( "/" );
rAnnotDict.append( dict_item.first );
bool bUseSubDict = (dict_item.second.size() > 1);
+
+ // PDF/A requires sub-dicts for /FT/Btn objects (clause
+ // 6.3.3)
+ if( m_bIsPDF_A1 || m_bIsPDF_A2 )
+ {
+ if( rWidget.m_eType == PDFWriter::RadioButton ||
+ rWidget.m_eType == PDFWriter::CheckBox ||
+ rWidget.m_eType == PDFWriter::PushButton )
+ {
+ bUseSubDict = true;
+ }
+ }
+
rAnnotDict.append( bUseSubDict ? "<<" : " " );
for (auto const& stream_item : dict_item.second)