summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-03-29 09:47:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-03-29 08:46:52 +0000
commit9c944b0d1bff9a0ab1b7e8454c9ac5e7194aa533 (patch)
tree6d87b130ce4138dd371c80406a73d613e566549a /filter
parentae74444cb726494a2497642d7b2da908cd007d35 (diff)
vcl PDF export, norefxobj: add UI for this
Disable the "use reference XObjects" (old behavior) by default, but keep it as an option in case someone wants it. Summary till the help is updated: the old way is simpler code, so it's always correct, but really only Acrobat supports that markup. The new way is supported by all readers, but more complex, so it's more likely it goes wrong. Change-Id: I4769474f29d98412be496a0aa4e8254ae4f0919e Reviewed-on: https://gerrit.libreoffice.org/35826 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/impdialog.cxx5
-rw-r--r--filter/source/pdf/impdialog.hxx2
-rw-r--r--filter/source/pdf/pdfexport.cxx7
-rw-r--r--filter/source/pdf/pdfexport.hxx1
-rw-r--r--filter/uiconfig/ui/pdfgeneralpage.ui17
5 files changed, 28 insertions, 4 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 42af810c9113..8d27a63df4d1 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -83,6 +83,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue >
mbUseTaggedPDF( false ),
mbExportNotes( true ),
mbViewPDF( false ),
+ mbUseReferenceXObject( false ),
mbExportNotesPages( false ),
mbExportOnlyNotesPages( false ),
mbUseTransitionEffects( false ),
@@ -472,6 +473,7 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
aRet.push_back(comphelper::makePropertyValue("SignaturePassword", msSignPassword));
aRet.push_back(comphelper::makePropertyValue("SignatureCertificate", maSignCertificate));
aRet.push_back(comphelper::makePropertyValue("SignatureTSA", msSignTSA));
+ aRet.push_back(comphelper::makePropertyValue("UseReferenceXObject", mbUseReferenceXObject));
return comphelper::concatSequences(maConfigItem.GetFilterData(), comphelper::containerToSequence(aRet));
}
@@ -516,6 +518,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(vcl::Window* pParent, const SfxItemSe
get(mpCbExportEmptyPages, "emptypages");
get(mpCbExportPlaceholders, "exportplaceholders" );
get(mpCbViewPDF, "viewpdf");
+ get(mpCbUseReferenceXObject, "usereferencexobject");
get(mpCbWatermark, "watermark");
get(mpFtWatermark, "watermarklabel");
@@ -552,6 +555,7 @@ void ImpPDFTabGeneralPage::dispose()
mpCbExportHiddenSlides.clear();
mpCbExportNotes.clear();
mpCbViewPDF.clear();
+ mpCbUseReferenceXObject.clear();
mpCbExportNotesPages.clear();
mpCbExportOnlyNotesPages.clear();
mpCbExportEmptyPages.clear();
@@ -689,6 +693,7 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
paParent->mnMaxImageResolution = mpCoReduceImageResolution->GetText().toInt32();
paParent->mbExportNotes = mpCbExportNotes->IsChecked();
paParent->mbViewPDF = mpCbViewPDF->IsChecked();
+ paParent->mbUseReferenceXObject = mpCbUseReferenceXObject->IsChecked();
if ( mbIsPresentation )
{
paParent->mbExportNotesPages = mpCbExportNotesPages->IsChecked();
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index e96062633988..2def0c7ffd83 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -105,6 +105,7 @@ protected:
sal_Int32 mnPDFTypeSelection;
bool mbExportNotes;
bool mbViewPDF;
+ bool mbUseReferenceXObject;
bool mbExportNotesPages;
bool mbExportOnlyNotesPages;
bool mbUseTransitionEffects;
@@ -222,6 +223,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage
VclPtr<CheckBox> mpCbExportHiddenSlides;
VclPtr<CheckBox> mpCbExportNotes;
VclPtr<CheckBox> mpCbViewPDF;
+ VclPtr<CheckBox> mpCbUseReferenceXObject;
VclPtr<CheckBox> mpCbExportNotesPages;
VclPtr<CheckBox> mpCbExportOnlyNotesPages;
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index e341b07f50bf..5be242f870e7 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -47,7 +47,6 @@
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
-#include <officecfg/Office/Common.hxx>
#include "pdfexport.hxx"
#include "impdialog.hxx"
@@ -97,6 +96,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
mbExportNotes ( true ),
mbExportPlaceholders ( false ),
mbViewPDF ( true ),
+ mbUseReferenceXObject ( false ),
mbExportNotesPages ( false ),
mbExportOnlyNotesPages ( false ),
mbUseTransitionEffects ( true ),
@@ -554,6 +554,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
rFilterData[ nData ].Value >>= msSignTSA;
else if ( rFilterData[ nData ].Name == "ExportPlaceholders" )
rFilterData[ nData ].Value >>= mbExportPlaceholders;
+ else if ( rFilterData[ nData ].Name == "UseReferenceXObject" )
+ rFilterData[ nData ].Value >>= mbUseReferenceXObject;
}
aContext.URL = aURL.GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
@@ -777,8 +779,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
aContext.SignPassword = msSignPassword;
aContext.SignCertificate = maSignCertificate;
aContext.SignTSA = msSignTSA;
- // Not using reference XObjects is experimental for now.
- aContext.UseReferenceXObject = !officecfg::Office::Common::Misc::ExperimentalMode::get();
+ aContext.UseReferenceXObject = mbUseReferenceXObject;
// all context data set, time to create the printing device
std::unique_ptr<vcl::PDFWriter> pPDFWriter(new vcl::PDFWriter( aContext, xEnc ));
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx
index 5b9391ad60e9..4051cd88ff21 100644
--- a/filter/source/pdf/pdfexport.hxx
+++ b/filter/source/pdf/pdfexport.hxx
@@ -46,6 +46,7 @@ private:
bool mbExportNotes;
bool mbExportPlaceholders;
bool mbViewPDF;
+ bool mbUseReferenceXObject;
bool mbExportNotesPages;
bool mbExportOnlyNotesPages;
bool mbUseTransitionEffects;
diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui
index 1013f9529b86..11364c0bf308 100644
--- a/filter/uiconfig/ui/pdfgeneralpage.ui
+++ b/filter/uiconfig/ui/pdfgeneralpage.ui
@@ -436,7 +436,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
+ <property name="left_padding">13</property>
<child>
<object class="GtkGrid" id="grid10">
<property name="visible">True</property>
@@ -647,6 +647,21 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="usereferencexobject">
+ <property name="label" translatable="yes">Use reference XObjects</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">13</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton" id="hiddenpages">
<property name="label" translatable="yes">Export _hidden pages</property>
<property name="visible">True</property>