summaryrefslogtreecommitdiff
path: root/filter/source/pdf
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@libreoffice.org>2019-09-20 19:01:34 +0200
committerArnaud Versini <arnaud.versini@libreoffice.org>2020-02-08 15:03:07 +0100
commita795886762a6a4aabd601183598c4e6c819bcb1f (patch)
tree93a58d738bf27a0c5f75f80dc7e651763916ee5f /filter/source/pdf
parenta2f62a861ba7036e689070c47f72214b1bdd49d4 (diff)
Add minimum support for PDF/A3
Change-Id: I6ce3a3dbe71df1d3f56279879e3f91bd7c82f784 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84687 Tested-by: Jenkins Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Diffstat (limited to 'filter/source/pdf')
-rw-r--r--filter/source/pdf/impdialog.cxx27
-rw-r--r--filter/source/pdf/impdialog.hxx3
-rw-r--r--filter/source/pdf/pdfexport.cxx7
3 files changed, 22 insertions, 15 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 0fe49d89b9cf..2abce8fdeb08 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -390,10 +390,9 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
// always write the user selection, never the overridden value
const bool bIsPDFUA = mbPDFUACompliance;
- const bool bIsPDFA = (1 == mnPDFTypeSelection) || (2 == mnPDFTypeSelection);
+ const bool bIsPDFA = (1 == mnPDFTypeSelection) || (2 == mnPDFTypeSelection) || (3 == mnPDFTypeSelection);
const bool bUserSelectionTags = bIsPDFA || bIsPDFUA;
maConfigItem.WriteBool("UseTaggedPDF", bUserSelectionTags ? mbUseTaggedPDFUserSelection : mbUseTaggedPDF);
-
maConfigItem.WriteInt32("SelectPdfVersion", mnPDFTypeSelection );
maConfigItem.WriteBool("PDFUACompliance", mbPDFUACompliance);
@@ -493,9 +492,8 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC
, mxCbReduceImageResolution(m_xBuilder->weld_check_button("reduceresolution"))
, mxCoReduceImageResolution(m_xBuilder->weld_combo_box("resolution"))
, 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"))
+ , mxRbPDFAVersion(m_xBuilder->weld_combo_box("pdfaversion"))
, mxCbTaggedPDF(m_xBuilder->weld_check_button("tagged"))
, mxCbExportFormFields(m_xBuilder->weld_check_button("forms"))
, mxFormsFrame(m_xBuilder->weld_widget("formsframe"))
@@ -567,18 +565,19 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mxEdWatermark->set_sensitive( false );
mxCbPDFA->connect_toggled(LINK(this, ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHandle));
- const bool bIsPDFA = (1 == pParent->mnPDFTypeSelection) || (2 == pParent->mnPDFTypeSelection);
+ const bool bIsPDFA = (pParent->mnPDFTypeSelection>=1) && (pParent->mnPDFTypeSelection <= 3);
mxCbPDFA->set_active(bIsPDFA);
switch( pParent->mnPDFTypeSelection )
{
case 1: // PDF/A-1
- mxRbPDFA1b->set_active(true);
- mxRbPDFA2b->set_active(false);
+ mxRbPDFAVersion->set_active_id("1");
break;
case 2: // PDF/A-2
+ mxRbPDFAVersion->set_active_id("2");
+ break;
+ case 3: // PDF/A-3
default: // PDF 1.x
- mxRbPDFA1b->set_active(false);
- mxRbPDFA2b->set_active(true);
+ mxRbPDFAVersion->set_active_id("3");
break;
}
@@ -709,9 +708,12 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* pParent )
if (bIsPDFA)
{
- pParent->mnPDFTypeSelection = 2;
- if( mxRbPDFA1b->get_active() )
+ pParent->mnPDFTypeSelection = 3;
+ OUString currentPDFAMode = mxRbPDFAVersion->get_active_id();
+ if( currentPDFAMode == "1" )
pParent->mnPDFTypeSelection = 1;
+ else if(currentPDFAMode == "2")
+ pParent->mnPDFTypeSelection = 2;
}
pParent->mbPDFUACompliance = bIsPDFUA;
@@ -831,8 +833,7 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHa
pSecPage->ImplPDFASecurityControl(!bIsPDFA);
mxCbTaggedPDF->set_sensitive(!bIsPDFA && !bIsPDFUA);
- mxRbPDFA1b->set_sensitive(bIsPDFA);
- mxRbPDFA2b->set_sensitive(bIsPDFA);
+ mxRbPDFAVersion->set_sensitive(bIsPDFA);
if (bIsPDFA || bIsPDFUA)
{
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 97a7464ffa6d..17fb57890655 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -191,9 +191,8 @@ class ImpPDFTabGeneralPage : public SfxTabPage
std::unique_ptr<weld::CheckButton> mxCbReduceImageResolution;
std::unique_ptr<weld::ComboBox> mxCoReduceImageResolution;
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::ComboBox> mxRbPDFAVersion;
std::unique_ptr<weld::CheckButton> mxCbTaggedPDF;
std::unique_ptr<weld::CheckButton> mxCbExportFormFields;
std::unique_ptr<weld::Widget> mxFormsFrame;
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index a4e4549b631f..758c7e786114 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -607,6 +607,13 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
mbEncrypt = false; // no encryption
xEnc.clear();
break;
+ case 3:
+ aContext.Version = vcl::PDFWriter::PDFVersion::PDF_A_3;
+ mbUseTaggedPDF = true; // force the tagged PDF as well
+ mbRemoveTransparencies = false; // does allow transparencies
+ mbEncrypt = false; // no encryption
+ xEnc.clear();
+ break;
case 16:
aContext.Version = vcl::PDFWriter::PDFVersion::PDF_1_6;
break;