[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Mar 17 19:21:37 UTC 2019
vcl/source/gdi/pdfwriter_impl.cxx | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit 4859d0b6cee9477ab65e86923e7c0a0b88022d8e
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Fri Mar 15 09:47:45 2019 +0100
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sun Mar 17 20:21:15 2019 +0100
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
Reviewed-on: https://gerrit.libreoffice.org/69295
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index ba3ae2a9c2f8..e7a22e69ef56 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -4489,6 +4489,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)
More information about the Libreoffice-commits
mailing list