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-30 16:59:20 +0200
commita1b536a3b2bc327e2c8e7817a34d067412713142 (patch)
tree59ea2bce3c723c92d42fe55c17348169ca1ef839 /filter
parent2d298ce44645861db5510480b45e1ef9e439fa50 (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> (cherry picked from commit 9c944b0d1bff9a0ab1b7e8454c9ac5e7194aa533)
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 52bae8de8f12..5a76a2178190 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -82,6 +82,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue >
mbUseTaggedPDF( false ),
mbExportNotes( true ),
mbViewPDF( false ),
+ mbUseReferenceXObject( false ),
mbExportNotesPages( false ),
mbExportOnlyNotesPages( false ),
mbUseTransitionEffects( false ),
@@ -469,6 +470,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));
}
@@ -511,6 +513,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");
@@ -546,6 +549,7 @@ void ImpPDFTabGeneralPage::dispose()
mpCbExportHiddenSlides.clear();
mpCbExportNotes.clear();
mpCbViewPDF.clear();
+ mpCbUseReferenceXObject.clear();
mpCbExportNotesPages.clear();
mpCbExportOnlyNotesPages.clear();
mpCbExportEmptyPages.clear();
@@ -676,6 +680,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 c2ae742744db..29d4b43b0c85 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -104,6 +104,7 @@ protected:
sal_Int32 mnPDFTypeSelection;
bool mbExportNotes;
bool mbViewPDF;
+ bool mbUseReferenceXObject;
bool mbExportNotesPages;
bool mbExportOnlyNotesPages;
bool mbUseTransitionEffects;
@@ -220,6 +221,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 8d4e61ccf6f4..e62fc108c86c 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"
@@ -96,6 +95,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
mbExportNotes ( true ),
mbExportPlaceholders ( false ),
mbViewPDF ( true ),
+ mbUseReferenceXObject ( false ),
mbExportNotesPages ( false ),
mbExportOnlyNotesPages ( false ),
mbUseTransitionEffects ( true ),
@@ -560,6 +560,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::DECODE_TO_IURI);
@@ -783,8 +785,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 836fd2504ffd..8301c7c1af81 100644
--- a/filter/uiconfig/ui/pdfgeneralpage.ui
+++ b/filter/uiconfig/ui/pdfgeneralpage.ui
@@ -427,7 +427,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>
@@ -638,6 +638,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>