View | Details | Raw Unified | Return to issue 61139
Collapse All | Expand All

(-)filter/inc/filter.hrc (-4 / +5 lines)
Lines 45-54 Link Here
45
45
46
// Help-Ids --------------------------------------------------------------
46
// Help-Ids --------------------------------------------------------------
47
47
48
#define RID_PDF_EXPORT_DLG			(RID_FILTER_START +   0)
48
#define RID_PDF_DIALOG_START		(RID_FILTER_START +   0)
49
#define RID_XSLT_DIALOG_START		(RID_FILTER_START +   1)
49
#define RID_PDF_DIALOG_END		    (RID_FILTER_START +   9)
50
#define RID_XSLT_DIALOG_END			(RID_FILTER_START +  49)
50
#define RID_XSLT_DIALOG_START		(RID_FILTER_START +  10)
51
#define RID_PDF_OLD_EXPORT_DLG		(RID_FILTER_START +  50)
51
#define RID_XSLT_DIALOG_END			(RID_FILTER_START +  59)
52
#define RID_PDF_OLD_EXPORT_DLG		(RID_FILTER_START +  60)
52
53
53
// warning, next range is RID_FILTER_START + 100 !
54
// warning, next range is RID_FILTER_START + 100 !
54
55
(-)filter/source/pdf/impdialog.cxx (-138 / +625 lines)
Lines 36-41 Link Here
36
#include "impdialog.hxx"
36
#include "impdialog.hxx"
37
#include "impdialog.hrc"
37
#include "impdialog.hrc"
38
38
39
#ifndef _SV_SVAPP_HXX
40
#include <vcl/svapp.hxx>
41
#endif
42
43
#ifndef _SV_MSGBOX_HXX
44
#include <vcl/msgbox.hxx>
45
#endif
46
39
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
47
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
40
#include <com/sun/star/uno/Sequence.h>
48
#include <com/sun/star/uno/Sequence.h>
41
#endif
49
#endif
Lines 61-237 Link Here
61
69
62
using namespace ::com::sun::star;
70
using namespace ::com::sun::star;
63
71
64
ImpPDFDialog::ImpPDFDialog( Window* pParent, ResMgr& rResMgr, Sequence< PropertyValue >& rFilterData, const Reference< XComponent >& rxDoc ) :
72
//////////////////////////////////////////////////////////////////////////////////////////////////////
65
    ModalDialog( pParent, ResId( RID_PDF_EXPORT_DLG, &rResMgr ) ),
73
// tabbed PDF dialog implementation
66
	maBtnOK( this, ResId( BT_OK ) ),
74
// -----------------------------------------------------------------------------
67
	maBtnCancel( this, ResId( BT_CANCEL ) ),
75
ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent,
68
	maBtnHelp( this, ResId( BT_HELP ) ),
76
                                  ResMgr& rResMgr,
69
	maFlPages( this, ResId( FL_PAGES ) ),
77
                                  Sequence< PropertyValue >& rFilterData,
70
	maRbAll( this, ResId( RB_ALL ) ),
78
                                  const Reference< XComponent >& rxDoc ) :
71
	maRbRange( this, ResId( RB_RANGE ) ),
79
    SfxTabDialog( pParent, ResId( RID_PDF_EXPORT_DLG, &rResMgr ), 0, FALSE, 0 ),
72
	maRbSelection( this, ResId( RB_SELECTION ) ),
80
73
	maEdPages( this, ResId( ED_PAGES ) ),
81
    maFlPages( this, ResId( 1 ) ),
74
    maFlCompression( this, ResId( FL_IMAGES ) ),
82
75
    maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION ) ),
76
    maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION ) ),
77
	maFtQuality( this, ResId( FT_QUALITY ) ),
78
	maNfQuality( this, ResId( NF_QUALITY ) ),
79
	maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION ) ),
80
	maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION ) ),
81
	maFlGeneral( this, ResId( FL_GENERAL ) ),
82
	maCbTaggedPDF( this, ResId( CB_TAGGEDPDF ) ),
83
	maCbExportNotes( this, ResId( CB_EXPORTNOTES ) ),
84
	maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS ) ),
85
    maFtFormsFormat( this, ResId( FT_FORMSFORMAT ) ),
86
	maLbFormsFormat( this, ResId( LB_FORMSFORMAT ) ),
87
    maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES ) ),
88
    maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ),
83
    maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ),
89
    mbIsPresentation( sal_False ),
84
    mbIsPresentation( sal_False ),
90
    mbIsWriter( sal_False )
85
    mbIsWriter( sal_False ),
91
{
92
    FreeResource();
93
    maRbRange.SetToggleHdl( LINK( this, ImpPDFDialog, TogglePagesHdl ) );
94
86
95
    maRbAll.Check();
87
    mbSelectionPresent( sal_False ),
96
    TogglePagesHdl( NULL );
88
    mbUseLosslessCompression( sal_True ),
89
    mnQuality( 90 ),
90
    mbReduceImageResolution( sal_False ),
91
    mnMaxImageResolution( 300 ),
92
    mbUseTaggedPDF( sal_False ),
93
    mbExportNotesBoth( sal_True ),
94
    mbUseTransitionEffects( sal_False ),
95
    mbIsSkipEmptyPages( sal_False ),
96
    mnFormsType( 0 ),
97
98
    mbHideViewerToolbar( sal_False ),
99
    mbHideViewerMenubar( sal_False ),
100
    mbHideViewerWindowControls( sal_False ),
101
    mbFitWindow( sal_False ),
102
    mbCenterWindow( sal_False ),
103
    mbDisplayPDFDocumentTitle( sal_False ),
104
    mbDirectionR2L( sal_False ),
105
    mnOpenPDFDocumentMode( 0 ),
106
    mnOpenPDFDocumentAction( 0 ),
107
    mnNonFullScreenPageMode( 0 ),
97
108
98
    maNfQuality.SetUnit( FUNIT_PERCENT );
109
    mbIsRangeChecked( sal_False ),
99
    maNfQuality.SetMin( 1, FUNIT_PERCENT );
110
    msPageRange( ' ' ),
100
    maNfQuality.SetMax( 100, FUNIT_PERCENT );
101
111
102
	// check for selection
112
    mbSelectionIsChecked( sal_False )
113
{
114
    FreeResource();
115
    mprResMgr = &rResMgr;
116
// check for selection
103
    try
117
    try
104
    {
118
    {
105
		Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() );
119
        Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() );
106
	    if( xController.is() )
120
        if( xController.is() )
107
	    {
121
        {
108
			Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
122
            Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
109
		    if( xView.is() )
123
            if( xView.is() )
110
			    xView->getSelection() >>= maSelection;
124
                xView->getSelection() >>= maSelection;
111
        }
125
        }
112
    }
126
    }
113
    catch( RuntimeException )
127
    catch( RuntimeException )
114
    {
128
    {
115
    }
129
    }
116
	sal_Bool bHasSelection = maSelection.hasValue();
130
    mbSelectionPresent = maSelection.hasValue();
117
	if ( bHasSelection )
131
    if ( mbSelectionPresent )
118
	{
132
    {
119
		Reference< drawing::XShapes > xShapes;
133
        Reference< drawing::XShapes > xShapes;
120
		if ( ( maSelection >>= xShapes ) == sal_False )	// XShapes is always a selection
134
        if ( ( maSelection >>= xShapes ) == sal_False )	// XShapes is always a selection
121
		{
135
        {
122
			// even if nothing is selected in writer the selection is not empty
136
            // even if nothing is selected in writer the selection is not empty
123
			Reference< container::XIndexAccess > xIndexAccess;
137
            Reference< container::XIndexAccess > xIndexAccess;
124
			if ( maSelection >>= xIndexAccess )
138
            if ( maSelection >>= xIndexAccess )
125
			{
139
            {
126
				sal_Int32 nLen = xIndexAccess->getCount();
140
                sal_Int32 nLen = xIndexAccess->getCount();
127
				if ( !nLen )
141
                if ( !nLen )
128
					bHasSelection = sal_False;
142
                    mbSelectionPresent = sal_False;
129
				else if ( nLen == 1 )
143
                else if ( nLen == 1 )
130
				{
144
                {
131
					Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY );
145
                    Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY );
132
					if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) )
146
                    if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) )
133
						bHasSelection = sal_False;
147
                        mbSelectionPresent = sal_False;
134
				}
148
                }
135
			}
149
            }
136
		}
150
        }
137
	}
151
    }
138
    maRbSelection.Enable( bHasSelection );
152
139
153
// check if source document is a presentation
140
154
    try
141
	// check if source document is a presentation
155
    {
142
	try
156
        Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY );
143
	{
157
        if ( xInfo.is() )
144
	    Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY );
158
        {
145
		if ( xInfo.is() )
159
            if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) )
146
		{
160
                mbIsPresentation = sal_True;
147
			if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) )
148
				mbIsPresentation = sal_True;
149
            if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) )
161
            if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) )
150
                mbIsWriter = sal_True;
162
                mbIsWriter = sal_True;
151
        }
163
        }
152
	}
164
    }
153
	catch( RuntimeException )
165
    catch( RuntimeException )
154
	{
166
    {
155
	}
167
    }
156
	maCbTransitionEffects.Enable( mbIsPresentation );
157
    maCbExportEmptyPages.Enable( mbIsWriter );
158
159
//  SJ: Dont know if there are Notes available also for writer.
160
//	maCbExportNotes.Enable( bIsPresentation );
161
162
163
	maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFDialog, ToggleCompressionHdl ) );
164
    const sal_Bool	bUseLosslessCompression = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False );
165
    if ( bUseLosslessCompression )
166
		maRbLosslessCompression.Check();
167
	else
168
		maRbJPEGCompression.Check();
169
	maNfQuality.SetValue( maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 ), FUNIT_PERCENT );
170
	maNfQuality.Enable( bUseLosslessCompression == sal_False );
171
172
	maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFDialog, ToggleReduceImageResolutionHdl ) );
173
	const sal_Bool	bReduceImageResolution = maConfigItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False );
174
	maCbReduceImageResolution.Check( bReduceImageResolution );
175
	String aStrRes( String::CreateFromInt32( maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 ) ) );
176
	aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) );
177
	maCoReduceImageResolution.SetText( aStrRes );
178
	maCoReduceImageResolution.Enable( bReduceImageResolution );
179
180
	maCbTaggedPDF.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ) );
181
182
	if ( mbIsPresentation )
183
		maCbExportNotes.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages"  ) ), sal_False ) );
184
	else
185
		maCbExportNotes.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes"  ) ), sal_True ) );
186
187
	maCbTransitionEffects.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects"  ) ), sal_True ) );
188
    maCbExportEmptyPages.Check( !maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages"  ) ), sal_False ) );
189
168
190
	sal_Int32 nFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 );
169
    mbUseLosslessCompression = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False );
191
	if ( ( nFormsType < 0 ) || ( nFormsType > 3 ) )
170
    mnQuality = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 );
192
		nFormsType = 0;
171
    mbReduceImageResolution = maConfigItem.ReadBool(  OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False );
193
	maLbFormsFormat.SelectEntryPos( (sal_uInt16)nFormsType );
172
    mnMaxImageResolution = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 );
173
174
    mbUseTaggedPDF = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False );
175
    if ( mbIsPresentation )
176
        mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages"  ) ), sal_False );
177
    else
178
        mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes"  ) ), sal_True );
179
180
    mbUseTransitionEffects = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects"  ) ), sal_True );
181
    mbIsSkipEmptyPages = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages"  ) ), sal_False );
182
183
    mnFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 );
184
    if ( ( mnFormsType < 0 ) || ( mnFormsType > 3 ) )
185
        mnFormsType = 0;
186
187
//prepare values for the Viewer tab page
188
    mbHideViewerToolbar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), sal_False );
189
    mbHideViewerMenubar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), sal_False );
190
    mbHideViewerWindowControls = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), sal_False );
191
    mbFitWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), sal_False );
192
    mbCenterWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), sal_False );
193
    mbDisplayPDFDocumentTitle = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), sal_False );
194
    mbDirectionR2L  = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), sal_False );
195
196
    mnOpenPDFDocumentMode = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), 0 );
197
    mnOpenPDFDocumentAction = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), 0 );
198
    mnNonFullScreenPageMode = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ), 0 );
199
200
//queue the tab pages for later creation (created when first shown)
201
    AddTabPage( RID_PDF_TAB_VPREFER, ImpPDFTabViewerPage::Create, 0 );
202
    AddTabPage( RID_PDF_TAB_OPNFTR, ImpPDFTabOpnFtrPage::Create, 0 );
203
204
//last queued is the first to be displayed (or so it seems..)
205
    AddTabPage( RID_PDF_TAB_GENER, ImpPDFTabGeneralPage::Create, 0 );
206
207
//change test on the Ok button: get the relevant string from resources, update it on the button
208
    GetOKButton().SetText( OUString( String( ResId( STR_PDF_EXPORT, &rResMgr ) ) ) );
209
210
//FIXME
211
//very, very ugly hack: I don't know how to have the tab pages displayed correctly without this...
212
    maFlPages.Hide();
213
/////////////////
194
}
214
}
195
215
196
// -----------------------------------------------------------------------------
216
// -----------------------------------------------------------------------------
217
ImpPDFTabDialog::~ImpPDFTabDialog()
218
{
219
//delete the pages, needed because otherwise the child tab pages
220
//don't get destroyed
221
    RemoveTabPage( RID_PDF_TAB_GENER );
222
    RemoveTabPage( RID_PDF_TAB_VPREFER );
223
    RemoveTabPage( RID_PDF_TAB_OPNFTR );
224
}
197
225
198
ImpPDFDialog::~ImpPDFDialog()
226
// -----------------------------------------------------------------------------
227
void ImpPDFTabDialog::PageCreated( USHORT _nId,
228
                                   SfxTabPage& _rPage )
199
{
229
{
230
    switch( _nId )
231
    {
232
    case RID_PDF_TAB_GENER:
233
        ( ( ImpPDFTabGeneralPage* )&_rPage )->SetFilterConfigItem( this );
234
        break;
235
    case RID_PDF_TAB_VPREFER:
236
        ( ( ImpPDFTabViewerPage* )&_rPage )->SetFilterConfigItem( this );
237
        break;
238
    case RID_PDF_TAB_OPNFTR:
239
        ( ( ImpPDFTabOpnFtrPage* )&_rPage )->SetFilterConfigItem( this );
240
        break;
241
    }
200
}
242
}
201
243
202
// -----------------------------------------------------------------------------
244
// -----------------------------------------------------------------------------
245
short ImpPDFTabDialog::Ok( )
246
{
247
//here the whole mechanism of the base class is not used
248
//when Ok is hit, the user means 'convert to PDF', so simply close with ok
249
    return RET_OK;
250
}
203
251
204
Sequence< PropertyValue > ImpPDFDialog::GetFilterData()
252
// -----------------------------------------------------------------------------
253
Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
205
{
254
{
206
	// updating the FilterData sequence and storing FilterData to configuration
255
// updating the FilterData sequence and storing FilterData to configuration
207
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), maRbLosslessCompression.IsChecked() );
256
    if( GetTabPage( RID_PDF_TAB_GENER ) )
208
	maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), maNfQuality.GetValue() );
257
        ( ( ImpPDFTabGeneralPage* )GetTabPage( RID_PDF_TAB_GENER ) )->GetFilterConfigItem( this );
209
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), maCbReduceImageResolution.IsChecked() );
258
210
	maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), maCoReduceImageResolution.GetText().ToInt32() );
259
//prepare the items to be returned
211
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), maCbTaggedPDF.IsChecked() );
260
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), mbUseLosslessCompression );
212
	if ( mbIsPresentation )
261
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), mnQuality );
213
	    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), maCbExportNotes.IsChecked() );
262
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), mbReduceImageResolution );
214
	else
263
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), mnMaxImageResolution );
215
		maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), maCbExportNotes.IsChecked() );
264
216
	maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), maCbTransitionEffects.IsChecked() );
265
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), mbUseTaggedPDF );
217
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), !maCbExportEmptyPages.IsChecked() );
266
    if ( mbIsPresentation )
267
        maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesBoth );
268
    else
269
        maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotesBoth );
270
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), mbUseTransitionEffects );
271
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), mbIsSkipEmptyPages );
218
272
219
    /*
273
    /*
220
    * FIXME: the entries are only implicitly defined by the resource file. Should there
274
    * FIXME: the entries are only implicitly defined by the resource file. Should there
221
    * ever be an additional form submit format this could get invalid.
275
    * ever be an additional form submit format this could get invalid.
222
    */
276
    */
223
	maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), maLbFormsFormat.GetSelectEntryPos() );
277
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), mnFormsType );
278
279
    if( GetTabPage( RID_PDF_TAB_VPREFER ) )
280
        ( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this );
281
282
    if( GetTabPage( RID_PDF_TAB_OPNFTR ) )
283
        ( ( ImpPDFTabOpnFtrPage* )GetTabPage( RID_PDF_TAB_OPNFTR ) )->GetFilterConfigItem( this );
284
285
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), mbHideViewerToolbar );
286
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), mbHideViewerMenubar );
287
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), mbHideViewerWindowControls );
288
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), mbFitWindow );
289
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), mbCenterWindow );
290
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), mbDisplayPDFDocumentTitle );
291
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), mbDirectionR2L );
292
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), mnOpenPDFDocumentMode );
293
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), mnOpenPDFDocumentAction );
294
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ), mnNonFullScreenPageMode );
224
295
225
    Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
296
    Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
226
297
227
    aRet.realloc( aRet.getLength() + 1 );
298
    aRet.realloc( aRet.getLength() + 1 );
228
299
229
    if( maRbRange.IsChecked() )
300
    if( mbIsRangeChecked )
230
    {
301
    {
231
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
302
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
232
        aRet[ aRet.getLength() - 1 ].Value <<= OUString( maEdPages.GetText() );
303
        aRet[ aRet.getLength() - 1 ].Value <<= OUString( msPageRange );
233
    }
304
    }
234
    else if( maRbSelection.IsChecked() )
305
    else if( mbSelectionIsChecked )
235
    {
306
    {
236
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
307
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
237
        aRet[ aRet.getLength() - 1 ].Value <<= maSelection;
308
        aRet[ aRet.getLength() - 1 ].Value <<= maSelection;
Lines 240-266 Sequence< PropertyValue > ImpPDFDialog:: Link Here
240
}
311
}
241
312
242
// -----------------------------------------------------------------------------
313
// -----------------------------------------------------------------------------
314
ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent,
315
                                            const SfxItemSet& rCoreSet,
316
                                            ResMgr* paResMgr ) :
317
    SfxTabPage( pParent, ResId( RID_PDF_TAB_GENER, paResMgr ), rCoreSet ),
318
319
    maFlPages( this, ResId( FL_PAGES, paResMgr ) ),
320
    maRbAll( this, ResId( RB_ALL, paResMgr) ),
321
    maRbRange( this, ResId( RB_RANGE, paResMgr ) ),
322
    maRbSelection( this, ResId( RB_SELECTION, paResMgr ) ),
323
    maEdPages( this, ResId( ED_PAGES, paResMgr ) ),
324
325
    maFlCompression( this, ResId( FL_IMAGES, paResMgr ) ),
326
    maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION, paResMgr ) ),
327
    maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION, paResMgr ) ),
328
    maFtQuality( this, ResId( FT_QUALITY, paResMgr ) ),
329
    maNfQuality( this, ResId( NF_QUALITY, paResMgr ) ),
330
    maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION, paResMgr ) ),
331
    maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION, paResMgr ) ),
332
333
    maFlGeneral( this, ResId( FL_GENERAL, paResMgr ) ),
334
    maCbTaggedPDF( this, ResId( CB_TAGGEDPDF, paResMgr ) ),
335
    maCbExportNotes( this, ResId( CB_EXPORTNOTES, paResMgr ) ),
336
    maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS, paResMgr ) ),
337
338
    maFtFormsFormat( this, ResId( FT_FORMSFORMAT, paResMgr ) ),
339
    maLbFormsFormat( this, ResId( LB_FORMSFORMAT, paResMgr ) ),
340
    maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES, paResMgr ) ),
341
    mbIsPresentation( sal_False ),
342
343
    mbResetAlreadyCalled( sal_False )
344
{
345
    mpaResMgr = paResMgr;
346
    FreeResource();
347
}
348
349
// -----------------------------------------------------------------------------
350
ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage()
351
{
352
    delete mpaResMgr;
353
}
354
355
// -----------------------------------------------------------------------------
356
void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent )
357
{
358
//init this class data
359
    maRbRange.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) );
360
361
    maRbAll.Check();
362
    TogglePagesHdl( NULL );
363
364
    maNfQuality.SetUnit( FUNIT_PERCENT );
365
    maNfQuality.SetMin( 1, FUNIT_PERCENT );
366
    maNfQuality.SetMax( 100, FUNIT_PERCENT );
367
368
    maRbSelection.Enable( paParent->mbSelectionPresent );
369
    mbIsPresentation = paParent->mbIsPresentation;
370
    mbIsWriter = paParent->mbIsWriter;
371
372
    maCbTransitionEffects.Enable( mbIsPresentation );
373
    maCbExportEmptyPages.Enable( mbIsWriter );
374
375
//  SJ: Dont know if there are Notes available also for writer.
376
//	maCbExportNotes.Enable( paParent->mbIsPresentation );
377
378
    maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) );
379
    const sal_Bool bUseLosslessCompression = paParent->mbUseLosslessCompression;
380
    if ( bUseLosslessCompression )
381
        maRbLosslessCompression.Check();
382
	else
383
        maRbJPEGCompression.Check();
384
385
    maNfQuality.SetValue( paParent->mnQuality, FUNIT_PERCENT );
386
    maNfQuality.Enable( bUseLosslessCompression == sal_False );
387
388
    maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl ) );
389
    const sal_Bool	bReduceImageResolution = paParent->mbReduceImageResolution;
390
    maCbReduceImageResolution.Check( bReduceImageResolution );
391
    String aStrRes( String::CreateFromInt32( paParent->mnMaxImageResolution ) );
392
    aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) );
393
    maCoReduceImageResolution.SetText( aStrRes );
394
    maCoReduceImageResolution.Enable( bReduceImageResolution );
395
396
    maCbTaggedPDF.Check( paParent->mbUseTaggedPDF );
397
398
    if ( mbIsPresentation )
399
        maCbExportNotes.Check( paParent->mbExportNotesBoth );
400
    else
401
        maCbExportNotes.Check( paParent->mbExportNotesBoth );
402
403
    maCbTransitionEffects.Check( paParent->mbUseTransitionEffects );
404
    maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages );
405
406
    maLbFormsFormat.SelectEntryPos( (sal_uInt16)paParent->mnFormsType );
407
}
408
409
// -----------------------------------------------------------------------------
410
void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
411
{
412
// updating the FilterData sequence and storing FilterData to configuration
413
    paParent->mbUseLosslessCompression = maRbLosslessCompression.IsChecked();
414
    paParent->mnQuality = maNfQuality.GetValue();
415
    paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked();
416
    paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().ToInt32();
417
    paParent->mbUseTaggedPDF =  maCbTaggedPDF.IsChecked();
418
    paParent->mbExportNotesBoth = maCbExportNotes.IsChecked();
419
420
    paParent->mbUseTransitionEffects = maCbTransitionEffects.IsChecked();
421
    paParent->mbIsSkipEmptyPages =  !maCbExportEmptyPages.IsChecked();
422
423
    paParent->mbIsRangeChecked = sal_False;
424
    if( maRbRange.IsChecked() )
425
    {
426
        paParent->mbIsRangeChecked = sal_True;
427
        paParent->msPageRange = String( maEdPages.GetText() ); //FIXME all right on other languages ?
428
    }
429
    else if( maRbSelection.IsChecked() )
430
    {
431
        paParent->mbSelectionIsChecked = maRbSelection.IsChecked();
432
    }
433
    /*
434
    * FIXME: the entries are only implicitly defined by the resource file. Should there
435
    * ever be an additional form submit format this could get invalid.
436
    */
437
    paParent->mnFormsType = (sal_Int32) maLbFormsFormat.GetSelectEntryPos();
438
}
439
440
// -----------------------------------------------------------------------------
441
SfxTabPage*  ImpPDFTabGeneralPage::Create( Window* pParent,
442
                                           const SfxItemSet& rAttrSet)
443
{
444
    ByteString aResMgrName( "pdffilter" );
445
    aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
446
    ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
447
	return ( new  ImpPDFTabGeneralPage( pParent, rAttrSet, paResMgr ) );
448
}
243
449
244
IMPL_LINK( ImpPDFDialog, TogglePagesHdl, void*, p )
450
// -----------------------------------------------------------------------------
451
void ImpPDFTabGeneralPage::Reset( const SfxItemSet& ignored)
452
{
453
//set the controls to default values
454
//since this is  called just after the data are set from the parent tab dialog
455
//a bool is needed to enable reset only the second time (while user presses it)
456
    if( mbResetAlreadyCalled )
457
    {
458
        maCbTransitionEffects.Enable( mbIsPresentation );
459
        maCbExportEmptyPages.Enable( mbIsWriter );
460
        maRbAll.Check();
461
        TogglePagesHdl( NULL );
462
        maRbLosslessCompression.Check( FALSE );
463
        maRbJPEGCompression.Check();
464
        maNfQuality.SetValue( 90 , FUNIT_PERCENT );
465
        maNfQuality.Enable();
466
        maCbReduceImageResolution.Check( FALSE );
467
        maCbTaggedPDF.Check( FALSE );
468
        if ( mbIsPresentation )
469
            maCbExportNotes.Check( FALSE );
470
        else
471
            maCbExportNotes.Check();
472
        maCbTransitionEffects.Check();
473
        maCbExportEmptyPages.Check();
474
475
        maLbFormsFormat.SelectEntryPos( 0 );
476
    }
477
    mbResetAlreadyCalled = sal_True;
478
}
479
480
// -----------------------------------------------------------------------------
481
IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, p )
245
{
482
{
246
    maEdPages.Enable( maRbRange.IsChecked() );
483
    maEdPages.Enable( maRbRange.IsChecked() );
247
    maEdPages.SetReadOnly( !maRbRange.IsChecked() );
484
    maEdPages.SetReadOnly( !maRbRange.IsChecked() );
248
249
    return 0;
485
    return 0;
250
}
486
}
251
487
252
// -----------------------------------------------------------------------------
488
// -----------------------------------------------------------------------------
253
489
IMPL_LINK( ImpPDFTabGeneralPage, ToggleCompressionHdl, void*, p )
254
IMPL_LINK( ImpPDFDialog, ToggleCompressionHdl, void*, p )
255
{
490
{
256
    maNfQuality.Enable( maRbJPEGCompression.IsChecked() );
491
    maNfQuality.Enable( maRbJPEGCompression.IsChecked() );
257
    return 0;
492
    return 0;
258
}
493
}
259
494
260
// -----------------------------------------------------------------------------
495
// -----------------------------------------------------------------------------
261
496
IMPL_LINK( ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl, void*, p )
262
IMPL_LINK( ImpPDFDialog, ToggleReduceImageResolutionHdl, void*, p )
263
{
497
{
264
    maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() );
498
    maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() );
265
    return 0;
499
    return 0;
266
}
500
}
501
502
////////////////////////////////////////////////////////
503
// The Viewer preferences tab page
504
// -----------------------------------------------------------------------------
505
ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent,
506
                                          const SfxItemSet& rCoreSet,
507
                                          ResMgr* paResMgr ) :
508
    SfxTabPage( pParent, ResId( RID_PDF_TAB_VPREFER, paResMgr ), rCoreSet ),
509
510
    maFlViewWinCtrl( this, ResId( FL_VIEWWINCTRL, paResMgr ) ),
511
    maCbHideViewerMenubar( this, ResId( CB_HIDEVMENUBAR, paResMgr ) ),
512
    maCbHideViewerToolbar( this, ResId( CB_HIDEVTOOLBAR, paResMgr ) ),
513
    maCbHideViewerWindowControls( this, ResId( CB_HIDEVWINCTRL, paResMgr ) ),
514
    maCbFitWindow( this, ResId( CB_FITWINDOW, paResMgr ) ),
515
    maCbCenterWindow( this, ResId( CB_CENTWINDOW, paResMgr ) ),
516
    maCbDispDocTitle( this, ResId( CB_DISPDOCTITLE, paResMgr ) ),
517
518
    maFlDirContrl( this, ResId( FL_DIRCONTR, paResMgr ) ),
519
    maRbL2R( this, ResId( RB_LEFTRIGHT, paResMgr ) ),
520
    maRbR2L( this, ResId( RB_RIGHTLEFT, paResMgr ) ),
521
522
    mbResetAlreadyCalled( sal_False )
523
{
524
    mpaResMgr = paResMgr;
525
    FreeResource();
526
}
527
528
// -----------------------------------------------------------------------------
529
ImpPDFTabViewerPage::~ImpPDFTabViewerPage()
530
{
531
    delete mpaResMgr;
532
}
533
534
// -----------------------------------------------------------------------------
535
SfxTabPage*  ImpPDFTabViewerPage::Create( Window* pParent,
536
                                          const SfxItemSet& rAttrSet)
537
{
538
    ByteString aResMgrName( "pdffilter" );
539
    aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
540
    ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
541
    return ( new  ImpPDFTabViewerPage( pParent, rAttrSet, paResMgr ) );
542
}
543
544
// -----------------------------------------------------------------------------
545
void ImpPDFTabViewerPage::GetFilterConfigItem( ImpPDFTabDialog* paParent  )
546
{
547
    paParent->mbHideViewerMenubar = maCbHideViewerMenubar.IsChecked();
548
    paParent->mbHideViewerToolbar = maCbHideViewerToolbar.IsChecked( );
549
    paParent->mbHideViewerWindowControls = maCbHideViewerWindowControls.IsChecked();
550
    paParent->mbFitWindow = maCbFitWindow.IsChecked();
551
    paParent->mbCenterWindow = maCbCenterWindow.IsChecked();
552
    paParent->mbDisplayPDFDocumentTitle = maCbDispDocTitle.IsChecked();
553
    paParent->mbDirectionR2L = maRbR2L.IsChecked();
554
}
555
556
// -----------------------------------------------------------------------------
557
void ImpPDFTabViewerPage::SetFilterConfigItem( const  ImpPDFTabDialog* paParent )
558
{
559
    maCbHideViewerMenubar.Check( paParent->mbHideViewerMenubar );
560
    maCbHideViewerToolbar.Check( paParent->mbHideViewerToolbar );
561
    maCbHideViewerWindowControls.Check( paParent->mbHideViewerWindowControls );
562
    maCbFitWindow.Check( paParent->mbFitWindow );
563
    maCbCenterWindow.Check( paParent->mbCenterWindow );
564
    maCbDispDocTitle.Check( paParent->mbDisplayPDFDocumentTitle );
565
566
    maRbR2L.Check( paParent->mbDirectionR2L );
567
    maRbL2R.Check( !paParent->mbDirectionR2L );
568
}
569
570
// -----------------------------------------------------------------------------
571
void ImpPDFTabViewerPage::Reset( const SfxItemSet& ignored )
572
{
573
//set the controls to default values
574
// since this is  called just after the data are set from the parent tab dialog
575
// a bool is needed to enable reset only the second time (user pressing it)
576
    if( mbResetAlreadyCalled )
577
    {
578
        maRbL2R.Check();
579
        maRbR2L.Check(FALSE);
580
581
        maCbHideViewerMenubar.Check( FALSE );
582
        maCbHideViewerToolbar.Check( FALSE );
583
        maCbHideViewerWindowControls.Check( FALSE );
584
        maCbFitWindow.Check( FALSE );
585
        maCbCenterWindow.Check( FALSE );
586
        maCbDispDocTitle.Check();
587
    }
588
    mbResetAlreadyCalled = sal_True;
589
}
590
591
/////////////////////////////////////////////////////////////////
592
// the option features tab page
593
// -----------------------------------------------------------------------------
594
ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent,
595
                                          const SfxItemSet& rCoreSet, 
596
                                          ResMgr* paResMgr ) :
597
    SfxTabPage( pParent, ResId( RID_PDF_TAB_OPNFTR, paResMgr ), rCoreSet ),
598
    maFlOpenMode( this, ResId( FL_OPENMODE, paResMgr ) ),
599
600
    maRbOpnDefault( this, ResId( RB_OPNMODE_DEFAULT, paResMgr ) ),
601
    maRbOpnOutline( this, ResId( RB_OPNMODE_OUTLINE, paResMgr ) ),
602
    maRbOpnThumbs( this, ResId( RB_OPNMODE_THUMBS, paResMgr ) ),
603
    maRbOpnFull( this, ResId( RB_OPNMODE_FULL, paResMgr ) ),
604
605
    maFlFullScreen( this, ResId( FL_FULLSCREEN, paResMgr ) ),
606
    maRbNFSDefault( this, ResId( RB_NFULLS_DEFAULT, paResMgr ) ),
607
    maRbNFSOutline( this, ResId( RB_NFULLS_OUTLINE, paResMgr ) ),
608
    maRbNFSThumbs( this, ResId( RB_NFULLS_THUMBS, paResMgr ) ),
609
610
    maFlOpenAction( this, ResId( FL_OPENACTION, paResMgr ) ),
611
    maRbOActDefault( this, ResId( RB_OPNACTION_DEFAULT, paResMgr ) ),
612
    maRbOActPage( this, ResId( RB_OPNACTION_PAGE, paResMgr ) ),
613
    maRbOActWidth( this, ResId( RB_OPNACTION_WIDTH, paResMgr ) ),
614
    maRbOActVisible( this, ResId( RB_OPNACTION_VISIBLE, paResMgr ) ),
615
616
    mbResetAlreadyCalled( sal_False )
617
{
618
    mpaResMgr = paResMgr;
619
    FreeResource();
620
}
621
622
// -----------------------------------------------------------------------------
623
ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage()
624
{
625
    delete mpaResMgr;
626
}
627
628
// -----------------------------------------------------------------------------
629
SfxTabPage*  ImpPDFTabOpnFtrPage::Create( Window* pParent,
630
                                          const SfxItemSet& rAttrSet)
631
{
632
    ByteString aResMgrName( "pdffilter" );
633
    aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
634
    ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
635
    return ( new  ImpPDFTabOpnFtrPage( pParent, rAttrSet, paResMgr ) );
636
}
637
638
// -----------------------------------------------------------------------------
639
void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent  )
640
{
641
    paParent->mnNonFullScreenPageMode = 0;
642
    if( maRbNFSOutline.IsChecked() )
643
        paParent->mnNonFullScreenPageMode = 1;
644
    else if( maRbNFSThumbs.IsChecked() )
645
        paParent->mnNonFullScreenPageMode = 2;  
646
647
    paParent->mnOpenPDFDocumentMode = 0;
648
    if( maRbOpnOutline.IsChecked() )
649
        paParent->mnOpenPDFDocumentMode = 1;
650
    else if( maRbOpnThumbs.IsChecked() )
651
        paParent->mnOpenPDFDocumentMode = 2;
652
    else if( maRbOpnFull.IsChecked() )
653
        paParent->mnOpenPDFDocumentMode = 3;
654
655
    paParent->mnOpenPDFDocumentAction = 0;
656
    if( maRbOActPage.IsChecked() )
657
        paParent->mnOpenPDFDocumentAction = 1;
658
    else if( maRbOActWidth.IsChecked() )
659
        paParent->mnOpenPDFDocumentAction = 2;
660
    else if( maRbOActVisible.IsChecked() )
661
        paParent->mnOpenPDFDocumentAction = 3;
662
}
663
664
// -----------------------------------------------------------------------------
665
void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const  ImpPDFTabDialog* paParent )
666
{
667
    switch( paParent->mnNonFullScreenPageMode )
668
    {
669
    default:
670
    case 0:
671
        maRbNFSDefault.Check( );
672
        break;
673
    case 1:
674
        maRbNFSOutline.Check( );
675
        break;
676
    case 2:
677
        maRbNFSThumbs.Check( );
678
        break;
679
    }
680
681
    maRbOpnFull.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleFullScreenHdl ) );
682
683
    switch( paParent->mnOpenPDFDocumentMode )
684
    {
685
    default:
686
    case 0:
687
        maRbOpnDefault.Check();
688
        break;
689
    case 1:
690
        maRbOpnOutline.Check();
691
        break;
692
    case 2:
693
        maRbOpnThumbs.Check();
694
        break;
695
    case 3:
696
        maRbOpnFull.Check();
697
        break;
698
    };
699
    ToggleFullScreenHdl( NULL );
700
701
    switch( paParent->mnOpenPDFDocumentAction )
702
    {
703
    default:
704
    case 0:
705
        maRbOActDefault.Check();
706
        break;
707
    case 1:
708
        maRbOActPage.Check();
709
        break;
710
    case 2:
711
        maRbOActWidth.Check();
712
        break;
713
    case 3:
714
        maRbOActVisible.Check();
715
        break;
716
    };
717
}
718
719
// -----------------------------------------------------------------------------
720
void ImpPDFTabOpnFtrPage::Reset( const SfxItemSet& ignored)
721
{
722
//set the controls to default values
723
//since this is  called just after the data are set from the parent tab dialog
724
//a bool is needed to enable reset only the second time (user pressing it)
725
    if( mbResetAlreadyCalled )
726
    {
727
        maRbOpnDefault.Check();
728
        maRbOpnOutline.Check(FALSE);
729
        maRbOpnThumbs.Check(FALSE);
730
        maRbOpnFull.Check(FALSE);
731
732
        maRbOActDefault.Check();
733
        maRbOActPage.Check(FALSE);
734
        maRbOActWidth.Check(FALSE);
735
        maRbOActVisible.Check(FALSE);
736
737
        ToggleFullScreenHdl( NULL );
738
739
        maRbNFSDefault.Check();
740
        maRbNFSOutline.Check(FALSE);
741
        maRbNFSThumbs.Check(FALSE);
742
    }
743
    mbResetAlreadyCalled = sal_True;
744
}
745
746
// -----------------------------------------------------------------------------
747
IMPL_LINK( ImpPDFTabOpnFtrPage, ToggleFullScreenHdl, void*, p )
748
{
749
    maRbNFSDefault.Enable( maRbOpnFull.IsChecked() );
750
    maRbNFSOutline.Enable( maRbOpnFull.IsChecked() );
751
    maRbNFSThumbs.Enable( maRbOpnFull.IsChecked() );
752
    return 0;
753
}
(-)filter/source/pdf/impdialog.hrc (+43 lines)
Lines 35-40 Link Here
35
35
36
#include <filter.hrc>
36
#include <filter.hrc>
37
37
38
#define RID_PDF_EXPORT_DLG          (RID_PDF_DIALOG_START +   0)
39
#define RID_PDF_TAB_GENER           (RID_PDF_DIALOG_START +   1)
40
#define RID_PDF_TAB_VPREFER         (RID_PDF_DIALOG_START +   2)
41
#define RID_PDF_TAB_OPNFTR          (RID_PDF_DIALOG_START +   3)
42
#define STR_PDF_EXPORT              (RID_PDF_DIALOG_START +   4)
43
44
//ATTENTION: maximum above is( RID_PDF_DIALOG_START +   9)
45
46
//controls for General tab page
38
#define FL_PAGES					1
47
#define FL_PAGES					1
39
#define RB_ALL						2
48
#define RB_ALL						2
40
#define RB_RANGE					3
49
#define RB_RANGE					3
Lines 70-72 Link Here
70
#define RB_OLD_SCREEN		60
79
#define RB_OLD_SCREEN		60
71
#define RB_OLD_PRINT		61
80
#define RB_OLD_PRINT		61
72
#define RB_OLD_PRESS		62
81
#define RB_OLD_PRESS		62
82
83
//controls for open options tab page
84
#define FL_OPENMODE               80
85
86
#define RB_OPNMODE_DEFAULT        81
87
#define RB_OPNMODE_OUTLINE        82
88
#define RB_OPNMODE_THUMBS         83
89
#define RB_OPNMODE_FULL           84
90
91
#define FL_OPENACTION             85
92
93
#define RB_OPNACTION_DEFAULT      86
94
#define RB_OPNACTION_PAGE         87
95
#define RB_OPNACTION_WIDTH        88
96
#define RB_OPNACTION_VISIBLE      89
97
98
99
#define FL_FULLSCREEN             90
100
#define RB_NFULLS_DEFAULT         91
101
#define RB_NFULLS_OUTLINE         92
102
#define RB_NFULLS_THUMBS          93
103
104
//controls for viewer preferences tab page
105
#define FL_VIEWWINCTRL           100
106
#define CB_HIDEVMENUBAR          101
107
#define CB_HIDEVTOOLBAR          102
108
#define CB_HIDEVWINCTRL          103
109
#define CB_FITWINDOW             104
110
#define CB_CENTWINDOW            105
111
#define CB_DISPDOCTITLE          106
112
113
#define FL_DIRCONTR              107
114
#define RB_LEFTRIGHT             108
115
#define RB_RIGHTLEFT             109
(-)filter/source/pdf/impdialog.hxx (-39 / +194 lines)
Lines 44-102 Link Here
44
#include <vcl/edit.hxx>
44
#include <vcl/edit.hxx>
45
#include <vcl/lstbox.hxx>
45
#include <vcl/lstbox.hxx>
46
#include <vcl/combobox.hxx>
46
#include <vcl/combobox.hxx>
47
48
#ifndef _GROUP_HXX
49
#include <vcl/group.hxx>
50
#endif
47
#include <svtools/FilterConfigItem.hxx>
51
#include <svtools/FilterConfigItem.hxx>
48
52
53
#ifndef _SFXTABDLG_HXX
54
#include <sfx2/tabdlg.hxx>
55
#endif
56
49
// ----------------
57
// ----------------
50
// - ImpPDFDialog -
58
// - ImpPDFDialog -
51
// ----------------
59
// ----------------
52
60
53
class ResMgr;
61
class ResMgr;
54
62
class ImpPDFTabGeneralPage;
55
class ImpPDFDialog : public ModalDialog
63
class ImpPDFTabViewerPage;
64
class ImpPDFTabOpnFtrPage;
65
66
////////////////////////////////////////////////////////////////////////
67
//class tabbed dialog
68
class ImpPDFTabDialog : public SfxTabDialog
56
{
69
{
57
private:
70
private:
58
71
59
	FixedLine			                maFlPages;
72
    FixedLine                   maFlPages; //ugly hack: It seems the dialog is not resizable in any way
60
	RadioButton 		                maRbAll;
73
61
	RadioButton 		                maRbRange;
74
    FilterConfigItem            maConfigItem;
62
	RadioButton 		                maRbSelection;
75
63
	Edit				                maEdPages;
76
    Any                         maSelection;
64
	FixedLine			                maFlCompression;
77
65
	RadioButton 		                maRbLosslessCompression;
78
protected:
66
	RadioButton 		                maRbJPEGCompression;
79
67
	FixedText							maFtQuality;
80
    ResMgr*                     mprResMgr;
68
	MetricField						    maNfQuality;
81
//the following data are the configuration used throughout the dialog and pages
69
	CheckBox							maCbReduceImageResolution;
82
   	sal_Bool                    mbIsPresentation;
70
	ComboBox							maCoReduceImageResolution;
83
    sal_Bool                    mbIsWriter;
71
	FixedLine							maFlGeneral;
84
    sal_Bool                    mbSelectionPresent;
72
	CheckBox							maCbTaggedPDF;
85
    sal_Bool                    mbUseLosslessCompression;
73
	CheckBox							maCbExportNotes;
86
    sal_Int32                   mnQuality;
74
	CheckBox							maCbTransitionEffects;
87
    sal_Bool                    mbReduceImageResolution;
75
    FixedText                           maFtFormsFormat;
88
    sal_Int32                   mnMaxImageResolution;
76
	ListBox								maLbFormsFormat;
89
    sal_Bool                    mbUseTaggedPDF;
77
    CheckBox                            maCbExportEmptyPages;
90
    sal_Bool                    mbExportNotesBoth;
78
91
    sal_Bool                    mbUseTransitionEffects;
79
	OKButton		                    maBtnOK;
92
    sal_Bool                    mbIsSkipEmptyPages;
80
	CancelButton	                    maBtnCancel;
93
    sal_Int32                   mnFormsType;
81
	HelpButton                          maBtnHelp;
94
82
95
    sal_Bool                    mbHideViewerToolbar;
83
    FilterConfigItem                    maConfigItem;
96
    sal_Bool                    mbHideViewerMenubar;
84
    Any                                 maSelection;
97
    sal_Bool                    mbHideViewerWindowControls;
85
	sal_Bool							mbIsPresentation;
98
    sal_Bool                    mbFitWindow;
86
    sal_Bool                            mbIsWriter;
99
    sal_Bool                    mbCenterWindow;
87
100
    sal_Bool                    mbDisplayPDFDocumentTitle;
88
                                        DECL_LINK( TogglePagesHdl, void* );
101
    sal_Bool                    mbDirectionR2L;
89
                                        DECL_LINK( ToggleCompressionHdl, void* );
102
    sal_Int32                   mnOpenPDFDocumentMode;
90
                                        DECL_LINK( ToggleReduceImageResolutionHdl, void* );
103
    sal_Int32                   mnOpenPDFDocumentAction;
104
 
105
    sal_Int32                   mnNonFullScreenPageMode;
106
107
    sal_Bool                    mbIsRangeChecked;
108
    String                      msPageRange;
109
    sal_Bool                    mbSelectionIsChecked;
110
111
112
public:
113
114
    friend  class               ImpPDFTabGeneralPage;
115
    friend  class               ImpPDFTabViewerPage;
116
    friend  class               ImpPDFTabOpnFtrPage;
117
118
    ImpPDFTabDialog( Window* pParent, ResMgr& rResMgr,
119
                     Sequence< PropertyValue >& rFilterData,
120
                     const Reference< XComponent >& rDoc );
121
    ~ImpPDFTabDialog();
122
123
    Sequence< PropertyValue >   GetFilterData();
124
125
protected:
126
    virtual void                PageCreated( USHORT _nId,
127
                                             SfxTabPage& _rPage );
128
    virtual short               Ok();
129
};
130
131
//class tab page general
132
class ImpPDFTabGeneralPage : public SfxTabPage
133
{
134
    FixedLine                   maFlPages;
135
    RadioButton                 maRbAll;
136
    RadioButton                 maRbRange;
137
    RadioButton                 maRbSelection;
138
    Edit                        maEdPages;
139
140
    FixedLine                   maFlCompression;
141
    RadioButton                 maRbLosslessCompression;
142
    RadioButton                 maRbJPEGCompression;
143
    FixedText                   maFtQuality;
144
    MetricField                 maNfQuality;
145
    CheckBox                    maCbReduceImageResolution;
146
    ComboBox                    maCoReduceImageResolution;
147
148
    FixedLine                   maFlGeneral;
149
    CheckBox                    maCbTaggedPDF;
150
    CheckBox                    maCbExportNotes;
151
    CheckBox                    maCbTransitionEffects;
152
153
    FixedText                   maFtFormsFormat;
154
    ListBox                     maLbFormsFormat;
155
    CheckBox                    maCbExportEmptyPages;
156
157
    sal_Bool                    mbIsPresentation;
158
    sal_Bool                    mbIsWriter;
159
160
    sal_Bool                    mbResetAlreadyCalled;
161
162
    ResMgr*                     mpaResMgr;
163
164
    DECL_LINK( TogglePagesHdl, void* );
165
    DECL_LINK( ToggleCompressionHdl, void* );
166
    DECL_LINK( ToggleReduceImageResolutionHdl, void* );
91
167
92
public:
168
public:
169
    ImpPDFTabGeneralPage( Window* pParent,
170
                          const SfxItemSet& rSet,
171
                          ResMgr* paResMgr );
172
173
    ~ImpPDFTabGeneralPage();
174
    static SfxTabPage*          Create( Window* pParent,
175
                                        const SfxItemSet& rAttrSet);
176
177
    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent );
178
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
179
//this will set the default
180
    virtual void                Reset( const SfxItemSet& ignored);
181
};
182
183
//class tab page viewer
184
class ImpPDFTabViewerPage : public SfxTabPage
185
{
186
    FixedLine                   maFlViewWinCtrl;
187
    CheckBox                    maCbHideViewerMenubar;
188
    CheckBox                    maCbHideViewerToolbar;
189
    CheckBox                    maCbHideViewerWindowControls;
190
    CheckBox                    maCbFitWindow;
191
    CheckBox                    maCbCenterWindow;
192
    CheckBox                    maCbDispDocTitle;
193
194
    FixedLine                   maFlDirContrl;
195
    RadioButton                 maRbL2R;
196
    RadioButton                 maRbR2L;
93
197
94
                                        ImpPDFDialog( Window* pParent, ResMgr& rResMgr,
198
    sal_Bool                    mbResetAlreadyCalled;
95
                                                      Sequence< PropertyValue >& rFilterData,
96
                                                      const Reference< XComponent >& rDoc );
97
                                        ~ImpPDFDialog();
98
199
99
    Sequence< PropertyValue >           GetFilterData();
200
    ResMgr*                     mpaResMgr;
201
202
public:
203
    ImpPDFTabViewerPage( Window* pParent,
204
                         const SfxItemSet& rSet,
205
                         ResMgr* paResMgr );
206
207
    ~ImpPDFTabViewerPage();
208
    static SfxTabPage*          Create( Window* pParent,
209
                                        const SfxItemSet& rAttrSet );
210
211
    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
212
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
213
//this will set the default
214
    virtual void                Reset( const SfxItemSet& ignored);
215
};
216
217
//class tab page viewer
218
class ImpPDFTabOpnFtrPage : public SfxTabPage
219
{
220
    FixedLine                   maFlOpenMode;
221
    RadioButton                 maRbOpnDefault;
222
    RadioButton                 maRbOpnOutline;
223
    RadioButton                 maRbOpnThumbs;
224
    RadioButton                 maRbOpnFull;
225
226
    FixedLine                   maFlFullScreen;
227
    RadioButton                 maRbNFSDefault;
228
    RadioButton                 maRbNFSOutline;
229
    RadioButton                 maRbNFSThumbs;
230
231
    FixedLine			        maFlOpenAction;
232
    RadioButton                 maRbOActDefault;
233
    RadioButton                 maRbOActPage;
234
    RadioButton                 maRbOActWidth;
235
    RadioButton                 maRbOActVisible;
236
237
    sal_Bool                    mbResetAlreadyCalled;
238
239
    ResMgr*                     mpaResMgr;
240
241
    DECL_LINK( ToggleFullScreenHdl, void* );
242
public:
243
    ImpPDFTabOpnFtrPage( Window* pParent,
244
                         const SfxItemSet& rSet,
245
                         ResMgr* paResMgr );
246
247
    ~ImpPDFTabOpnFtrPage();
248
    static SfxTabPage*          Create( Window* pParent,
249
                                        const SfxItemSet& rAttrSet );
250
251
    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
252
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
253
//this will set the default
254
    virtual void                Reset( const SfxItemSet& ignored);
100
};
255
};
101
256
102
#endif // IMPDIALOG_HXX
257
#endif // IMPDIALOG_HXX
(-)filter/source/pdf/impdialog.src (-31 / +269 lines)
Lines 39-53 Link Here
39
 	Text [ de ] = "PDF Optionen";    \
39
 	Text [ de ] = "PDF Optionen";    \
40
	Text [ en-US ] = "PDF Options";  \
40
	Text [ en-US ] = "PDF Options";  \
41
41
42
ModalDialog RID_PDF_EXPORT_DLG
42
#define TAB_PDF_SIZE Size = MAP_APPFONT ( 176, 200 )
43
//string for TabDialog standard buttons
44
String STR_PDF_EXPORT
43
{
45
{
44
	OutputSize = TRUE ;
46
		Text[ de ] = "E~xportieren" ;
45
	SVLook = TRUE ;
47
		Text[ en-US ] = "E~xport";
46
    HelpId = HID_FILTER_PDF_OPTIONS;
48
};
47
	Size = MAP_APPFONT ( 230, 207 );
49
48
	Moveable = TRUE ;
50
//////////////////////////////////////////////////////////////
49
	Closeable = TRUE ;
51
//tab page for PDF Export, general preferences
50
    WORKARROUND
52
TabPage  RID_PDF_TAB_GENER
53
{
54
	HelpId = HID_FILTER_PDF_OPTIONS ;
55
	Hide = TRUE ;
56
	Text[ de ] = "Allgemein";
57
	Text[ en-US ] = "General";
58
	TAB_PDF_SIZE;
59
51
	FixedLine FL_PAGES
60
	FixedLine FL_PAGES
52
	{
61
	{
53
		Pos = MAP_APPFONT ( 6 , 3 ) ;
62
		Pos = MAP_APPFONT ( 6 , 3 ) ;
Lines 206-232 ModalDialog RID_PDF_EXPORT_DLG Link Here
206
        Text[ de ] = "Automatisch eingefügte ~Leerseiten exportieren" ;
215
        Text[ de ] = "Automatisch eingefügte ~Leerseiten exportieren" ;
207
        Text[ en-US ] = "Export automatically inserted ~blank pages";
216
        Text[ en-US ] = "Export automatically inserted ~blank pages";
208
    };
217
    };
209
    OKButton BT_OK
218
};
210
	{
219
211
		Pos = MAP_APPFONT( 174, 6 );
220
//////////////////////////////////////////////////////////////
212
		Size = MAP_APPFONT( 50 , 14 );
221
//tab page for PDF Export, opening features
213
		TabStop = TRUE ;
222
TabPage  RID_PDF_TAB_OPNFTR
214
		DefButton = TRUE ;
223
{
215
		Text[ de ] = "E~xportieren" ;
224
    HelpId = 0 ;
216
		Text[ en-US ] = "E~xport";
225
    Text[ de ] = "Opening Features" ;
217
	};
226
    Text[ en-US ] = "Opening Features" ;
218
	CancelButton BT_CANCEL
227
    TAB_PDF_SIZE;
219
	{
228
220
		Pos = MAP_APPFONT( 174, 23 );
229
////////////////////////////////////////
221
		Size = MAP_APPFONT( 50 , 14 );
230
    FixedLine FL_OPENMODE
222
		TabStop = TRUE ;
231
    {
223
		DefButton = TRUE ;
232
        Pos = MAP_APPFONT ( 6 , 3 ) ;
224
	};
233
        Size = MAP_APPFONT ( 162 , 8 ) ;
225
	HelpButton BT_HELP
234
        Text[ de ] = "Opening Mode" ;
226
	{
235
        Text[ en-US ] = "PDF document display mode" ;
227
		Pos = MAP_APPFONT( 174, 43 );
236
    };
228
		Size = MAP_APPFONT( 50 , 14 ) ;
237
    RadioButton  RB_OPNMODE_DEFAULT
229
		TabStop = TRUE ;
238
    {
230
		DefButton = TRUE ;
239
        Pos = MAP_APPFONT ( 12 , 14 ) ;
231
	};
240
        Size = MAP_APPFONT ( 155 , 11 ) ;
241
        Text[ de ] = "St~andard" ;
242
        Text[ en-US ] = "~Neither document outline nor thumbnail visible" ;
243
    };
244
    RadioButton  RB_OPNMODE_OUTLINE
245
    {
246
        Pos = MAP_APPFONT ( 12 , 26 ) ;
247
        Size = MAP_APPFONT ( 155 , 11 ) ;
248
        Text[ de ] = "~Outline visible" ;
249
        Text[ en-US ] = "Document ~outline visible" ;
250
    };
251
    RadioButton  RB_OPNMODE_THUMBS
252
    {
253
        Pos = MAP_APPFONT ( 12 , 38 ) ;
254
        Size = MAP_APPFONT ( 155 , 11 ) ;
255
        Text[ de ] = "Thumbnails Visible" ;
256
        Text[ en-US ] = "~Thumbnails images visible" ;
257
    };
258
    RadioButton  RB_OPNMODE_FULL
259
    {
260
        Pos = MAP_APPFONT ( 12 , 50 ) ;
261
        Size = MAP_APPFONT ( 155 , 11 ) ;
262
        Text[ de ] = "Full ~Screen" ;
263
        Text[ en-US ] = "Full ~screen" ;
264
    };
265
266
////////////////////////////////////////
267
    FixedLine FL_FULLSCREEN
268
    {
269
/*
270
In PDF ref v1.5 tab 8.1 this is described as:
271
272
"The document's page mode, specifying how to display the
273
document on exiting full-screen mode."
274
275
Instead the Acro Reader uses it both as a Full screen display mode and a exit
276
from full screen display mode.
277
 */
278
        Pos = MAP_APPFONT ( 6 , 70 ) ;
279
        Size = MAP_APPFONT (162  , 8 ) ;
280
        Text[ de ] = "Full Screen Mode" ;
281
        Text[ en-US ] = "Display mode when exiting full screen" ;
282
    };
283
    RadioButton  RB_NFULLS_DEFAULT
284
    {
285
        Pos = MAP_APPFONT ( 12 , 82 ) ;
286
        Size = MAP_APPFONT ( 155 , 11 ) ;
287
        Text[ de ] = "~None" ;
288
        Text[ en-US ] = "Neither ~document outline nor thumbnail visible" ;
289
    };
290
    RadioButton  RB_NFULLS_OUTLINE
291
    {
292
        Pos = MAP_APPFONT ( 12 , 94 ) ;
293
        Size = MAP_APPFONT ( 155 , 11 ) ;
294
        Text[ de ] = "~Outline visible" ;
295
        Text[ en-US ] = "Document Out~line visible" ;
296
    };
297
    RadioButton  RB_NFULLS_THUMBS
298
    {
299
        Pos = MAP_APPFONT ( 12 , 108 ) ;
300
        Size = MAP_APPFONT ( 155 , 11 ) ;
301
        Text[ de ] = "~Thumbnails visible" ;
302
        Text[ en-US ] = "Thumbnails ~images visible" ;
303
    };
304
305
///////////////////////////////////////////////////
306
    FixedLine FL_OPENACTION
307
    {
308
        Pos = MAP_APPFONT ( 6 , 128 ) ;
309
        Size = MAP_APPFONT ( 162 , 8 ) ;
310
        Text[ de ] = "Opening Action" ;
311
        Text[ en-US ] = "Action to be performed when the PDF document is opened" ;
312
    };
313
    RadioButton  RB_OPNACTION_DEFAULT
314
    {
315
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /XYZ )
316
        Pos = MAP_APPFONT ( 12 , 140 ) ;
317
        Size = MAP_APPFONT ( 155 , 11 ) ;
318
        Text[ de ] = "~Default Zoom" ;
319
        Text[ en-US ] = "First page at the default ~zoom factor" ;
320
    };
321
    RadioButton  RB_OPNACTION_PAGE
322
    {
323
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /Fit )
324
        Pos = MAP_APPFONT ( 12 , 152 ) ;
325
        Size = MAP_APPFONT ( 155 , 11 ) ;
326
        Text[ de ] = "Fit Page ~Heigt" ;
327
        Text[ en-US ] = "First page fit page ~height" ;
328
    };
329
    RadioButton  RB_OPNACTION_WIDTH
330
    {
331
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitH top )
332
        Pos = MAP_APPFONT ( 12 , 164 ) ;
333
        Size = MAP_APPFONT ( 155 , 11 ) ;
334
        Text[ de ] = "Fit Page ~Widht" ;
335
        Text[ en-US ] = "First page fit page ~width" ;
336
    };
337
    RadioButton  RB_OPNACTION_VISIBLE
338
    {
339
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitBH top )
340
        Pos = MAP_APPFONT ( 12 , 176 ) ;
341
        Size = MAP_APPFONT ( 155 , 11 ) ;
342
        Text[ de ] = "First page fit ~Visible" ;
343
        Text[ en-US ] = "First page fit ~visible" ;
344
        Text [ x-comment ] = " ";
345
    };
346
};
347
348
//////////////////////////////////////////////////////////////
349
//tab page for PDF Export, viewer preferences
350
TabPage  RID_PDF_TAB_VPREFER
351
{
352
    HelpId = 0 ;
353
    Text[ de ] = "Viewer Preferences" ;
354
    Text[ en-US ] = "Viever preferences" ;
355
    TAB_PDF_SIZE;
356
357
    FixedLine FL_VIEWWINCTRL
358
    {
359
        Pos = MAP_APPFONT ( 6 , 3 ) ;
360
        Size = MAP_APPFONT (162  , 8 ) ;
361
        Text[ de ] = "Viewer Window Control" ;
362
        Text[ en-US ] = "Viewer application's window control" ;
363
    };
364
    CheckBox CB_HIDEVMENUBAR
365
    {
366
        Pos = MAP_APPFONT ( 12 , 14 ) ;
367
        Size = MAP_APPFONT ( 155 , 11 ) ;
368
        TabStop = TRUE ;
369
        Text[ de ] = "Hide ~Menu Bar" ;
370
        Text[ en-US ] = "Hide ~menu bar";
371
    };
372
    CheckBox CB_HIDEVTOOLBAR
373
    {
374
        Pos = MAP_APPFONT ( 12 , 26 ) ;
375
        Size = MAP_APPFONT ( 155 , 11 ) ;
376
        TabStop = TRUE ;
377
        Text[ de ] = "Hide T~ool Bar" ;
378
        Text[ en-US ] = "Hide t~ool bar";
379
    };
380
    CheckBox CB_HIDEVWINCTRL
381
    {
382
        Pos = MAP_APPFONT ( 12 , 38 ) ;
383
        Size = MAP_APPFONT ( 155 , 11 ) ;
384
        TabStop = TRUE ;
385
        Text[ de ] = "Hide Viewer Window ~Controls" ;
386
        Text[ en-US ] = "Hide ~window controls";
387
    };
388
    CheckBox CB_FITWINDOW
389
    {
390
        Pos = MAP_APPFONT ( 12 , 50 ) ;
391
        Size = MAP_APPFONT ( 155 , 11 ) ;
392
        TabStop = TRUE ;
393
        Text[ de ] = "~Fit Window" ;
394
        Text[ en-US ] = "~Fit window to the first displayed page";
395
    };
396
    CheckBox CB_CENTWINDOW
397
    {
398
        Pos = MAP_APPFONT ( 12 , 62 ) ;
399
        Size = MAP_APPFONT ( 155 , 11 ) ;
400
        TabStop = TRUE ;
401
        Text[ de ] = "~Center Window" ;
402
        Text[ en-US ] = "~Center window on the screen";
403
    };
404
    CheckBox CB_DISPDOCTITLE
405
    {
406
        Pos = MAP_APPFONT ( 12 , 74 ) ;
407
        Size = MAP_APPFONT ( 155 , 11 ) ;
408
        TabStop = TRUE ;
409
        Text[ de ] = "Display Document ~Title" ;
410
        Text[ en-US ] = "Display document ~title on viewer application's title bar";
411
    };
412
413
///////////////////////////
414
    FixedLine FL_DIRCONTR
415
    {
416
        Pos = MAP_APPFONT ( 6 ,  94) ;
417
        Size = MAP_APPFONT ( 162  , 8 ) ;
418
        Text[ de ] = "Direction Control" ;
419
        Text[ en-US ] = "Main reading order for text" ;
420
    };
421
    RadioButton  RB_LEFTRIGHT
422
    {
423
        Pos = MAP_APPFONT ( 12 , 106 ) ;
424
        Size = MAP_APPFONT ( 155 , 11 ) ;
425
        Text[ de ] = "Left to ~right" ;
426
        Text[ en-US ] = "Left to ~right" ;
427
    };
428
    RadioButton  RB_RIGHTLEFT
429
    {
430
        Pos = MAP_APPFONT ( 12 , 118 ) ;
431
        Size = MAP_APPFONT ( 155 , 11 ) ;
432
        Text[ de ] = "Right to ~left" ;
433
        Text[ en-US ] = "Right to ~left" ;
434
    };
435
};
436
437
TabDialog  RID_PDF_EXPORT_DLG
438
{
439
    HelpId = HID_FILTER_PDF_OPTIONS ;
440
    OutputSize = TRUE;
441
    SVLook = TRUE;
442
    Moveable = TRUE;
443
    WORKARROUND
444
        TabControl 1
445
    {
446
        HelpId = HID_FILTER_PDF_OPTIONS ;
447
        OutputSize = TRUE;
448
        PageList =
449
        {
450
            PageItem
451
            {
452
                Identifier = RID_PDF_TAB_GENER;
453
                Text [ de ] = "Allgemein";
454
                Text [ en-US ] = "General";
455
            };
456
            PageItem
457
            {
458
                Identifier = RID_PDF_TAB_OPNFTR;
459
                Text [ de ] = "Opening Features";
460
                Text [ en-US ] = "Opening Features";
461
            };
462
            PageItem
463
            {
464
                Identifier = RID_PDF_TAB_VPREFER;
465
                Text [ de ] = "Viewer Preferences";
466
                Text [ en-US ] = "Viewer Preferences";
467
            };
468
        };
469
    };
232
};
470
};
(-)filter/source/pdf/makefile.mk (+1 lines)
Lines 68-73 SHL1STDLIBS=\ Link Here
68
	$(TKLIB)			\
68
	$(TKLIB)			\
69
	$(VCLLIB)			\
69
	$(VCLLIB)			\
70
	$(SVLLIB)			\
70
	$(SVLLIB)			\
71
	$(SFX2LIB)			\
71
	$(UNOTOOLSLIB)		\
72
	$(UNOTOOLSLIB)		\
72
	$(TOOLSLIB)			\
73
	$(TOOLSLIB)			\
73
	$(COMPHELPERLIB)	\
74
	$(COMPHELPERLIB)	\
(-)filter/source/pdf/pdfdialog.cxx (-3 / +4 lines)
Lines 50-55 using namespace ::com::sun::star::uno; Link Here
50
using namespace ::com::sun::star::lang;
50
using namespace ::com::sun::star::lang;
51
using namespace ::com::sun::star::beans;
51
using namespace ::com::sun::star::beans;
52
52
53
//uncomment this to use the Tabbed PDF dialog (under development !)
54
53
// -----------------------
55
// -----------------------
54
// - PDFDialog functions -
56
// - PDFDialog functions -
55
// -----------------------
57
// -----------------------
Lines 179-185 Dialog* PDFDialog::createDialog( Window* Link Here
179
181
180
    if( mpResMgr && mxSrcDoc.is() )
182
    if( mpResMgr && mxSrcDoc.is() )
181
    {
183
    {
182
        ImpPDFDialog* pDlg = new ImpPDFDialog( pParent, *mpResMgr, maFilterData, mxSrcDoc );
184
        ImpPDFTabDialog* pDlg = new ImpPDFTabDialog( pParent, *mpResMgr, maFilterData, mxSrcDoc );
183
        pRet = pDlg;
185
        pRet = pDlg;
184
    }
186
    }
185
187
Lines 191-198 Dialog* PDFDialog::createDialog( Window* Link Here
191
void PDFDialog::executedDialog( sal_Int16 nExecutionResult )
193
void PDFDialog::executedDialog( sal_Int16 nExecutionResult )
192
{
194
{
193
    if( nExecutionResult && m_pDialog )
195
    if( nExecutionResult && m_pDialog )
194
        maFilterData = static_cast< ImpPDFDialog* >( m_pDialog )->GetFilterData();
196
        maFilterData = static_cast< ImpPDFTabDialog* >( m_pDialog )->GetFilterData();
195
196
    destroyDialog();
197
    destroyDialog();
197
}
198
}
198
199
(-)filter/source/pdf/pdfexport.cxx (-1 / +71 lines)
Lines 281-286 sal_Bool PDFExport::Export( const OUStri Link Here
281
					aCreator.AppendAscii( "Math" );
281
					aCreator.AppendAscii( "Math" );
282
			}
282
			}
283
283
284
            PDFWriter::PDFWriterContext aContext;
285
            sal_Int32             nPDFDocumentMode = 0, nPDFDocumentAction = 0, nPDFNonFullScreen = 0;
286
284
            for( sal_Int32 nData = 0, nDataCount = rFilterData.getLength(); nData < nDataCount; ++nData )
287
            for( sal_Int32 nData = 0, nDataCount = rFilterData.getLength(); nData < nDataCount; ++nData )
285
            {
288
            {
286
				if( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) )
289
				if( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) )
Lines 307-317 sal_Bool PDFExport::Export( const OUStri Link Here
307
					rFilterData[ nData ].Value >>= mbUseTransitionEffects;
310
					rFilterData[ nData ].Value >>= mbUseTransitionEffects;
308
				else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ) )
311
				else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ) )
309
					rFilterData[ nData ].Value >>= mnFormsFormat;
312
					rFilterData[ nData ].Value >>= mnFormsFormat;
313
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ) )
314
                    rFilterData[ nData ].Value >>= aContext.HideViewerToolbar;
315
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ) )
316
                    rFilterData[ nData ].Value >>= aContext.HideViewerMenubar;
317
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ) )
318
                    rFilterData[ nData ].Value >>= aContext.HideViewerWindowControls;
319
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ) )
320
                    rFilterData[ nData ].Value >>= aContext.FitWindow;
321
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ) )
322
                    rFilterData[ nData ].Value >>= aContext.CenterWindow;
323
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ) )
324
                    rFilterData[ nData ].Value >>= aContext.DisplayPDFDocumentTitle;
325
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ) )
326
                    rFilterData[ nData ].Value >>= aContext.DirectionR2L;
327
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ) )
328
                    rFilterData[ nData ].Value >>= nPDFDocumentMode;
329
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ) )
330
                    rFilterData[ nData ].Value >>= nPDFDocumentAction;
331
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ) )
332
                    rFilterData[ nData ].Value >>= nPDFNonFullScreen;
310
            }
333
            }
311
            PDFWriter::PDFWriterContext aContext;
312
            aContext.URL		= aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
334
            aContext.URL		= aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
313
            aContext.Version	= PDFWriter::PDF_1_4;
335
            aContext.Version	= PDFWriter::PDF_1_4;
314
			aContext.Tagged		= mbUseTaggedPDF;
336
			aContext.Tagged		= mbUseTaggedPDF;
337
338
            switch( nPDFDocumentMode )
339
            {
340
                default:
341
                case 0:
342
                    aContext.PDFDocumentMode = PDFWriter::ModeDefault;
343
                    break;
344
                case 1:
345
                    aContext.PDFDocumentMode = PDFWriter::UseOutlines;
346
                    break;
347
                case 2:
348
                    aContext.PDFDocumentMode = PDFWriter::UseThumbs;
349
                    break;
350
                case 3:
351
                    aContext.PDFDocumentMode = PDFWriter::FullScreen;
352
                    break;
353
            }
354
            switch( nPDFDocumentAction )
355
            {
356
                default:
357
                case 0:
358
                    aContext.PDFDocumentAction = PDFWriter::ActionDefault;
359
                    break;
360
                case 1:
361
                    aContext.PDFDocumentAction = PDFWriter::FitHeight;
362
                    break;
363
                case 2:
364
                    aContext.PDFDocumentAction = PDFWriter::FitWidth;
365
                    break;
366
                case 3:
367
                    aContext.PDFDocumentAction = PDFWriter::FitVisible;
368
                    break;
369
            }
370
371
            switch( nPDFNonFullScreen )
372
            {
373
                default:
374
                case 0:
375
                    aContext.NonFullScreenPageMode = PDFWriter::ModeDefault;
376
                    break;
377
                case 1:
378
                    aContext.NonFullScreenPageMode = PDFWriter::UseOutlines;
379
                    break;
380
                case 2:
381
                    aContext.NonFullScreenPageMode = PDFWriter::UseThumbs;
382
                    break;
383
            }
384
315
            /*
385
            /*
316
            * FIXME: the entries are only implicitly defined by the resource file. Should there
386
            * FIXME: the entries are only implicitly defined by the resource file. Should there
317
            * ever be an additional form submit format this could get invalid.
387
            * ever be an additional form submit format this could get invalid.
(-)filter/source/pdf/pdffilter.cxx (+9 lines)
Lines 90-95 sal_Bool PDFFilter::implExport( const Se Link Here
90
		aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True );
90
		aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True );
91
		aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False );
91
		aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False );
92
		aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 );
92
		aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 );
93
        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), sal_False );
94
        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), sal_False );
95
        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), sal_False );
96
        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), sal_False );
97
        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), sal_False );
98
        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), sal_False );
99
        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), sal_False );
100
        aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), 0 );
101
        aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), 0 );
93
		aFilterData = aCfgItem.GetFilterData();
102
		aFilterData = aCfgItem.GetFilterData();
94
	}
103
	}
95
    if( mxSrcDoc.is() && xOStm.is() )
104
    if( mxSrcDoc.is() && xOStm.is() )
(-)officecfg/registry/schema/org/openoffice/Office/Common.xcs (+131 lines)
Lines 4878-4883 Dymamic border coloring means that when Link Here
4878
                                                </info>
4878
                                                </info>
4879
                                                <value>false</value>
4879
                                                <value>false</value>
4880
                                        </prop>
4880
                                        </prop>
4881
					<prop oor:name="HideViewerMenubar" oor:type="xs:boolean">
4882
						<info>
4883
							<author>beppec56</author>
4884
							<desc>Specifies whether to hide the PDF viewer menubar when the document is active.</desc>
4885
						</info>
4886
						<value>false</value>
4887
					</prop>
4888
					<prop oor:name="HideViewerToolbar" oor:type="xs:boolean">
4889
						<info>
4890
							<author>beppec56</author>
4891
							<desc>Specifies whether to hide the PDF viewer toolbar when the document is active.</desc>
4892
						</info>
4893
						<value>false</value>
4894
					</prop>
4895
					<prop oor:name="HideViewerWindowControls" oor:type="xs:boolean">
4896
						<info>
4897
							<author>beppec56</author>
4898
							<desc>.</desc>
4899
						</info>
4900
						<value>false</value>
4901
					</prop>
4902
					<prop oor:name="FitWindow" oor:type="xs:boolean">
4903
						<info>
4904
							<author>beppec56</author>
4905
							<desc>Spefifies that the PDF viewer window is opened full screen when the document is opened.</desc>
4906
						</info>
4907
						<value>false</value>
4908
					</prop>
4909
					<prop oor:name="CenterWindow" oor:type="xs:boolean">
4910
						<info>
4911
							<author>beppec56</author>
4912
							<desc>Spefifies that the PDF viewer window is centered to the screen when the PDF document is opened.</desc>
4913
						</info>
4914
						<value>false</value>
4915
					</prop>
4916
					<prop oor:name="DisplayPDFDocumentTitle" oor:type="xs:boolean">
4917
						<info>
4918
							<author>beppec56</author>
4919
							<desc>Specifies that the title of the document, if present in the document properties, is displayed in the PDF viewer window title bar.</desc>
4920
						</info>
4921
						<value>true</value>
4922
					</prop>
4923
					<prop oor:name="DirectionR2L" oor:type="xs:boolean">
4924
						<info>
4925
							<author>beppec56</author>
4926
							<desc>Specifie the</desc>
4927
						</info>
4928
						<value>false</value>
4929
					</prop>
4930
					<prop oor:name="OpenPDFDocumentMode" oor:type="xs:int">
4931
						<info>
4932
							<author>beppec56</author>
4933
							<desc>Specifies how the PDF document should be displayed when opened.</desc>
4934
						</info>
4935
						<constraints>
4936
							<enumeration oor:value="0">
4937
								<info>
4938
									<desc>Select the default viewer mode, neither outlines or thumbnails.</desc>
4939
								</info>
4940
							</enumeration>
4941
							<enumeration oor:value="1">
4942
								<info>
4943
									<desc>The document is opened with outline pane opened</desc>
4944
								</info>
4945
							</enumeration>
4946
							<enumeration oor:value="2">
4947
								<info>
4948
									<desc>The document is opened with thumbnails pane opened</desc>
4949
								</info>
4950
							</enumeration>
4951
							<enumeration oor:value="3">
4952
								<info>
4953
									<desc>The document is opened full screen, on top of all windows.</desc>
4954
								</info>
4955
							</enumeration>
4956
						</constraints>
4957
						<value>0</value>
4958
					</prop>
4959
					<prop oor:name="OpenPDFDocumentAction" oor:type="xs:int">
4960
						<info>
4961
							<author>beppec56</author>
4962
							<desc>Specifies the action to be performed when the PDF document is opened.</desc>
4963
						</info>
4964
						<constraints>
4965
							<enumeration oor:value="0">
4966
								<info>
4967
									<desc>Opens on top of the first page of the PDF document, with default zoom magnification.</desc>
4968
								</info>
4969
							</enumeration>
4970
							<enumeration oor:value="1">
4971
								<info>
4972
									<desc>Opens on top of the first page of the PDF document, with its contents magnified to fit the entire page within the window.</desc>
4973
								</info>
4974
							</enumeration>
4975
							<enumeration oor:value="2">
4976
								<info>
4977
									<desc>Opens on top of the first page of the PDF document, with its contents magnified to fit the entire page width within the window.</desc>
4978
								</info>
4979
							</enumeration>
4980
							<enumeration oor:value="3">
4981
								<info>
4982
									<desc>Opens on top of the first page of the PDF document, with its contents magnified to fit the entire width of its boundig box within the window (cuts out margins).</desc>
4983
								</info>
4984
							</enumeration>
4985
						</constraints>
4986
						<value>0</value>
4987
					</prop>
4988
					<prop oor:name="NonFullScreenPageMode" oor:type="xs:int">
4989
						<info>
4990
							<author>beppec56</author>
4991
							<desc>Specifies the action to be performed when the PDF display mode exits from full screen mode.</desc>
4992
						</info>
4993
						<constraints>
4994
							<enumeration oor:value="0">
4995
								<info>
4996
									<desc>Neither document outline nor thumbnail images visible</desc>
4997
								</info>
4998
							</enumeration>
4999
							<enumeration oor:value="1">
5000
								<info>
5001
									<desc>Document outline visible</desc>
5002
								</info>
5003
							</enumeration>
5004
							<enumeration oor:value="2">
5005
								<info>
5006
									<desc>Thumbnail images visible</desc>
5007
								</info>
5008
							</enumeration>
5009
						</constraints>
5010
						<value>0</value>
5011
					</prop>
4881
				</group>
5012
				</group>
4882
			</group>
5013
			</group>
4883
		</group>
5014
		</group>
(-)vcl/inc/pdfwriter.hxx (-1 / +48 lines)
Lines 419-424 public: Link Here
419
    };
419
    };
420
420
421
    enum ExportDataFormat { HTML, XML, FDF, PDF };
421
    enum ExportDataFormat { HTML, XML, FDF, PDF };
422
// see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
423
// These emuns are treated as integer while reading/writing to configuration
424
    enum PDFViewerPageMode
425
    {
426
        ModeDefault,
427
        UseOutlines,
428
        UseThumbs,
429
        FullScreen
430
    };
431
// These emuns are treated as integer while reading/writing to configuration
432
    enum PDFViewerAction
433
    {
434
        ActionDefault,
435
        FitHeight,
436
        FitWidth,
437
        FitVisible
438
    };
439
422
    struct PDFWriterContext
440
    struct PDFWriterContext
423
    {
441
    {
424
        /* must be a valid file: URL usable by osl */
442
        /* must be a valid file: URL usable by osl */
Lines 433-443 public: Link Here
433
            will be submitted.
451
            will be submitted.
434
         */
452
         */
435
        PDFWriter::ExportDataFormat		SubmitFormat;
453
        PDFWriter::ExportDataFormat		SubmitFormat;
454
        /* the following data members are used to customize the PDF viewer
455
           preferences
456
         */
457
        /* see 3.6.1 PDF v 1.4 ref*/
458
        PDFWriter::PDFViewerPageMode    PDFDocumentMode;
459
        PDFWriter::PDFViewerAction      PDFDocumentAction;
460
461
        /* see 8.6 PDF v 1.4 ref
462
           specifies whether to hide the viewer tool
463
          bars when the document is active.
464
        */
465
        bool                            HideViewerToolbar;
466
        bool                            HideViewerMenubar;
467
        bool                            HideViewerWindowControls;
468
        bool                            FitWindow;
469
        bool                            CenterWindow;
470
        bool                            DisplayPDFDocumentTitle;
471
        bool                            DirectionR2L;
472
        PDFViewerPageMode               NonFullScreenPageMode;
436
473
437
        PDFWriterContext() :
474
        PDFWriterContext() :
438
                Version( PDFWriter::PDF_1_4 ),
475
                Version( PDFWriter::PDF_1_4 ),
439
                Tagged( false ),
476
                Tagged( false ),
440
                SubmitFormat( PDFWriter::FDF )
477
                SubmitFormat( PDFWriter::FDF ),
478
                PDFDocumentMode( PDFWriter::ModeDefault ),
479
                PDFDocumentAction( PDFWriter::ActionDefault ),
480
                HideViewerToolbar( false ),
481
                HideViewerMenubar( false ),
482
                HideViewerWindowControls( false ),
483
                FitWindow( false ),
484
                CenterWindow( false ),
485
                DisplayPDFDocumentTitle( false ),
486
                DirectionR2L( false ),
487
                NonFullScreenPageMode( PDFWriter::ModeDefault )
441
        {}
488
        {}
442
    };
489
    };
443
490
(-)vcl/source/gdi/pdfwriter_impl.cxx (-3 / +90 lines)
Lines 3412-3422 bool PDFWriterImpl::emitLinkAnnotations( Link Here
3412
                      "   /Border [0 0 0]\r\n"
3412
                      "   /Border [0 0 0]\r\n"
3413
                      "   /Rect [" );
3413
                      "   /Rect [" );
3414
3414
3415
        appendFixedInt( rLink.m_aRect.Left(), aLine );
3415
        appendFixedInt( rLink.m_aRect.Left()-7, aLine );//the +7 to have a better shape of the border rectangle
3416
        aLine.append( ' ' );
3416
        aLine.append( ' ' );
3417
        appendFixedInt( rLink.m_aRect.Top(), aLine );
3417
        appendFixedInt( rLink.m_aRect.Top(), aLine );
3418
        aLine.append( ' ' );        
3418
        aLine.append( ' ' );        
3419
        appendFixedInt( rLink.m_aRect.Right(), aLine );
3419
        appendFixedInt( rLink.m_aRect.Right()+7, aLine );//the +7 to have a better shape of the border rectangle
3420
        aLine.append( ' ' );        
3420
        aLine.append( ' ' );        
3421
        appendFixedInt( rLink.m_aRect.Bottom(), aLine );
3421
        appendFixedInt( rLink.m_aRect.Bottom(), aLine );
3422
        aLine.append( "]\r\n" );
3422
        aLine.append( "]\r\n" );
Lines 4293-4299 bool PDFWriterImpl::emitCatalog() Link Here
4293
        return false;
4293
        return false;
4294
4294
4295
    // emit tree node
4295
    // emit tree node
4296
    OStringBuffer aLine( 1024 );
4296
    OStringBuffer aLine( 2048 );
4297
    aLine.append( nTreeNode );
4297
    aLine.append( nTreeNode );
4298
    aLine.append( " 0 obj\r\n" );
4298
    aLine.append( " 0 obj\r\n" );
4299
    aLine.append( "<< /Type /Pages\r\n" );
4299
    aLine.append( "<< /Type /Pages\r\n" );
Lines 4345-4350 bool PDFWriterImpl::emitCatalog() Link Here
4345
                  "   /Pages " );
4345
                  "   /Pages " );
4346
    aLine.append( nTreeNode );
4346
    aLine.append( nTreeNode );
4347
    aLine.append( " 0 R\r\n" );
4347
    aLine.append( " 0 R\r\n" );
4348
    if( m_aContext.PDFDocumentMode != PDFWriter::ModeDefault )
4349
    {
4350
        switch(  m_aContext.PDFDocumentMode )
4351
        {
4352
            case PDFWriter::UseOutlines :
4353
            default :
4354
                aLine.append( "/PageMode/UseOutlines\n" ); //document is opened with outline pane open
4355
                break;
4356
            case PDFWriter::UseThumbs :
4357
                aLine.append( "/PageMode/UseThumbs\n" ); //document is opened with thumbnails pane open
4358
                break;
4359
            case PDFWriter::FullScreen :
4360
                aLine.append( "/PageMode/FullScreen\n" ); //document is opened full screen
4361
                break;
4362
        }
4363
    }
4364
    switch( m_aContext.PDFDocumentAction )
4365
    {
4366
        case PDFWriter::ActionDefault :
4367
        default:
4368
            aLine.append( "/OpenAction [0 /XYZ null null null" ); //page 0 (first) open Default, leave without it
4369
            break;
4370
        case PDFWriter::FitHeight :
4371
            aLine.append( "/OpenAction [0 /Fit" ); //Open fit page
4372
            break;
4373
        case PDFWriter::FitWidth :
4374
            aLine.append( "/OpenAction [0 /FitH " );
4375
            aLine.append( m_nInheritedPageHeight );//Open fit width
4376
            break;
4377
        case PDFWriter::FitVisible :
4378
            aLine.append( "/OpenAction [0 /FitBH " );
4379
            aLine.append( m_nInheritedPageHeight );//Open fit visible
4380
            break;
4381
    }
4382
    aLine.append( "]\n" );
4383
// viewer preferences, if we had some, then emit
4384
    if( m_aContext.HideViewerToolbar ||
4385
        ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
4386
        m_aContext.HideViewerMenubar ||
4387
        m_aContext.HideViewerWindowControls ||
4388
        m_aContext.FitWindow ||
4389
        m_aContext.CenterWindow ||
4390
        m_aContext.DirectionR2L ||
4391
        ( m_aContext.NonFullScreenPageMode != PDFWriter::ModeDefault &&
4392
            m_aContext.PDFDocumentMode == PDFWriter::FullScreen ) )
4393
    {
4394
        aLine.append( "/ViewerPreferences<<" );
4395
        if( m_aContext.HideViewerToolbar )
4396
            aLine.append( "/HideToolbar true\n" );
4397
        if( m_aContext.HideViewerMenubar )
4398
            aLine.append( "/HideMenubar true\n" );
4399
        if( m_aContext.HideViewerWindowControls )
4400
            aLine.append( "/HideWindowUI true\n" );
4401
        if( m_aContext.FitWindow )
4402
            aLine.append("/FitWindow true\n");
4403
        if( m_aContext.CenterWindow )
4404
            aLine.append("/CenterWindow true\n");
4405
        if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
4406
            aLine.append( "/DisplayDocTitle true\n" );
4407
        if( m_aContext.DirectionR2L )
4408
            aLine.append("/Direction /R2L\n");
4409
        if( m_aContext.NonFullScreenPageMode != PDFWriter::ModeDefault &&
4410
            m_aContext.PDFDocumentMode == PDFWriter::FullScreen )
4411
        {
4412
            switch( m_aContext.NonFullScreenPageMode )
4413
            {
4414
                default :
4415
                case PDFWriter::ModeDefault :
4416
                {
4417
                    aLine.append("/NonFullScreenPageMode/UseNone\n");
4418
                }
4419
                break;
4420
                case PDFWriter::UseOutlines :
4421
                {
4422
                    aLine.append("/NonFullScreenPageMode/UseOutlines\n");
4423
                }
4424
                break;
4425
                case PDFWriter::UseThumbs :
4426
                {
4427
                    aLine.append("/NonFullScreenPageMode/UseThumbs\n");
4428
                }
4429
                break;
4430
            }
4431
        }
4432
        aLine.append( ">>\n" );
4433
    }
4434
4348
    if( nOutlineDict )
4435
    if( nOutlineDict )
4349
    {
4436
    {
4350
        aLine.append( "   /Outlines " );
4437
        aLine.append( "   /Outlines " );

Return to issue 61139