summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorAndreas Mantke <andi@lappiandreas.site>2012-04-15 11:51:37 +0200
committerAndreas Mantke <andi@lappiandreas.site>2012-04-15 11:51:37 +0200
commitf8f96e9da066047d65dad0f4d296171ecef73d43 (patch)
tree35f207de3681b9d9ec3e025f396a8bfe14c27fd9 /filter
parenta0b5ba2e821091b8053bfc1d2f9c99aca7431907 (diff)
Dialog for the option watermark of the PDF export.
The dialog for the export to PDF was enhanced with a section for the option of setting a watermark. The dialog has now a special subsection for this with a box to insert a string for the watermark.
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/impdialog.cxx28
-rw-r--r--filter/source/pdf/impdialog.hrc4
-rw-r--r--filter/source/pdf/impdialog.hxx7
-rw-r--r--filter/source/pdf/impdialog.src33
4 files changed, 70 insertions, 2 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 5024c30226c3..3b286cf9060b 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -386,10 +386,15 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
- int nElementAdded = 5;
+ int nElementAdded = 6;
aRet.realloc( aRet.getLength() + nElementAdded );
+ // add the encryption enable flag
+ aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Watermark" ) );
+ aRet[ aRet.getLength() - nElementAdded ].Value <<= maWatermarkText;
+ nElementAdded--;
+
// add the encryption enable flag
aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptFile" ) );
aRet[ aRet.getLength() - nElementAdded ].Value <<= mbEncrypt;
@@ -468,6 +473,11 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent,
maCbAddStream( this, PDFFilterResId( CB_ADDSTREAM ) ),
maFtAddStreamDescription( this, PDFFilterResId( FT_ADDSTREAMDESCRIPTION ) ),
maCbEmbedStandardFonts( this, PDFFilterResId( CB_EMBEDSTANDARDFONTS ) ),
+
+ maFlWatermark( this, PDFFilterResId( FL_WATERMARK ) ),
+ maCbWatermark( this, PDFFilterResId( CB_WATERMARK ) ),
+ maFtWatermark( this, PDFFilterResId(FT_WATERMARK)),
+ maEdWatermark( this, PDFFilterResId(ED_WATERMARK)),
mbIsPresentation( sal_False ),
mbIsWriter( sal_False),
mpaParent( 0 )
@@ -536,7 +546,9 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) );
maCoReduceImageResolution.SetText( aStrRes );
maCoReduceImageResolution.Enable( bReduceImageResolution );
-
+ maCbWatermark.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleWatermarkHdl ) );
+ maFtWatermark.Enable(false );
+ maEdWatermark.Enable( false );
maCbPDFA1b.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl) );
switch( paParent->mnPDFTypeSelection )
{
@@ -648,6 +660,7 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
paParent->mbExportFormFields = maCbExportFormFields.IsChecked();
paParent->mbEmbedStandardFonts = maCbEmbedStandardFonts.IsChecked();
}
+ paParent->maWatermarkText = maEdWatermark.GetText();
/*
* FIXME: the entries are only implicitly defined by the resource file. Should there
@@ -695,6 +708,17 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl)
return 0;
}
+
+IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleWatermarkHdl)
+{
+ maEdWatermark.Enable( maCbWatermark.IsChecked() );
+ maFtWatermark.Enable (maCbWatermark.IsChecked() );
+ if ( maCbWatermark.IsChecked() )
+ maEdWatermark.GrabFocus();
+
+ return 0;
+}
+
// -----------------------------------------------------------------------------
IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleAddStreamHdl)
{
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index b84d13f65e2a..25c46ce84f4d 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -90,6 +90,10 @@
#define CB_EMBEDSTANDARDFONTS 28
#define FT_ADDSTREAMDESCRIPTION 29
#define CB_EXPORTHIDDENSLIDES 30
+#define FL_WATERMARK 31
+#define CB_WATERMARK 32
+#define FT_WATERMARK 33
+#define ED_WATERMARK 34
#define FL_OLD_PAGES 51
#define RB_OLD_ALL 52
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 7ee03ffcb696..f3330c08b684 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -149,6 +149,7 @@ protected:
sal_Int32 mnViewPDFMode;
sal_Bool mbConvertOOoTargets;
sal_Bool mbExportBmkToPDFDestination;
+ ::rtl::OUString maWatermarkText;
public:
@@ -217,6 +218,11 @@ class ImpPDFTabGeneralPage : public SfxTabPage
FixedText maFtAddStreamDescription;
CheckBox maCbEmbedStandardFonts;
+ FixedLine maFlWatermark;
+ CheckBox maCbWatermark;
+ FixedText maFtWatermark;
+ Edit maEdWatermark;
+
sal_Bool mbIsPresentation;
sal_Bool mbIsWriter;
@@ -225,6 +231,7 @@ const ImpPDFTabDialog* mpaParent;
DECL_LINK( TogglePagesHdl, void* );
DECL_LINK( ToggleCompressionHdl, void* );
DECL_LINK( ToggleReduceImageResolutionHdl, void* );
+ DECL_LINK( ToggleWatermarkHdl, void* );
DECL_LINK( ToggleAddStreamHdl, void* );
DECL_LINK( ToggleExportFormFieldsHdl, void* );
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index dd8d50b7e3fd..2c634d9bafd9 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -154,6 +154,39 @@ TabPage RID_PDF_TAB_GENER
};
};
+ FixedLine FL_WATERMARK
+ {
+ Pos = MAP_APPFONT ( 6 , 123 ) ;
+ Size = MAP_APPFONT ( 164 , 10 ) ;
+ Text[ en-US ] = "Watermark";
+ };
+
+ CheckBox CB_WATERMARK
+ {
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_SIGNWITHWATERMARK";
+ Pos = MAP_APPFONT ( 6, 135 ) ;
+ Size = MAP_APPFONT ( 158 , 10 ) ;
+ TabStop = TRUE ;
+ Text[ en-US ] = "Sign with Watermark";
+ };
+
+ FixedText FT_WATERMARK
+ {
+ Pos = MAP_APPFONT ( 6 , 150) ;
+ Size = MAP_APPFONT ( 90 , 8 ) ;
+ Text [ en-US ] = "Watermark Text";
+ };
+
+ Edit ED_WATERMARK
+ {
+ HelpID = "filter:Edit:RID_PDF_TAB_GENER:EDIT_WATERMARKTEXT";
+ Pos = MAP_APPFONT ( 15, 160 ) ;
+ Size = MAP_APPFONT ( 100 , 8 ) ;
+ Border = TRUE;
+
+ };
+
+
FixedLine FL_GENERAL_VERTICAL
{
Pos = MAP_APPFONT ( 175 , 3 ) ;