diff options
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 39 | ||||
-rw-r--r-- | filter/source/pdf/impdialog.hxx | 5 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 3 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.hxx | 1 | ||||
-rw-r--r-- | filter/source/pdf/pdffilter.cxx | 1 | ||||
-rw-r--r-- | filter/uiconfig/ui/pdfgeneralpage.ui | 22 | ||||
-rw-r--r-- | include/vcl/pdfwriter.hxx | 4 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 14 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 6 |
9 files changed, 78 insertions, 17 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 477098a85114..d19458a00e4d 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -186,6 +186,8 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, Sequence< PropertyValue mbUseTaggedPDFUserSelection = mbUseTaggedPDF; mnPDFTypeSelection = maConfigItem.ReadInt32( "SelectPdfVersion", 0 ); + mbPDFUACompliance = maConfigItem.ReadBool("PDFUACompliance", false); + if ( mbIsPresentation ) { mbExportNotesPages = maConfigItem.ReadBool( "ExportNotesPages", false ); @@ -368,10 +370,14 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() maConfigItem.WriteBool( "ReduceImageResolution", mbReduceImageResolution ); maConfigItem.WriteInt32("MaxImageResolution", mnMaxImageResolution ); - // always write the user selection, never the overridden PDF/A value + // always write the user selection, never the overridden value + const bool bIsPDFUA = mbPDFUACompliance; const bool bIsPDFA = (1 == mnPDFTypeSelection) || (2 == mnPDFTypeSelection); - maConfigItem.WriteBool("UseTaggedPDF", bIsPDFA ? mbUseTaggedPDFUserSelection : mbUseTaggedPDF); + const bool bUserSelectionTags = bIsPDFA || bIsPDFUA; + maConfigItem.WriteBool("UseTaggedPDF", bUserSelectionTags ? mbUseTaggedPDFUserSelection : mbUseTaggedPDF); + maConfigItem.WriteInt32("SelectPdfVersion", mnPDFTypeSelection ); + maConfigItem.WriteBool("PDFUACompliance", mbPDFUACompliance); if ( mbIsPresentation ) { @@ -471,6 +477,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC , mxCbPDFA(m_xBuilder->weld_check_button("pdfa")) , mxRbPDFA1b(m_xBuilder->weld_radio_button("pdfa1")) , mxRbPDFA2b(m_xBuilder->weld_radio_button("pdfa2")) + , mxCbPDFUA(m_xBuilder->weld_check_button("pdfua")) , mxCbTaggedPDF(m_xBuilder->weld_check_button("tagged")) , mxCbExportFormFields(m_xBuilder->weld_check_button("forms")) , mxFormsFrame(m_xBuilder->weld_widget("formsframe")) @@ -540,7 +547,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) mxCbWatermark->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleWatermarkHdl ) ); mxFtWatermark->set_sensitive(false ); mxEdWatermark->set_sensitive( false ); - mxCbPDFA->connect_toggled(LINK(this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl)); + mxCbPDFA->connect_toggled(LINK(this, ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHandle)); const bool bIsPDFA = (1 == pParent->mnPDFTypeSelection) || (2 == pParent->mnPDFTypeSelection); mxCbPDFA->set_active(bIsPDFA); @@ -556,13 +563,18 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) mxRbPDFA2b->set_active(true); break; } - // the ToggleExportPDFAHdl handler will read or write the *UserSelection based + + const bool bIsPDFUA = pParent->mbPDFUACompliance; + mxCbPDFUA->set_active(bIsPDFUA); + mxCbPDFUA->connect_toggled(LINK(this, ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHandle)); + + // the TogglePDFVersionOrUniversalAccessibilityHandle handler will read or write the *UserSelection based // on the mxCbPDFA (= bIsPDFA) state, so we have to prepare the correct input state. - if (bIsPDFA) + if (bIsPDFA || bIsPDFUA) mxCbTaggedPDF->set_active(pParent->mbUseTaggedPDFUserSelection); else mbUseTaggedPDFUserSelection = pParent->mbUseTaggedPDFUserSelection; - ToggleExportPDFAHdl( *mxCbPDFA ); + TogglePDFVersionOrUniversalAccessibilityHandle(*mxCbPDFA); mxCbExportFormFields->set_active(pParent->mbExportFormFields); mxCbExportFormFields->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleExportFormFieldsHdl ) ); @@ -675,14 +687,20 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* pParent ) pParent->mbUseTaggedPDF = mxCbTaggedPDF->get_active(); const bool bIsPDFA = mxCbPDFA->get_active(); + const bool bIsPDFUA = mxCbPDFUA->get_active(); + if (bIsPDFA) { pParent->mnPDFTypeSelection = 2; if( mxRbPDFA1b->get_active() ) pParent->mnPDFTypeSelection = 1; } - else + + pParent->mbPDFUACompliance = bIsPDFUA; + + if (!bIsPDFA && !bIsPDFUA) mbUseTaggedPDFUserSelection = pParent->mbUseTaggedPDF; + pParent->mbUseTaggedPDFUserSelection = mbUseTaggedPDFUserSelection; pParent->mbExportFormFields = mxCbExportFormFields->get_active(); @@ -784,20 +802,21 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleAddStreamHdl, weld::ToggleButton&, v } } -IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl, weld::ToggleButton&, void) +IMPL_LINK_NOARG(ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHandle, weld::ToggleButton&, void) { const bool bIsPDFA = mxCbPDFA->get_active(); + const bool bIsPDFUA = mxCbPDFUA->get_active(); // set the security page status (and its controls as well) ImpPDFTabSecurityPage* pSecPage = mpParent ? mpParent->getSecurityPage() : nullptr; if (pSecPage) pSecPage->ImplPDFASecurityControl(!bIsPDFA); - mxCbTaggedPDF->set_sensitive(!bIsPDFA); + mxCbTaggedPDF->set_sensitive(!bIsPDFA && !bIsPDFUA); mxRbPDFA1b->set_sensitive(bIsPDFA); mxRbPDFA2b->set_sensitive(bIsPDFA); - if (bIsPDFA) + if (bIsPDFA || bIsPDFUA) { // store the users selection of subordinate controls and set required PDF/A values mbUseTaggedPDFUserSelection = mxCbTaggedPDF->get_active(); diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index f3599f6587ec..52a37ad5cf4a 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -78,6 +78,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController bool mbUseTaggedPDF; bool mbUseTaggedPDFUserSelection; sal_Int32 mnPDFTypeSelection; + bool mbPDFUACompliance; bool mbExportNotes; bool mbViewPDF; bool mbUseReferenceXObject; @@ -189,6 +190,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage std::unique_ptr<weld::CheckButton> mxCbPDFA; std::unique_ptr<weld::RadioButton> mxRbPDFA1b; std::unique_ptr<weld::RadioButton> mxRbPDFA2b; + std::unique_ptr<weld::CheckButton> mxCbPDFUA; std::unique_ptr<weld::CheckButton> mxCbTaggedPDF; std::unique_ptr<weld::CheckButton> mxCbExportFormFields; std::unique_ptr<weld::Widget> mxFormsFrame; @@ -224,8 +226,9 @@ class ImpPDFTabGeneralPage : public SfxTabPage void TogglePagesHdl(); void EnableExportNotesPages(); + DECL_LINK(TogglePDFVersionOrUniversalAccessibilityHandle, weld::ToggleButton&, void); + public: - DECL_LINK(ToggleExportPDFAHdl, weld::ToggleButton&, void); ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); virtual ~ImpPDFTabGeneralPage() override; diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index d00e371338b4..00e279047f73 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -80,6 +80,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, mxIH ( rxIH ), mbUseTaggedPDF ( false ), mnPDFTypeSelection ( 0 ), + mbPDFUACompliance ( false), mbExportNotes ( true ), mbExportPlaceholders ( false ), mbUseReferenceXObject ( false ), @@ -473,6 +474,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& rFilterData[ nData ].Value >>= mbUseTaggedPDF; else if ( rFilterData[ nData ].Name == "SelectPdfVersion" ) rFilterData[ nData ].Value >>= mnPDFTypeSelection; + else if ( rFilterData[ nData ].Name == "PDFUACompliance" ) + rFilterData[ nData ].Value >>= mbPDFUACompliance; else if ( rFilterData[ nData ].Name == "ExportNotes" ) rFilterData[ nData ].Value >>= mbExportNotes; else if ( rFilterData[ nData ].Name == "ExportNotesPages" ) diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 426416628e24..54784cce1abb 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -52,6 +52,7 @@ private: bool mbUseTaggedPDF; sal_Int32 mnPDFTypeSelection; + bool mbPDFUACompliance; bool mbExportNotes; bool mbExportPlaceholders; bool mbUseReferenceXObject; diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index 5dfb9396a590..5a7e5fbaedf0 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -84,6 +84,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) aCfgItem.ReadInt32( "MaxImageResolution", 300 ); aCfgItem.ReadBool( "UseTaggedPDF", false ); aCfgItem.ReadInt32( "SelectPdfVersion", 0 ); + aCfgItem.ReadBool("PDFUACompliance", false); aCfgItem.ReadBool( "ExportNotes", false ); aCfgItem.ReadBool( "ExportPlaceholders", false ); aCfgItem.ReadBool( "ExportNotesPages", false ); diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui index 3d59a633b027..1fbde5ceb6f4 100644 --- a/filter/uiconfig/ui/pdfgeneralpage.ui +++ b/filter/uiconfig/ui/pdfgeneralpage.ui @@ -473,7 +473,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -489,7 +489,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -554,7 +554,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -631,6 +631,22 @@ <property name="top_attach">1</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="pdfua"> + <property name="label" translatable="yes" context="pdfgeneralpage|pdfua">U_niversal Accessibility (PDF/UA)</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes" context="pdfgeneralpage|pdfua|tooltip_text">Creates an universal accessibility compliant PDF file that follows the requirements of PDF/UA (ISO 14289) specifications.</property> + <property name="halign">start</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> </object> </child> </object> diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index 47d2528aa460..c68feba88f93 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -552,6 +552,10 @@ The following structure describes the permissions used in PDF security /* decides the PDF language level to be produced */ PDFVersion Version; + + /* PDF/UA compliance */ + bool UniversalAccessibilityCompliance; + /* valid for PDF >= 1.4 causes the MarkInfo entry in the document catalog to be set */ diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index c8bdec0fd74e..675f173e5b36 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5331,6 +5331,14 @@ <value>0</value> </prop> <!-- END PDF Version selection --> + <!-- PDF/UA Compliance --> + <prop oor:name="PDFUACompliance" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Specifies if the document is PDF/UA (Universal Accessibility) compliant</desc> + </info> + <value>false</value> + </prop> + <!-- END PDF/UA Compliance --> <!-- PDF Relative Link --> <prop oor:name="ExportLinksRelativeFsys" oor:type="xs:boolean" oor:nillable="false"> <info> @@ -5452,9 +5460,9 @@ <prop oor:name="UseWebDAVFileLocking" oor:type="xs:boolean" oor:nillable="false"> <info> <desc>Determines if WebDAV-specific file locking is used for documents - on WebDAV shares. It is not recommended to set this option to 'false' in - scenarios where multi-user, concurrent read/write access to WebDAV share - is required</desc> + on WebDAV shares. It is not recommended to set this option to 'false' in + scenarios where multi-user, concurrent read/write access to WebDAV share + is required</desc> </info> <value>true</value> </prop> diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index e55efc180bb3..51a78f8f8efa 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1398,6 +1398,12 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal if( m_bIsPDF_A2 ) m_aContext.Version = PDFWriter::PDFVersion::PDF_1_6; //we could even use 1.7 features + if (m_aContext.UniversalAccessibilityCompliance) + { + m_bIsPDF_UA = true; + m_aContext.Tagged = true; + } + if( m_aContext.DPIx == 0 || m_aContext.DPIy == 0 ) SetReferenceDevice( VirtualDevice::RefDevMode::PDF1 ); else |