summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2019-03-11 04:01:47 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-03-16 23:44:44 +0100
commited4a0eed82e2f29e8163a445db992d22c6d07134 (patch)
tree25af42b6a0b438def76f2227ee2595f66e2bf06a /filter
parent6907cbd0f8e198a0f1810b1a07f552a47c9da660 (diff)
tdf#62728 add PDF/A-2 support, change UI default to use that
There was not much missing to make LibreOffice export valid PDF/A-2, so let's add that, and switch the UI to use that instead of A-1. The old PDF/A-1 feature is still accessible via UNO / filter parameter 'SelectPdfVersion': - 1 gives you PDF/A-1a - 2 gives you PDF/A-2b - 16 gives you PDF 1.6 Change-Id: Iea4262b119bcf33b75f3d1406cc793bdcaec65d1 Reviewed-on: https://gerrit.libreoffice.org/69294 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/impdialog.cxx30
-rw-r--r--filter/source/pdf/impdialog.hxx4
-rw-r--r--filter/source/pdf/pdfexport.cxx7
-rw-r--r--filter/uiconfig/ui/pdfgeneralpage.ui4
4 files changed, 26 insertions, 19 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 5183f6deb350..50d846914ab6 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -462,7 +462,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(TabPageParent pParent, const SfxItemS
, mxNfQuality(m_xBuilder->weld_metric_spin_button("quality", FieldUnit::PERCENT))
, mxCbReduceImageResolution(m_xBuilder->weld_check_button("reduceresolution"))
, mxCoReduceImageResolution(m_xBuilder->weld_combo_box("resolution"))
- , mxCbPDFA1b(m_xBuilder->weld_check_button("pdfa"))
+ , mxCbPDFA2b(m_xBuilder->weld_check_button("pdfa"))
, mxCbTaggedPDF(m_xBuilder->weld_check_button("tagged"))
, mxCbExportFormFields(m_xBuilder->weld_check_button("forms"))
, mxFormsFrame(m_xBuilder->weld_widget("formsframe"))
@@ -530,16 +530,16 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mxCbWatermark->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleWatermarkHdl ) );
mxFtWatermark->set_sensitive(false );
mxEdWatermark->set_sensitive( false );
- mxCbPDFA1b->connect_toggled(LINK(this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl));
+ mxCbPDFA2b->connect_toggled(LINK(this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl));
switch( pParent->mnPDFTypeSelection )
{
default:
- case 0: mxCbPDFA1b->set_active( false ); // PDF 1.5
+ mxCbPDFA2b->set_active( false ); // PDF 1.5
break;
- case 1: mxCbPDFA1b->set_active(true); // PDF/A-1a
+ case 2: mxCbPDFA2b->set_active(true); // PDF/A-2a
break;
}
- ToggleExportPDFAHdl( *mxCbPDFA1b );
+ ToggleExportPDFAHdl( *mxCbPDFA2b );
mxCbExportFormFields->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleExportFormFieldsHdl ) );
@@ -547,7 +547,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mbTaggedPDFUserSelection = pParent->mbUseTaggedPDF;
mbExportFormFieldsUserSelection = pParent->mbExportFormFields;
- if( !mxCbPDFA1b->get_active() )
+ if( !mxCbPDFA2b->get_active() )
{
// the value for PDF/A set by the ToggleExportPDFAHdl method called before
mxCbTaggedPDF->set_active( mbTaggedPDFUserSelection );
@@ -643,9 +643,9 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* pParent )
}
pParent->mnPDFTypeSelection = 0;
- if( mxCbPDFA1b->get_active() )
+ if( mxCbPDFA2b->get_active() )
{
- pParent->mnPDFTypeSelection = 1;
+ pParent->mnPDFTypeSelection = 2;
pParent->mbUseTaggedPDF = mbTaggedPDFUserSelection;
pParent->mbExportFormFields = mbExportFormFieldsUserSelection;
}
@@ -759,11 +759,11 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl, weld::ToggleButton&,
ImpPDFTabSecurityPage* pSecPage = mpParent ? mpParent->getSecurityPage() : nullptr;
if (pSecPage)
{
- pSecPage->ImplPDFASecurityControl(!mxCbPDFA1b->get_active());
+ pSecPage->ImplPDFASecurityControl(!mxCbPDFA2b->get_active());
}
// PDF/A-1 needs tagged PDF, so force disable the control, will be forced in pdfexport.
- bool bPDFA1Sel = mxCbPDFA1b->get_active();
+ bool bPDFA1Sel = mxCbPDFA2b->get_active();
mxFormsFrame->set_sensitive(bPDFA1Sel);
if(bPDFA1Sel)
{
@@ -784,14 +784,14 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl, weld::ToggleButton&,
mxCbExportFormFields->set_sensitive(true);
}
- // PDF/A-1 doesn't allow launch action, so enable/disable the selection on
+ // PDF/A-2 doesn't allow launch action, so enable/disable the selection on
// Link page
ImpPDFTabLinksPage* pLinksPage = mpParent ? mpParent->getLinksPage() : nullptr;
if (pLinksPage)
- pLinksPage->ImplPDFALinkControl(!mxCbPDFA1b->get_active());
+ pLinksPage->ImplPDFALinkControl(!mxCbPDFA2b->get_active());
// if a password was set, inform the user that this will not be used in PDF/A case
- if( mxCbPDFA1b->get_active() && pSecPage && pSecPage->hasPassword() )
+ if( mxCbPDFA2b->get_active() && pSecPage && pSecPage->hasPassword() )
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xContainer.get(),
VclMessageType::Warning, VclButtonsType::Ok,
@@ -1347,11 +1347,11 @@ void ImpPDFTabLinksPage::SetFilterConfigItem( const ImpPDFTabDialog* pParent )
// now check the status of PDF/A selection
// and set the link action accordingly
- // PDF/A-1 doesn't allow launch action on links
+ // PDF/A-2 doesn't allow launch action on links
ImpPDFTabGeneralPage* pGeneralPage = pParent->getGeneralPage();
if (pGeneralPage)
- ImplPDFALinkControl(!pGeneralPage->mxCbPDFA1b->get_active());
+ ImplPDFALinkControl(!pGeneralPage->mxCbPDFA2b->get_active());
}
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index f54d7147b07a..73b86e779d9b 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -182,7 +182,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage
std::unique_ptr<weld::MetricSpinButton> mxNfQuality;
std::unique_ptr<weld::CheckButton> mxCbReduceImageResolution;
std::unique_ptr<weld::ComboBox> mxCoReduceImageResolution;
- std::unique_ptr<weld::CheckButton> mxCbPDFA1b;
+ std::unique_ptr<weld::CheckButton> mxCbPDFA2b;
std::unique_ptr<weld::CheckButton> mxCbTaggedPDF;
std::unique_ptr<weld::CheckButton> mxCbExportFormFields;
std::unique_ptr<weld::Widget> mxFormsFrame;
@@ -227,7 +227,7 @@ public:
void GetFilterConfigItem(ImpPDFTabDialog* paParent);
void SetFilterConfigItem(ImpPDFTabDialog* paParent);
- bool IsPdfaSelected() const { return mxCbPDFA1b->get_active(); }
+ bool IsPdfaSelected() const { return mxCbPDFA2b->get_active(); }
};
/// Class tab page viewer
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 8710146ba27e..2ca3829db36a 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -601,6 +601,13 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
mbEncrypt = false; // no encryption
xEnc.clear();
break;
+ case 2:
+ aContext.Version = vcl::PDFWriter::PDFVersion::PDF_A_2;
+ mbUseTaggedPDF = true; // force the tagged PDF as well
+ mbRemoveTransparencies = false; // PDF/A-2 does allow transparencies
+ mbEncrypt = false; // no encryption
+ xEnc.clear();
+ break;
case 16:
aContext.Version = vcl::PDFWriter::PDFVersion::PDF_1_6;
break;
diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui
index d7d9ff025545..2443e68ba57a 100644
--- a/filter/uiconfig/ui/pdfgeneralpage.ui
+++ b/filter/uiconfig/ui/pdfgeneralpage.ui
@@ -463,11 +463,11 @@
</child>
<child>
<object class="GtkCheckButton" id="pdfa">
- <property name="label" translatable="yes" context="pdfgeneralpage|pdfa">Archive P_DF/A-1a (ISO 19005-1)</property>
+ <property name="label" translatable="yes" context="pdfgeneralpage|pdfa">Archive P_DF/A-2b (ISO 19005-2)</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|pdfa|tooltip_text">Creates an ISO 19005-1 compliant PDF file, ideal for long-term document preservation</property>
+ <property name="tooltip_text" translatable="yes" context="pdfgeneralpage|pdfa|tooltip_text">Creates an ISO 19005-2 compliant PDF file, ideal for long-term document preservation</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>