filter/source/pdf/impdialog.cxx | 18 ++++++++++++++++++ vcl/source/gdi/pdfwriter_impl.cxx | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-)
New commits: commit f9d61250208d4aff335c3cc4d6a12563db425efb Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Thu Feb 20 23:29:56 2025 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sat Feb 22 04:02:09 2025 +0100 pdf: enable PDF/UA only when writing PDF version 1.7 or 2.0 PDF/UA-1 should be used only with PDF 1.7 and PDF/UA-2 with PDF 2.0. PDF/A-1 can't be used with PDF/UA as it's base on PDF 1.4, but PDF/A-2, PDF/A-3 (1.7) and PDF/A-4 (2.0) can be used with PDF/UA. Change-Id: I724cde804494b13dca573253e53786b54ff60998 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181947 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index fa1d634d6192..8b06f194012b 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -939,6 +939,24 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleAddStreamHdl, weld::Toggleable&, voi void ImpPDFTabGeneralPage::thePDFVersionChanged() { const bool bIsPDFA = IsPdfaSelected(); + + if (IsPDFAVersionSelected(1)) + { + if (mxCbPDFUA->get_sensitive()) + { + if (mpParent) + mpParent->mbPDFUACompliance = mxCbPDFUA->get_active(); + + mxCbPDFUA->set_active(false); + mxCbPDFUA->set_sensitive(false); + } + } + else if (mpParent && !mxCbPDFUA->get_sensitive()) + { + mxCbPDFUA->set_active(mpParent->mbPDFUACompliance); + mxCbPDFUA->set_sensitive(!mpParent->maConfigItem.IsReadOnly(u"PDFUACompliance"_ustr)); + } + const bool bIsPDFUA = mxCbPDFUA->get_active(); // set the security page status (and its controls as well) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index e7e28ef9f001..ec19541fa08e 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1330,7 +1330,8 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, break; } - if (m_aContext.UniversalAccessibilityCompliance) + // PDF/UA can only be enabled if PDF version is 1.7 (PDF/UA-1) and 2.0 (PDF/UA-2) + if (m_aContext.UniversalAccessibilityCompliance && m_aContext.Version >= PDFWriter::PDFVersion::PDF_1_7) { m_bIsPDF_UA = true; m_aContext.Tagged = true;