summaryrefslogtreecommitdiff
path: root/filter/source/pdf/pdffilter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'filter/source/pdf/pdffilter.cxx')
-rw-r--r--filter/source/pdf/pdffilter.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 9aadfedf207a..f09ae0a9f955 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -24,7 +24,10 @@
#include <vcl/window.hxx>
#include <svl/outstrm.hxx>
#include <vcl/FilterConfigItem.hxx>
+#include <com/sun/star/system/SystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
+using namespace css::system;
// -------------
// - PDFFilter -
// -------------
@@ -51,6 +54,10 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
sal_Bool bRet = sal_False;
Reference< task::XStatusIndicator > xStatusIndicator;
Reference< task::XInteractionHandler > xIH;
+ OUString aUrl;
+
+ FilterConfigItem aItem( "Office.Common/Filter/PDF/Export/" );
+ sal_Bool aViewPDF = aItem.ReadBool( "ViewPDFAfterExport", sal_False );
for ( sal_Int32 i = 0 ; ( i < nLength ) && !xOStm.is(); ++i)
{
@@ -62,6 +69,8 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
pValue[ i ].Value >>= xStatusIndicator;
else if ( pValue[i].Name == "InteractionHandler" )
pValue[i].Value >>= xIH;
+ else if ( pValue[ i ].Name == "URL" )
+ pValue[ i ].Value >>= aUrl;
}
/* we don't get FilterData if we are exporting directly
@@ -133,6 +142,10 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
}
}
+ if(aViewPDF==sal_True) {
+ Reference<XSystemShellExecute> xSystemShellExecute(SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) ); //Open the newly exported pdf
+ xSystemShellExecute->execute(aUrl, "", SystemShellExecuteFlags::URIS_ONLY ); }
+
return bRet;
}