filter/source/pdf/impdialog.cxx |    8 ++++++++
 filter/source/pdf/pdfexport.cxx |    3 +++
 2 files changed, 11 insertions(+)

New commits:
commit 5af5a1f5f85f245e42eae5fd15113e24e1439f7c
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Mar 13 18:31:50 2023 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Mar 16 11:43:08 2023 +0000

    filter: PDF export/PDF dialog: PDF/UA requires P bit 10 enabled
    
    Adapt dialog and export filter to ensure the bit is set:
    
      7.16 Security
      An encrypted conforming file shall contain a P key in its encryption
      dictionary (ISO 32000-1:2008, 7.6.3.2, Table 21). The 10th bit
      position of the P key shall be true.
    
    Change-Id: I2e8e4f5b0ef44efeabf3017f2e12b58914e93520
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148802
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 77ed21da161833a1045c451c99806978a00ec5f9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148856
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 62e633a4deea..774e378be192 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1285,12 +1285,20 @@ IMPL_LINK_NOARG(ImpPDFTabSecurityPage, 
ClickmaPbSetPwdHdl, weld::Button&, void)
 void ImpPDFTabSecurityPage::enablePermissionControls()
 {
     bool bIsPDFASel = false;
+    bool bIsPDFUASel = false;
     ImpPDFTabDialog* pParent = 
static_cast<ImpPDFTabDialog*>(GetDialogController());
     ImpPDFTabGeneralPage* pGeneralPage = pParent ? pParent->getGeneralPage() : 
nullptr;
     if (pGeneralPage)
     {
         bIsPDFASel = pGeneralPage->IsPdfaSelected();
+        bIsPDFUASel = pGeneralPage->IsPdfUaSelected();
     }
+    // ISO 14289-1:2014, Clause: 7.16
+    if (bIsPDFUASel)
+    {
+        mxCbEnableAccessibility->set_active(true);
+    }
+    mxCbEnableAccessibility->set_sensitive(!bIsPDFUASel);
     if (bIsPDFASel)
     {
         mxUserPwdPdfa->show();
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 8ae9e6fee2b8..f9e495f9254c 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -711,7 +711,10 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
             aContext.UniversalAccessibilityCompliance = mbPDFUACompliance;
             if (mbPDFUACompliance)
             {
+                // ISO 14289-1:2014, Clause: 7.1
                 mbUseTaggedPDF = true;
+                // ISO 14289-1:2014, Clause: 7.16
+                mbCanExtractForAccessibility = true;
             }
 
             // copy in context the values default in the constructor or set by 
the FilterData sequence of properties

Reply via email to