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 / +622 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
    mbResizeWinToInit( sal_False ),
102
    mbCenterWindow( sal_False ),
103
    mbOpenInFullScreenMode( sal_False ),
104
    mbDisplayPDFDocumentTitle( sal_False ),
105
    mbDirectionR2L( sal_False ),
106
    mnMagnification( 0 ),
107
    mnInitialView( 0 ),
108
    mnPageLayout( 0 ),
97
109
98
    maNfQuality.SetUnit( FUNIT_PERCENT );
110
    mbIsRangeChecked( sal_False ),
99
    maNfQuality.SetMin( 1, FUNIT_PERCENT );
111
    msPageRange( ' ' ),
100
    maNfQuality.SetMax( 100, FUNIT_PERCENT );
101
112
102
	// check for selection
113
    mbSelectionIsChecked( sal_False )
114
{
115
    FreeResource();
116
    mprResMgr = &rResMgr;
117
// check for selection
103
    try
118
    try
104
    {
119
    {
105
		Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() );
120
        Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() );
106
	    if( xController.is() )
121
        if( xController.is() )
107
	    {
122
        {
108
			Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
123
            Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
109
		    if( xView.is() )
124
            if( xView.is() )
110
			    xView->getSelection() >>= maSelection;
125
                xView->getSelection() >>= maSelection;
111
        }
126
        }
112
    }
127
    }
113
    catch( RuntimeException )
128
    catch( RuntimeException )
114
    {
129
    {
115
    }
130
    }
116
	sal_Bool bHasSelection = maSelection.hasValue();
131
    mbSelectionPresent = maSelection.hasValue();
117
	if ( bHasSelection )
132
    if ( mbSelectionPresent )
118
	{
133
    {
119
		Reference< drawing::XShapes > xShapes;
134
        Reference< drawing::XShapes > xShapes;
120
		if ( ( maSelection >>= xShapes ) == sal_False )	// XShapes is always a selection
135
        if ( ( maSelection >>= xShapes ) == sal_False )	// XShapes is always a selection
121
		{
136
        {
122
			// even if nothing is selected in writer the selection is not empty
137
            // even if nothing is selected in writer the selection is not empty
123
			Reference< container::XIndexAccess > xIndexAccess;
138
            Reference< container::XIndexAccess > xIndexAccess;
124
			if ( maSelection >>= xIndexAccess )
139
            if ( maSelection >>= xIndexAccess )
125
			{
140
            {
126
				sal_Int32 nLen = xIndexAccess->getCount();
141
                sal_Int32 nLen = xIndexAccess->getCount();
127
				if ( !nLen )
142
                if ( !nLen )
128
					bHasSelection = sal_False;
143
                    mbSelectionPresent = sal_False;
129
				else if ( nLen == 1 )
144
                else if ( nLen == 1 )
130
				{
145
                {
131
					Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY );
146
                    Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY );
132
					if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) )
147
                    if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) )
133
						bHasSelection = sal_False;
148
                        mbSelectionPresent = sal_False;
134
				}
149
                }
135
			}
150
            }
136
		}
151
        }
137
	}
152
    }
138
    maRbSelection.Enable( bHasSelection );
153
139
154
// check if source document is a presentation
140
155
    try
141
	// check if source document is a presentation
156
    {
142
	try
157
        Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY );
143
	{
158
        if ( xInfo.is() )
144
	    Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY );
159
        {
145
		if ( xInfo.is() )
160
            if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) )
146
		{
161
                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" ) ) ) )
162
            if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) )
150
                mbIsWriter = sal_True;
163
                mbIsWriter = sal_True;
151
        }
164
        }
152
	}
165
    }
153
	catch( RuntimeException )
166
    catch( RuntimeException )
154
	{
167
    {
155
	}
168
    }
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
169
190
	sal_Int32 nFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 );
170
    mbUseLosslessCompression = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False );
191
	if ( ( nFormsType < 0 ) || ( nFormsType > 3 ) )
171
    mnQuality = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 );
192
		nFormsType = 0;
172
    mbReduceImageResolution = maConfigItem.ReadBool(  OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False );
193
	maLbFormsFormat.SelectEntryPos( (sal_uInt16)nFormsType );
173
    mnMaxImageResolution = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 );
174
175
    mbUseTaggedPDF = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False );
176
    if ( mbIsPresentation )
177
        mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages"  ) ), sal_False );
178
    else
179
        mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes"  ) ), sal_True );
180
181
    mbUseTransitionEffects = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects"  ) ), sal_True );
182
    mbIsSkipEmptyPages = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages"  ) ), sal_False );
183
184
    mnFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 );
185
    if ( ( mnFormsType < 0 ) || ( mnFormsType > 3 ) )
186
        mnFormsType = 0;
187
188
//prepare values for the Viewer tab page
189
    mbHideViewerToolbar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), sal_False );
190
    mbHideViewerMenubar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), sal_False );
191
    mbHideViewerWindowControls = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), sal_False );
192
    mbResizeWinToInit = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ResizeWindowToInitialPage" ) ), sal_False ); //*********
193
    mbCenterWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), sal_False );
194
    mbOpenInFullScreenMode = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenInFullScreenMode" ) ), sal_False );
195
    mbDisplayPDFDocumentTitle = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), sal_False );
196
    mbDirectionR2L  = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), sal_False );
197
198
    mnInitialView = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "InitialView" ) ), 0 ); //*********
199
    mnMagnification = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Magnification" ) ), 0 ); //*********
200
    mnPageLayout = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayout" ) ), 0 ); //*********
201
202
//queue the tab pages for later creation (created when first shown)
203
    AddTabPage( RID_PDF_TAB_VPREFER, ImpPDFTabViewerPage::Create, 0 );
204
    AddTabPage( RID_PDF_TAB_OPNFTR, ImpPDFTabOpnFtrPage::Create, 0 );
205
206
//last queued is the first to be displayed (or so it seems..)
207
    AddTabPage( RID_PDF_TAB_GENER, ImpPDFTabGeneralPage::Create, 0 );
208
209
//change test on the Ok button: get the relevant string from resources, update it on the button
210
    GetOKButton().SetText( OUString( String( ResId( STR_PDF_EXPORT, &rResMgr ) ) ) );
211
212
//FIXME
213
//very, very ugly hack: I don't know how to have the tab pages displayed correctly without this...
214
    maFlPages.Hide();
215
/////////////////
194
}
216
}
195
217
196
// -----------------------------------------------------------------------------
218
// -----------------------------------------------------------------------------
219
ImpPDFTabDialog::~ImpPDFTabDialog()
220
{
221
//delete the pages, needed because otherwise the child tab pages
222
//don't get destroyed
223
    RemoveTabPage( RID_PDF_TAB_GENER );
224
    RemoveTabPage( RID_PDF_TAB_VPREFER );
225
    RemoveTabPage( RID_PDF_TAB_OPNFTR );
226
}
197
227
198
ImpPDFDialog::~ImpPDFDialog()
228
// -----------------------------------------------------------------------------
229
void ImpPDFTabDialog::PageCreated( USHORT _nId,
230
                                   SfxTabPage& _rPage )
199
{
231
{
232
    switch( _nId )
233
    {
234
    case RID_PDF_TAB_GENER:
235
        ( ( ImpPDFTabGeneralPage* )&_rPage )->SetFilterConfigItem( this );
236
        break;
237
    case RID_PDF_TAB_VPREFER:
238
        ( ( ImpPDFTabViewerPage* )&_rPage )->SetFilterConfigItem( this );
239
        break;
240
    case RID_PDF_TAB_OPNFTR:
241
        ( ( ImpPDFTabOpnFtrPage* )&_rPage )->SetFilterConfigItem( this );
242
        break;
243
    }
200
}
244
}
201
245
202
// -----------------------------------------------------------------------------
246
// -----------------------------------------------------------------------------
247
short ImpPDFTabDialog::Ok( )
248
{
249
//here the whole mechanism of the base class is not used
250
//when Ok is hit, the user means 'convert to PDF', so simply close with ok
251
    return RET_OK;
252
}
203
253
204
Sequence< PropertyValue > ImpPDFDialog::GetFilterData()
254
// -----------------------------------------------------------------------------
255
Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
205
{
256
{
206
	// updating the FilterData sequence and storing FilterData to configuration
257
// updating the FilterData sequence and storing FilterData to configuration
207
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), maRbLosslessCompression.IsChecked() );
258
    if( GetTabPage( RID_PDF_TAB_GENER ) )
208
	maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), maNfQuality.GetValue() );
259
        ( ( ImpPDFTabGeneralPage* )GetTabPage( RID_PDF_TAB_GENER ) )->GetFilterConfigItem( this );
209
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), maCbReduceImageResolution.IsChecked() );
260
210
	maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), maCoReduceImageResolution.GetText().ToInt32() );
261
//prepare the items to be returned
211
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), maCbTaggedPDF.IsChecked() );
262
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), mbUseLosslessCompression );
212
	if ( mbIsPresentation )
263
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), mnQuality );
213
	    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), maCbExportNotes.IsChecked() );
264
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), mbReduceImageResolution );
214
	else
265
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), mnMaxImageResolution );
215
		maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), maCbExportNotes.IsChecked() );
266
216
	maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), maCbTransitionEffects.IsChecked() );
267
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), mbUseTaggedPDF );
217
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), !maCbExportEmptyPages.IsChecked() );
268
    if ( mbIsPresentation )
269
        maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesBoth );
270
    else
271
        maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotesBoth );
272
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), mbUseTransitionEffects );
273
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), mbIsSkipEmptyPages );
218
274
219
    /*
275
    /*
220
    * FIXME: the entries are only implicitly defined by the resource file. Should there
276
    * 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.
277
    * ever be an additional form submit format this could get invalid.
222
    */
278
    */
223
	maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), maLbFormsFormat.GetSelectEntryPos() );
279
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), mnFormsType );
280
281
    if( GetTabPage( RID_PDF_TAB_VPREFER ) )
282
        ( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this );
283
284
    if( GetTabPage( RID_PDF_TAB_OPNFTR ) )
285
        ( ( ImpPDFTabOpnFtrPage* )GetTabPage( RID_PDF_TAB_OPNFTR ) )->GetFilterConfigItem( this );
286
287
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), mbHideViewerToolbar );
288
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), mbHideViewerMenubar );
289
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), mbHideViewerWindowControls );
290
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ResizeWindowToInitialPage" ) ), mbResizeWinToInit ); //*********
291
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), mbCenterWindow );
292
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), mbDisplayPDFDocumentTitle );
293
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), mbDirectionR2L );
294
    maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenInFullScreenMode" ) ), mbOpenInFullScreenMode );
295
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "InitialView" ) ), mnInitialView ); //*********
296
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Magnification" ) ), mnMagnification); //*********
297
    maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayout" ) ), mnPageLayout ); //*********
224
298
225
    Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
299
    Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
226
300
227
    aRet.realloc( aRet.getLength() + 1 );
301
    aRet.realloc( aRet.getLength() + 1 );
228
302
229
    if( maRbRange.IsChecked() )
303
    if( mbIsRangeChecked )
230
    {
304
    {
231
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
305
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
232
        aRet[ aRet.getLength() - 1 ].Value <<= OUString( maEdPages.GetText() );
306
        aRet[ aRet.getLength() - 1 ].Value <<= OUString( msPageRange );
233
    }
307
    }
234
    else if( maRbSelection.IsChecked() )
308
    else if( mbSelectionIsChecked )
235
    {
309
    {
236
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
310
        aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
237
        aRet[ aRet.getLength() - 1 ].Value <<= maSelection;
311
        aRet[ aRet.getLength() - 1 ].Value <<= maSelection;
Lines 240-266 Sequence< PropertyValue > ImpPDFDialog:: Link Here
240
}
314
}
241
315
242
// -----------------------------------------------------------------------------
316
// -----------------------------------------------------------------------------
317
ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent,
318
                                            const SfxItemSet& rCoreSet,
319
                                            ResMgr* paResMgr ) :
320
    SfxTabPage( pParent, ResId( RID_PDF_TAB_GENER, paResMgr ), rCoreSet ),
321
322
    maFlPages( this, ResId( FL_PAGES, paResMgr ) ),
323
    maRbAll( this, ResId( RB_ALL, paResMgr) ),
324
    maRbRange( this, ResId( RB_RANGE, paResMgr ) ),
325
    maRbSelection( this, ResId( RB_SELECTION, paResMgr ) ),
326
    maEdPages( this, ResId( ED_PAGES, paResMgr ) ),
327
328
    maFlCompression( this, ResId( FL_IMAGES, paResMgr ) ),
329
    maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION, paResMgr ) ),
330
    maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION, paResMgr ) ),
331
    maFtQuality( this, ResId( FT_QUALITY, paResMgr ) ),
332
    maNfQuality( this, ResId( NF_QUALITY, paResMgr ) ),
333
    maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION, paResMgr ) ),
334
    maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION, paResMgr ) ),
335
336
    maFlGeneral( this, ResId( FL_GENERAL, paResMgr ) ),
337
    maCbTaggedPDF( this, ResId( CB_TAGGEDPDF, paResMgr ) ),
338
    maCbExportNotes( this, ResId( CB_EXPORTNOTES, paResMgr ) ),
339
    maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS, paResMgr ) ),
340
341
    maFtFormsFormat( this, ResId( FT_FORMSFORMAT, paResMgr ) ),
342
    maLbFormsFormat( this, ResId( LB_FORMSFORMAT, paResMgr ) ),
343
    maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES, paResMgr ) ),
344
    mbIsPresentation( sal_False ),
345
346
    mbResetAlreadyCalled( sal_False )
347
{
348
    mpaResMgr = paResMgr;
349
    FreeResource();
350
}
351
352
// -----------------------------------------------------------------------------
353
ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage()
354
{
355
    delete mpaResMgr;
356
}
357
358
// -----------------------------------------------------------------------------
359
void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent )
360
{
361
//init this class data
362
    maRbRange.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) );
363
364
    maRbAll.Check();
365
    TogglePagesHdl( NULL );
366
367
    maNfQuality.SetUnit( FUNIT_PERCENT );
368
    maNfQuality.SetMin( 1, FUNIT_PERCENT );
369
    maNfQuality.SetMax( 100, FUNIT_PERCENT );
370
371
    maRbSelection.Enable( paParent->mbSelectionPresent );
372
    mbIsPresentation = paParent->mbIsPresentation;
373
    mbIsWriter = paParent->mbIsWriter;
374
375
    maCbTransitionEffects.Enable( mbIsPresentation );
376
    maCbExportEmptyPages.Enable( mbIsWriter );
377
378
//  SJ: Dont know if there are Notes available also for writer.
379
//	maCbExportNotes.Enable( paParent->mbIsPresentation );
380
381
    maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) );
382
    const sal_Bool bUseLosslessCompression = paParent->mbUseLosslessCompression;
383
    if ( bUseLosslessCompression )
384
        maRbLosslessCompression.Check();
385
	else
386
        maRbJPEGCompression.Check();
387
388
    maNfQuality.SetValue( paParent->mnQuality, FUNIT_PERCENT );
389
    maNfQuality.Enable( bUseLosslessCompression == sal_False );
390
391
    maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl ) );
392
    const sal_Bool	bReduceImageResolution = paParent->mbReduceImageResolution;
393
    maCbReduceImageResolution.Check( bReduceImageResolution );
394
    String aStrRes( String::CreateFromInt32( paParent->mnMaxImageResolution ) );
395
    aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) );
396
    maCoReduceImageResolution.SetText( aStrRes );
397
    maCoReduceImageResolution.Enable( bReduceImageResolution );
398
399
    maCbTaggedPDF.Check( paParent->mbUseTaggedPDF );
400
401
    if ( mbIsPresentation )
402
        maCbExportNotes.Check( paParent->mbExportNotesBoth );
403
    else
404
        maCbExportNotes.Check( paParent->mbExportNotesBoth );
405
406
    maCbTransitionEffects.Check( paParent->mbUseTransitionEffects );
407
    maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages );
408
409
    maLbFormsFormat.SelectEntryPos( (sal_uInt16)paParent->mnFormsType );
410
}
411
412
// -----------------------------------------------------------------------------
413
void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
414
{
415
// updating the FilterData sequence and storing FilterData to configuration
416
    paParent->mbUseLosslessCompression = maRbLosslessCompression.IsChecked();
417
    paParent->mnQuality = maNfQuality.GetValue();
418
    paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked();
419
    paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().ToInt32();
420
    paParent->mbUseTaggedPDF =  maCbTaggedPDF.IsChecked();
421
    paParent->mbExportNotesBoth = maCbExportNotes.IsChecked();
422
423
    paParent->mbUseTransitionEffects = maCbTransitionEffects.IsChecked();
424
    paParent->mbIsSkipEmptyPages =  !maCbExportEmptyPages.IsChecked();
425
426
    paParent->mbIsRangeChecked = sal_False;
427
    if( maRbRange.IsChecked() )
428
    {
429
        paParent->mbIsRangeChecked = sal_True;
430
        paParent->msPageRange = String( maEdPages.GetText() ); //FIXME all right on other languages ?
431
    }
432
    else if( maRbSelection.IsChecked() )
433
    {
434
        paParent->mbSelectionIsChecked = maRbSelection.IsChecked();
435
    }
436
    /*
437
    * FIXME: the entries are only implicitly defined by the resource file. Should there
438
    * ever be an additional form submit format this could get invalid.
439
    */
440
    paParent->mnFormsType = (sal_Int32) maLbFormsFormat.GetSelectEntryPos();
441
}
442
443
// -----------------------------------------------------------------------------
444
SfxTabPage*  ImpPDFTabGeneralPage::Create( Window* pParent,
445
                                           const SfxItemSet& rAttrSet)
446
{
447
    ByteString aResMgrName( "pdffilter" );
448
    aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
449
    ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
450
	return ( new  ImpPDFTabGeneralPage( pParent, rAttrSet, paResMgr ) );
451
}
243
452
244
IMPL_LINK( ImpPDFDialog, TogglePagesHdl, void*, p )
453
// -----------------------------------------------------------------------------
454
void ImpPDFTabGeneralPage::Reset( const SfxItemSet& ignored)
455
{
456
//set the controls to default values
457
//since this is  called just after the data are set from the parent tab dialog
458
//a bool is needed to enable reset only the second time (while user presses it)
459
    if( mbResetAlreadyCalled )
460
    {
461
        maCbTransitionEffects.Enable( mbIsPresentation );
462
        maCbExportEmptyPages.Enable( mbIsWriter );
463
        maRbAll.Check();
464
        TogglePagesHdl( NULL );
465
        maRbLosslessCompression.Check( FALSE );
466
        maRbJPEGCompression.Check();
467
        maNfQuality.SetValue( 90 , FUNIT_PERCENT );
468
        maNfQuality.Enable();
469
        maCbReduceImageResolution.Check( FALSE );
470
        maCbTaggedPDF.Check( FALSE );
471
        if ( mbIsPresentation )
472
            maCbExportNotes.Check( FALSE );
473
        else
474
            maCbExportNotes.Check();
475
        maCbTransitionEffects.Check();
476
        maCbExportEmptyPages.Check();
477
478
        maLbFormsFormat.SelectEntryPos( 0 );
479
    }
480
    mbResetAlreadyCalled = sal_True;
481
}
482
483
// -----------------------------------------------------------------------------
484
IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, p )
245
{
485
{
246
    maEdPages.Enable( maRbRange.IsChecked() );
486
    maEdPages.Enable( maRbRange.IsChecked() );
247
    maEdPages.SetReadOnly( !maRbRange.IsChecked() );
487
    maEdPages.SetReadOnly( !maRbRange.IsChecked() );
248
249
    return 0;
488
    return 0;
250
}
489
}
251
490
252
// -----------------------------------------------------------------------------
491
// -----------------------------------------------------------------------------
253
492
IMPL_LINK( ImpPDFTabGeneralPage, ToggleCompressionHdl, void*, p )
254
IMPL_LINK( ImpPDFDialog, ToggleCompressionHdl, void*, p )
255
{
493
{
256
    maNfQuality.Enable( maRbJPEGCompression.IsChecked() );
494
    maNfQuality.Enable( maRbJPEGCompression.IsChecked() );
257
    return 0;
495
    return 0;
258
}
496
}
259
497
260
// -----------------------------------------------------------------------------
498
// -----------------------------------------------------------------------------
261
499
IMPL_LINK( ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl, void*, p )
262
IMPL_LINK( ImpPDFDialog, ToggleReduceImageResolutionHdl, void*, p )
263
{
500
{
264
    maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() );
501
    maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() );
265
    return 0;
502
    return 0;
266
}
503
}
504
505
/////////////////////////////////////////////////////////////////
506
// the option features tab page
507
// -----------------------------------------------------------------------------
508
ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent,
509
                                          const SfxItemSet& rCoreSet, 
510
                                          ResMgr* paResMgr ) :
511
    SfxTabPage( pParent, ResId( RID_PDF_TAB_OPNFTR, paResMgr ), rCoreSet ),
512
513
    maFlInitialView( this, ResId( FL_INITVIEW, paResMgr ) ),
514
    maRbOpnPageOnly( this, ResId( RB_OPNMODE_PAGEONLY, paResMgr ) ),
515
    maRbOpnOutline( this, ResId( RB_OPNMODE_OUTLINE, paResMgr ) ),
516
    maRbOpnThumbs( this, ResId( RB_OPNMODE_THUMBS, paResMgr ) ),
517
518
    maFlMagnification( this, ResId( FL_MAGNIFICATION, paResMgr ) ),
519
    maRbMagnDefault( this, ResId( RB_MAGNF_DEFAULT, paResMgr ) ),
520
    maRbMagnFitWin( this, ResId( RB_MAGNF_WIND, paResMgr ) ),
521
    maRbMagnFitWidth( this, ResId( RB_MAGNF_WIDTH, paResMgr ) ),
522
    maRbMagnFitVisible( this, ResId( RB_MAGNF_VISIBLE, paResMgr ) ),
523
524
    maFlPageLayout( this, ResId( FL_PAGE_LAYOUT, paResMgr ) ),
525
    maRbPgLyDefault( this, ResId( RB_PGLY_DEFAULT, paResMgr ) ),
526
    maRbPgLySinglePage( this, ResId( RB_PGLY_SINGPG, paResMgr ) ),
527
    maRbPgLyContinue( this, ResId( RB_PGLY_CONT, paResMgr ) ),
528
    maRbPgLyContinueFacing( this, ResId( RB_PGLY_CONTFAC, paResMgr ) ),
529
530
    mbResetAlreadyCalled( sal_False )
531
{
532
    mpaResMgr = paResMgr;
533
    FreeResource();
534
}
535
536
// -----------------------------------------------------------------------------
537
ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage()
538
{
539
    delete mpaResMgr;
540
}
541
542
// -----------------------------------------------------------------------------
543
SfxTabPage*  ImpPDFTabOpnFtrPage::Create( Window* pParent,
544
                                          const SfxItemSet& rAttrSet)
545
{
546
    ByteString aResMgrName( "pdffilter" );
547
    aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
548
    ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
549
    return ( new  ImpPDFTabOpnFtrPage( pParent, rAttrSet, paResMgr ) );
550
}
551
552
// -----------------------------------------------------------------------------
553
void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent  )
554
{
555
    paParent->mnInitialView = 0;
556
    if( maRbOpnOutline.IsChecked() )
557
        paParent->mnInitialView = 1;
558
    else if( maRbOpnThumbs.IsChecked() )
559
        paParent->mnInitialView = 2;
560
561
    paParent->mnMagnification = 0;
562
    if( maRbMagnFitWin.IsChecked() )
563
        paParent->mnMagnification = 1;
564
    else if( maRbMagnFitWidth.IsChecked() )
565
        paParent->mnMagnification = 2;
566
    else if( maRbMagnFitVisible.IsChecked() )
567
        paParent->mnMagnification = 3;
568
569
    paParent->mnPageLayout = 0;
570
    if( maRbPgLySinglePage.IsChecked() )
571
        paParent->mnPageLayout = 1;
572
    else if( maRbPgLyContinue.IsChecked() )
573
        paParent->mnPageLayout = 2;
574
    else if( maRbPgLyContinueFacing.IsChecked() )
575
        paParent->mnPageLayout = 3;
576
577
}
578
579
// -----------------------------------------------------------------------------
580
void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const  ImpPDFTabDialog* paParent )
581
{
582
    switch( paParent->mnPageLayout )
583
    {
584
    default:
585
    case 0:
586
        maRbPgLyDefault.Check();
587
        break;
588
    case 1:
589
        maRbPgLySinglePage.Check();
590
        break;
591
    case 2:
592
        maRbPgLyContinue.Check();
593
        break;
594
    case 3:
595
        maRbPgLyContinueFacing.Check();
596
        break;
597
    };
598
599
    switch( paParent->mnInitialView )
600
    {
601
    default:
602
    case 0:
603
        maRbOpnPageOnly.Check();
604
        break;
605
    case 1:
606
        maRbOpnOutline.Check();
607
        break;
608
    case 2:
609
        maRbOpnThumbs.Check();
610
        break;
611
    };
612
613
    switch( paParent->mnMagnification )
614
    {
615
    default:
616
    case 0:
617
        maRbMagnDefault.Check();
618
        break;
619
    case 1:
620
        maRbMagnFitWin.Check();
621
        break;
622
    case 2:
623
        maRbMagnFitWidth.Check();
624
        break;
625
    case 3:
626
        maRbMagnFitVisible.Check();
627
        break;
628
    };
629
}
630
631
// -----------------------------------------------------------------------------
632
void ImpPDFTabOpnFtrPage::Reset( const SfxItemSet& ignored)
633
{
634
//set the controls to default values
635
//since this is  called just after the data are set from the parent tab dialog
636
//a bool is needed to enable reset only the second time (user pressing it)
637
    if( mbResetAlreadyCalled )
638
    {
639
        maRbOpnPageOnly.Check();
640
        maRbOpnOutline.Check(FALSE);
641
        maRbOpnThumbs.Check(FALSE);
642
643
        maRbMagnDefault.Check();
644
        maRbMagnFitWin.Check(FALSE);
645
        maRbMagnFitWidth.Check(FALSE);
646
        maRbMagnFitVisible.Check(FALSE);
647
648
        maRbPgLyDefault.Check();
649
        maRbPgLySinglePage.Check( FALSE );
650
        maRbPgLyContinue.Check( FALSE );
651
        maRbPgLyContinueFacing.Check( FALSE );
652
    }
653
    mbResetAlreadyCalled = sal_True;
654
}
655
656
////////////////////////////////////////////////////////
657
// The Viewer preferences tab page
658
// -----------------------------------------------------------------------------
659
ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent,
660
                                          const SfxItemSet& rCoreSet,
661
                                          ResMgr* paResMgr ) :
662
    SfxTabPage( pParent, ResId( RID_PDF_TAB_VPREFER, paResMgr ), rCoreSet ),
663
664
    maFlWindowOptions( this, ResId( FL_WINOPT, paResMgr ) ),
665
    maCbResWinInit( this, ResId( CB_WNDOPT_RESINIT, paResMgr ) ),
666
    maCbCenterWindow( this, ResId( CB_WNDOPT_CNTRWIN, paResMgr ) ),
667
    maCbOpenFullScreen( this, ResId( CB_WNDOPT_OPNFULL, paResMgr ) ),
668
    maCbDispDocTitle( this, ResId( CB_DISPDOCTITLE, paResMgr ) ),
669
670
    maFlUIOptions( this, ResId( FL_USRIFOPT, paResMgr ) ),
671
    maCbHideViewerMenubar( this, ResId( CB_UOP_HIDEVMENUBAR, paResMgr ) ),
672
    maCbHideViewerToolbar( this, ResId( CB_UOP_HIDEVTOOLBAR, paResMgr ) ),
673
    maCbHideViewerWindowControls( this, ResId( CB_UOP_HIDEVWINCTRL, paResMgr ) ),
674
675
    maFlDirContrl( this, ResId( FL_DIRCONTR, paResMgr ) ),
676
    maRbL2R( this, ResId( RB_LEFTRIGHT, paResMgr ) ),
677
    maRbR2L( this, ResId( RB_RIGHTLEFT, paResMgr ) ),
678
679
    mbResetAlreadyCalled( sal_False )
680
{
681
    mpaResMgr = paResMgr;
682
    FreeResource();
683
}
684
685
// -----------------------------------------------------------------------------
686
ImpPDFTabViewerPage::~ImpPDFTabViewerPage()
687
{
688
    delete mpaResMgr;
689
}
690
691
// -----------------------------------------------------------------------------
692
SfxTabPage*  ImpPDFTabViewerPage::Create( Window* pParent,
693
                                          const SfxItemSet& rAttrSet)
694
{
695
    ByteString aResMgrName( "pdffilter" );
696
    aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
697
    ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
698
    return ( new  ImpPDFTabViewerPage( pParent, rAttrSet, paResMgr ) );
699
}
700
701
// -----------------------------------------------------------------------------
702
void ImpPDFTabViewerPage::GetFilterConfigItem( ImpPDFTabDialog* paParent  )
703
{
704
     paParent->mbHideViewerMenubar = maCbHideViewerMenubar.IsChecked();
705
     paParent->mbHideViewerToolbar = maCbHideViewerToolbar.IsChecked( );
706
     paParent->mbHideViewerWindowControls = maCbHideViewerWindowControls.IsChecked();
707
     paParent->mbResizeWinToInit = maCbResWinInit.IsChecked();
708
     paParent->mbOpenInFullScreenMode = maCbOpenFullScreen.IsChecked();
709
     paParent->mbCenterWindow = maCbCenterWindow.IsChecked();
710
     paParent->mbDisplayPDFDocumentTitle = maCbDispDocTitle.IsChecked();
711
     paParent->mbDirectionR2L = maRbR2L.IsChecked();
712
}
713
714
// -----------------------------------------------------------------------------
715
void ImpPDFTabViewerPage::SetFilterConfigItem( const  ImpPDFTabDialog* paParent )
716
{
717
    maCbHideViewerMenubar.Check( paParent->mbHideViewerMenubar );
718
    maCbHideViewerToolbar.Check( paParent->mbHideViewerToolbar );
719
    maCbHideViewerWindowControls.Check( paParent->mbHideViewerWindowControls );
720
721
    maCbResWinInit.Check( paParent->mbResizeWinToInit );
722
    maCbOpenFullScreen.Check( paParent->mbOpenInFullScreenMode ); 
723
    maCbCenterWindow.Check( paParent->mbCenterWindow );
724
    maCbDispDocTitle.Check( paParent->mbDisplayPDFDocumentTitle );
725
726
    maRbR2L.Check( paParent->mbDirectionR2L );
727
    maRbL2R.Check( !paParent->mbDirectionR2L );
728
}
729
730
// -----------------------------------------------------------------------------
731
void ImpPDFTabViewerPage::Reset( const SfxItemSet& ignored )
732
{
733
//set the controls to default values
734
// since this is  called just after the data are set from the parent tab dialog
735
// a bool is needed to enable reset only the second time (user pressing it)
736
    if( mbResetAlreadyCalled )
737
    {
738
        maRbL2R.Check();
739
        maRbR2L.Check(FALSE);
740
741
        maCbHideViewerMenubar.Check( FALSE );
742
        maCbHideViewerToolbar.Check( FALSE );
743
        maCbHideViewerWindowControls.Check( FALSE );
744
        maCbResWinInit.Check( FALSE );
745
        maCbOpenFullScreen.Check( FALSE ); 
746
        maCbCenterWindow.Check( FALSE );
747
        maCbDispDocTitle.Check();
748
    }
749
    mbResetAlreadyCalled = sal_True;
750
}
(-)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_INITVIEW               80
85
#define RB_OPNMODE_PAGEONLY       81
86
#define RB_OPNMODE_OUTLINE        82
87
#define RB_OPNMODE_THUMBS         83
88
89
#define FL_MAGNIFICATION          84
90
#define RB_MAGNF_DEFAULT          85
91
#define RB_MAGNF_WIND             86
92
#define RB_MAGNF_WIDTH            87
93
#define RB_MAGNF_VISIBLE          88
94
95
#define FL_PAGE_LAYOUT            89
96
#define RB_PGLY_DEFAULT           90
97
#define RB_PGLY_SINGPG            91
98
#define RB_PGLY_CONT              92
99
#define RB_PGLY_CONTFAC           93
100
101
//controls for viewer preferences tab page
102
#define FL_WINOPT                100
103
#define CB_WNDOPT_RESINIT        101
104
#define CB_WNDOPT_CNTRWIN        102
105
#define CB_WNDOPT_OPNFULL        103
106
#define CB_DISPDOCTITLE          104
107
108
#define FL_USRIFOPT              105
109
#define CB_UOP_HIDEVMENUBAR      106
110
#define CB_UOP_HIDEVTOOLBAR      107
111
#define CB_UOP_HIDEVWINCTRL      108
112
113
#define FL_DIRCONTR              109
114
#define RB_LEFTRIGHT             110
115
#define RB_RIGHTLEFT             111
(-)filter/source/pdf/impdialog.hxx (-39 / +197 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                    mbResizeWinToInit;
86
    sal_Bool                            mbIsWriter;
99
    sal_Bool                    mbCenterWindow;
87
100
    sal_Bool                    mbOpenInFullScreenMode;
88
                                        DECL_LINK( TogglePagesHdl, void* );
101
    sal_Bool                    mbDisplayPDFDocumentTitle;
89
                                        DECL_LINK( ToggleCompressionHdl, void* );
102
    sal_Bool                    mbDirectionR2L;
90
                                        DECL_LINK( ToggleReduceImageResolutionHdl, void* );
103
    sal_Int32                   mnMagnification;
104
    sal_Int32                   mnInitialView;
105
 
106
    sal_Int32                   mnPageLayout;
107
108
    sal_Bool                    mbIsRangeChecked;
109
    String                      msPageRange;
110
    sal_Bool                    mbSelectionIsChecked;
111
112
113
public:
114
115
    friend  class               ImpPDFTabGeneralPage;
116
    friend  class               ImpPDFTabViewerPage;
117
    friend  class               ImpPDFTabOpnFtrPage;
118
119
    ImpPDFTabDialog( Window* pParent, ResMgr& rResMgr,
120
                     Sequence< PropertyValue >& rFilterData,
121
                     const Reference< XComponent >& rDoc );
122
    ~ImpPDFTabDialog();
123
124
    Sequence< PropertyValue >   GetFilterData();
125
126
protected:
127
    virtual void                PageCreated( USHORT _nId,
128
                                             SfxTabPage& _rPage );
129
    virtual short               Ok();
130
};
131
132
//class tab page general
133
class ImpPDFTabGeneralPage : public SfxTabPage
134
{
135
    FixedLine                   maFlPages;
136
    RadioButton                 maRbAll;
137
    RadioButton                 maRbRange;
138
    RadioButton                 maRbSelection;
139
    Edit                        maEdPages;
140
141
    FixedLine                   maFlCompression;
142
    RadioButton                 maRbLosslessCompression;
143
    RadioButton                 maRbJPEGCompression;
144
    FixedText                   maFtQuality;
145
    MetricField                 maNfQuality;
146
    CheckBox                    maCbReduceImageResolution;
147
    ComboBox                    maCoReduceImageResolution;
148
149
    FixedLine                   maFlGeneral;
150
    CheckBox                    maCbTaggedPDF;
151
    CheckBox                    maCbExportNotes;
152
    CheckBox                    maCbTransitionEffects;
153
154
    FixedText                   maFtFormsFormat;
155
    ListBox                     maLbFormsFormat;
156
    CheckBox                    maCbExportEmptyPages;
157
158
    sal_Bool                    mbIsPresentation;
159
    sal_Bool                    mbIsWriter;
160
161
    sal_Bool                    mbResetAlreadyCalled;
162
163
    ResMgr*                     mpaResMgr;
164
165
    DECL_LINK( TogglePagesHdl, void* );
166
    DECL_LINK( ToggleCompressionHdl, void* );
167
    DECL_LINK( ToggleReduceImageResolutionHdl, void* );
91
168
92
public:
169
public:
170
    ImpPDFTabGeneralPage( Window* pParent,
171
                          const SfxItemSet& rSet,
172
                          ResMgr* paResMgr );
173
174
    ~ImpPDFTabGeneralPage();
175
    static SfxTabPage*          Create( Window* pParent,
176
                                        const SfxItemSet& rAttrSet);
177
178
    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent );
179
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
180
//this will set the default
181
    virtual void                Reset( const SfxItemSet& ignored);
182
};
183
184
//class tab page viewer
185
class ImpPDFTabOpnFtrPage : public SfxTabPage
186
{
187
    FixedLine                   maFlInitialView;
188
    RadioButton                 maRbOpnPageOnly;
189
    RadioButton                 maRbOpnOutline;
190
    RadioButton                 maRbOpnThumbs;
191
192
    FixedLine                   maFlMagnification;
193
    RadioButton                 maRbMagnDefault;
194
    RadioButton                 maRbMagnFitWin;
195
    RadioButton                 maRbMagnFitWidth;
196
    RadioButton                 maRbMagnFitVisible;
197
198
    FixedLine			        maFlPageLayout;
199
    RadioButton                 maRbPgLyDefault;
200
    RadioButton                 maRbPgLySinglePage;
201
    RadioButton                 maRbPgLyContinue;
202
    RadioButton                 maRbPgLyContinueFacing;
93
203
94
                                        ImpPDFDialog( Window* pParent, ResMgr& rResMgr,
204
    sal_Bool                    mbResetAlreadyCalled;
95
                                                      Sequence< PropertyValue >& rFilterData,
96
                                                      const Reference< XComponent >& rDoc );
97
                                        ~ImpPDFDialog();
98
205
99
    Sequence< PropertyValue >           GetFilterData();
206
    ResMgr*                     mpaResMgr;
207
208
public:
209
    ImpPDFTabOpnFtrPage( Window* pParent,
210
                         const SfxItemSet& rSet,
211
                         ResMgr* paResMgr );
212
213
    ~ImpPDFTabOpnFtrPage();
214
    static SfxTabPage*          Create( Window* pParent,
215
                                        const SfxItemSet& rAttrSet );
216
217
    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
218
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
219
//this will set the default
220
    virtual void                Reset( const SfxItemSet& ignored);
221
};
222
223
//class tab page viewer
224
class ImpPDFTabViewerPage : public SfxTabPage
225
{
226
    FixedLine                   maFlWindowOptions;
227
    CheckBox                    maCbResWinInit;
228
    CheckBox                    maCbCenterWindow;
229
    CheckBox                    maCbOpenFullScreen;
230
    CheckBox                    maCbDispDocTitle;
231
232
    FixedLine                   maFlUIOptions;
233
    CheckBox                    maCbHideViewerMenubar;
234
    CheckBox                    maCbHideViewerToolbar;
235
    CheckBox                    maCbHideViewerWindowControls;
236
237
    FixedLine                   maFlDirContrl;
238
    RadioButton                 maRbL2R;
239
    RadioButton                 maRbR2L;
240
241
    sal_Bool                    mbResetAlreadyCalled;
242
243
    ResMgr*                     mpaResMgr;
244
245
public:
246
    ImpPDFTabViewerPage( Window* pParent,
247
                         const SfxItemSet& rSet,
248
                         ResMgr* paResMgr );
249
250
    ~ImpPDFTabViewerPage();
251
    static SfxTabPage*          Create( Window* pParent,
252
                                        const SfxItemSet& rAttrSet );
253
254
    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
255
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
256
//this will set the default
257
    virtual void                Reset( const SfxItemSet& ignored);
100
};
258
};
101
259
102
#endif // IMPDIALOG_HXX
260
#endif // IMPDIALOG_HXX
(-)filter/source/pdf/impdialog.src (-31 / +280 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 ] = "Document Open Options" ;
217
	};
226
    Text[ en-US ] = "Document Open Options" ;
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_INITVIEW
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 ] = "Initial view" ;
226
	{
235
        Text[ en-US ] = "Initial view" ;
227
		Pos = MAP_APPFONT( 174, 43 );
236
    };
228
		Size = MAP_APPFONT( 50 , 14 ) ;
237
    RadioButton  RB_OPNMODE_PAGEONLY
229
		TabStop = TRUE ;
238
    {
230
		DefButton = TRUE ;
239
        Pos = MAP_APPFONT ( 12 , 14 ) ;
231
	};
240
        Size = MAP_APPFONT ( 155 , 10 ) ;
241
        Text[ de ] = "Page only" ;
242
        Text[ en-US ] = "Page only" ;
243
    };
244
    RadioButton  RB_OPNMODE_OUTLINE
245
    {
246
        Pos = MAP_APPFONT ( 12 , 26 ) ;
247
        Size = MAP_APPFONT ( 155 , 10 ) ;
248
        Text[ de ] = "Bookmarks and page" ;
249
        Text[ en-US ] = "Bookmarks and page" ;
250
    };
251
    RadioButton  RB_OPNMODE_THUMBS
252
    {
253
        Pos = MAP_APPFONT ( 12 , 38 ) ;
254
        Size = MAP_APPFONT ( 155 , 10 ) ;
255
        Text[ de ] = "~Thumbnails and page" ;
256
        Text[ en-US ] = "~Thumbnails and page" ;
257
    };
258
259
///////////////////////////////////////////////////
260
    FixedLine FL_MAGNIFICATION
261
    {
262
        Pos = MAP_APPFONT ( 6 , 52 ) ;
263
        Size = MAP_APPFONT ( 162 , 8 ) ;
264
        Text[ de ] = "Magnification" ;
265
        Text[ en-US ] = "Magnification" ;
266
    };
267
    RadioButton  RB_MAGNF_DEFAULT
268
    {
269
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /XYZ )
270
        Pos = MAP_APPFONT ( 12 , 64 ) ;
271
        Size = MAP_APPFONT ( 155 , 10 ) ;
272
        Text[ de ] = "~Default" ;
273
        Text[ en-US ] = "Default" ;
274
    };
275
    RadioButton  RB_MAGNF_WIND
276
    {
277
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /Fit )
278
        Pos = MAP_APPFONT ( 12 , 76 ) ;
279
        Size = MAP_APPFONT ( 155 , 10 ) ;
280
        Text[ de ] = "Fit in window" ;
281
        Text[ en-US ] = "Fit in window" ;
282
    };
283
    RadioButton  RB_MAGNF_WIDTH
284
    {
285
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitH top )
286
        Pos = MAP_APPFONT ( 12 , 88 ) ;
287
        Size = MAP_APPFONT ( 155 , 10 ) ;
288
        Text[ de ] = "Fit ~width" ;
289
        Text[ en-US ] = "Fit ~width" ;
290
    };
291
    RadioButton  RB_MAGNF_VISIBLE
292
    {
293
        // see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitBH top )
294
        Pos = MAP_APPFONT ( 12 , 100 ) ;
295
        Size = MAP_APPFONT ( 155 , 10 ) ;
296
        Text[ de ] = "First ~visible" ;
297
        Text[ en-US ] = "Fit ~visible" ;
298
        Text [ x-comment ] = " ";
299
    };
300
301
////////////////////////////////////////
302
    FixedLine FL_PAGE_LAYOUT
303
    {
304
        Pos = MAP_APPFONT ( 6 , 114 ) ;
305
        Size = MAP_APPFONT (162  , 8 ) ;
306
        Text[ de ] = "Page layout" ;
307
        Text[ en-US ] = "Page layout" ;
308
    };
309
    RadioButton  RB_PGLY_DEFAULT
310
    {
311
        Pos = MAP_APPFONT ( 12 , 126 ) ;
312
        Size = MAP_APPFONT ( 155 , 10 ) ;
313
        Text[ de ] = "Default" ;
314
        Text[ en-US ] = "Default" ;
315
    };
316
    RadioButton  RB_PGLY_SINGPG
317
    {
318
        Pos = MAP_APPFONT ( 12 , 138 ) ;
319
        Size = MAP_APPFONT ( 155 , 10 ) ;
320
        Text[ de ] = "Single page" ;
321
        Text[ en-US ] = "Single page" ;
322
    };
323
    RadioButton  RB_PGLY_CONT
324
    {
325
        Pos = MAP_APPFONT ( 12 , 150 ) ;
326
        Size = MAP_APPFONT ( 155 , 10 ) ;
327
        Text[ de ] = "Continuous" ;
328
        Text[ en-US ] = "Continuous" ;
329
    };
330
331
    RadioButton  RB_PGLY_CONTFAC
332
    {
333
        Pos = MAP_APPFONT ( 12 , 162 ) ;
334
        Size = MAP_APPFONT ( 155 , 10 ) ;
335
        Text[ de ] = "Continuous facing" ;
336
        Text[ en-US ] = "Continuous facing" ;
337
    };
338
};
339
340
//----------------------------------------------------------
341
//tab page for PDF Export, viewer preferences
342
TabPage  RID_PDF_TAB_VPREFER
343
{
344
    HelpId = 0 ;
345
    Text[ de ] = "Viewer Options" ;
346
    Text[ en-US ] = "Viewer Options" ;
347
    TAB_PDF_SIZE;
348
349
//////////////////////////////////////
350
    FixedLine FL_WINOPT
351
    {
352
        Pos = MAP_APPFONT ( 6 , 3 ) ;
353
        Size = MAP_APPFONT (162  , 8 ) ;
354
        Text[ de ] = "Window Options" ;
355
        Text[ en-US ] = "Window Options" ;
356
    };
357
358
    CheckBox CB_WNDOPT_RESINIT
359
    {
360
        Pos = MAP_APPFONT ( 12 , 14 ) ;
361
        Size = MAP_APPFONT ( 155 , 10 ) ;
362
        TabStop = TRUE ;
363
        Text[ de ] = "~Resize window to initial page" ;
364
        Text[ en-US ] = "~Resize window to initial page";
365
    };
366
    CheckBox CB_WNDOPT_CNTRWIN    //was CB_CENTWINDOW
367
    {
368
        Pos = MAP_APPFONT ( 12 , 26 ) ;
369
        Size = MAP_APPFONT ( 155 , 10 ) ;
370
        TabStop = TRUE ;
371
        Text[ de ] = "~Center window on screen" ;
372
        Text[ en-US ] = "~Center window on screen";
373
    };
374
    CheckBox CB_WNDOPT_OPNFULL // was RB_OPNMODE_FULL
375
    {
376
        Pos = MAP_APPFONT ( 12 , 38 ) ;
377
        Size = MAP_APPFONT ( 155 , 10 ) ;
378
        Text[ de ] = "Open in full ~screen mode" ;
379
        Text[ en-US ] = "Open in full ~screen mode" ;
380
    };
381
    CheckBox CB_DISPDOCTITLE
382
    {
383
        Pos = MAP_APPFONT ( 12 , 50 ) ;
384
        Size = MAP_APPFONT ( 155 , 10 ) ;
385
        TabStop = TRUE ;
386
        Text[ de ] = "Display document ~title" ;
387
        Text[ en-US ] = "Display document ~title";
388
    };
389
390
////////////////////////////////
391
    FixedLine FL_USRIFOPT
392
    {
393
        Pos = MAP_APPFONT ( 6 , 64 ) ;
394
        Size = MAP_APPFONT (162  , 8 ) ;
395
        Text[ de ] = "User interface options" ;
396
        Text[ en-US ] = "User interface options" ;
397
    };
398
    CheckBox CB_UOP_HIDEVMENUBAR
399
    {
400
        Pos = MAP_APPFONT ( 12 , 76 ) ;
401
        Size = MAP_APPFONT ( 155 , 10 ) ;
402
        TabStop = TRUE ;
403
        Text[ de ] = "Hide ~menubar" ;
404
        Text[ en-US ] = "Hide ~menubar";
405
    };
406
    CheckBox CB_UOP_HIDEVTOOLBAR
407
    {
408
        Pos = MAP_APPFONT ( 12 , 88 ) ;
409
        Size = MAP_APPFONT ( 155 , 10 ) ;
410
        TabStop = TRUE ;
411
        Text[ de ] = "Hide tool bar" ;
412
        Text[ en-US ] = "Hide ~toolbar";
413
    };
414
    CheckBox CB_UOP_HIDEVWINCTRL
415
    {
416
        Pos = MAP_APPFONT ( 12 , 100 ) ;
417
        Size = MAP_APPFONT ( 155 , 10 ) ;
418
        TabStop = TRUE ;
419
        Text[ de ] = "Hide window ~controls" ;
420
        Text[ en-US ] = "Hide ~window controls";
421
    };
422
423
///////////////////////////
424
    FixedLine FL_DIRCONTR
425
    {
426
        Pos = MAP_APPFONT ( 6 ,  114 ) ;
427
        Size = MAP_APPFONT ( 162  , 8 ) ;
428
        Text[ de ] = "Main reading order for text" ;
429
        Text[ en-US ] = "Main reading order for text" ;
430
    };
431
    RadioButton  RB_LEFTRIGHT
432
    {
433
        Pos = MAP_APPFONT ( 12 , 126 ) ;
434
        Size = MAP_APPFONT ( 155 , 10 ) ;
435
        Text[ de ] = "Left to ~right" ;
436
        Text[ en-US ] = "Left to ~right" ;
437
    };
438
    RadioButton  RB_RIGHTLEFT
439
    {
440
        Pos = MAP_APPFONT ( 12 , 138 ) ;
441
        Size = MAP_APPFONT ( 155 , 10 ) ;
442
        Text[ de ] = "Right to ~left" ;
443
        Text[ en-US ] = "Right to ~left" ;
444
    };
445
};
446
447
//----------------------------------------------------------
448
TabDialog  RID_PDF_EXPORT_DLG
449
{
450
    HelpId = HID_FILTER_PDF_OPTIONS ;
451
    OutputSize = TRUE;
452
    SVLook = TRUE;
453
    Moveable = TRUE;
454
    WORKARROUND
455
    TabControl 1
456
    {
457
        HelpId = HID_FILTER_PDF_OPTIONS ;
458
        OutputSize = TRUE;
459
        PageList =
460
        {
461
            PageItem
462
            {
463
                Identifier = RID_PDF_TAB_GENER;
464
                Text [ de ] = "Allgemein";
465
                Text [ en-US ] = "General";
466
            };
467
            PageItem
468
            {
469
                Identifier = RID_PDF_TAB_OPNFTR;
470
                Text [ de ] = "Document Open Options";
471
                Text [ en-US ] = "Document Open Options";
472
            };
473
            PageItem
474
            {
475
                Identifier = RID_PDF_TAB_VPREFER;
476
                Text [ de ] = "Viewer Options";
477
                Text [ en-US ] = "Viewer Options";
478
            };
479
        };
480
    };
232
};
481
};
(-)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 / +73 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, nPDFPageLayout = 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( "ResizeWindowToInitialPage" ) ) )
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( "OpenInFullScreenMode" ) ) )
324
                    rFilterData[ nData ].Value >>= aContext.OpenInFullScreenMode;
325
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ) )
326
                    rFilterData[ nData ].Value >>= aContext.DisplayPDFDocumentTitle;
327
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ) )
328
                    rFilterData[ nData ].Value >>= aContext.DirectionR2L;
329
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "InitialView" ) ) )
330
                    rFilterData[ nData ].Value >>= nPDFDocumentMode;
331
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "Magnification" ) ) )
332
                    rFilterData[ nData ].Value >>= nPDFDocumentAction;
333
                else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayout" ) ) )
334
                    rFilterData[ nData ].Value >>= nPDFPageLayout;
310
            }
335
            }
311
            PDFWriter::PDFWriterContext aContext;
312
            aContext.URL		= aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
336
            aContext.URL		= aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
313
            aContext.Version	= PDFWriter::PDF_1_4;
337
            aContext.Version	= PDFWriter::PDF_1_4;
314
			aContext.Tagged		= mbUseTaggedPDF;
338
			aContext.Tagged		= mbUseTaggedPDF;
339
340
            switch( nPDFDocumentMode )
341
            {
342
                default:
343
                case 0:
344
                    aContext.PDFDocumentMode = PDFWriter::ModeDefault;
345
                    break;
346
                case 1:
347
                    aContext.PDFDocumentMode = PDFWriter::UseOutlines;
348
                    break;
349
                case 2:
350
                    aContext.PDFDocumentMode = PDFWriter::UseThumbs;
351
                    break;
352
            }
353
            switch( nPDFDocumentAction )
354
            {
355
                default:
356
                case 0:
357
                    aContext.PDFDocumentAction = PDFWriter::ActionDefault;
358
                    break;
359
                case 1:
360
                    aContext.PDFDocumentAction = PDFWriter::FitInWindow;
361
                    break;
362
                case 2:
363
                    aContext.PDFDocumentAction = PDFWriter::FitWidth;
364
                    break;
365
                case 3:
366
                    aContext.PDFDocumentAction = PDFWriter::FitVisible;
367
                    break;
368
            }
369
370
            switch( nPDFPageLayout )
371
            {
372
                default:
373
                case 0:
374
                    aContext.PageLayout = PDFWriter::DefaultLayout;
375
                    break;
376
                case 1:
377
                    aContext.PageLayout = PDFWriter::SinglePage;
378
                    break;
379
                case 2:
380
                    aContext.PageLayout = PDFWriter::Continuous;
381
                    break;
382
                case 3:
383
                    aContext.PageLayout = PDFWriter::ContinuousFacing;
384
                    break;
385
            }
386
315
            /*
387
            /*
316
            * FIXME: the entries are only implicitly defined by the resource file. Should there
388
            * 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.
389
            * 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 (+138 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>Specifies whether to hide the PDF viewer controls when the document is active.</desc>
4899
						</info>
4900
						<value>false</value>
4901
					</prop>
4902
					<prop oor:name="ResizeWindowToInitialPage" oor:type="xs:boolean">
4903
						<info>
4904
							<author>beppec56</author>
4905
							<desc>Specifies 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>Specifies 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="OpenInFullScreenMode" oor:type="xs:boolean">
4917
						<info>
4918
							<author>beppec56</author>
4919
							<desc>Specifies that the PDF viewer window is opened full screen, on top of all windows..</desc>
4920
						</info>
4921
						<value>false</value>
4922
					</prop>
4923
					<prop oor:name="DisplayPDFDocumentTitle" oor:type="xs:boolean">
4924
						<info>
4925
							<author>beppec56</author>
4926
							<desc>Specifies that the title of the document, if present in the document properties, is displayed in the PDF viewer window title bar.</desc>
4927
						</info>
4928
						<value>true</value>
4929
					</prop>
4930
					<prop oor:name="DirectionR2L" oor:type="xs:boolean">
4931
						<info>
4932
							<author>beppec56</author>
4933
							<desc>Specifie the</desc>
4934
						</info>
4935
						<value>false</value>
4936
					</prop>
4937
					<prop oor:name="InitialView" oor:type="xs:int">
4938
						<info>
4939
							<author>beppec56</author>
4940
							<desc>Specifies how the PDF document should be displayed when opened.</desc>
4941
						</info>
4942
						<constraints>
4943
							<enumeration oor:value="0">
4944
								<info>
4945
									<desc>Select the default viewer mode, neither outlines or thumbnails.</desc>
4946
								</info>
4947
							</enumeration>
4948
							<enumeration oor:value="1">
4949
								<info>
4950
									<desc>The document is opened with outline pane opened</desc>
4951
								</info>
4952
							</enumeration>
4953
							<enumeration oor:value="2">
4954
								<info>
4955
									<desc>The document is opened with thumbnail pane opened</desc>
4956
								</info>
4957
							</enumeration>
4958
						</constraints>
4959
						<value>0</value>
4960
					</prop>
4961
					<prop oor:name="Magnification" oor:type="xs:int">
4962
						<info>
4963
							<author>beppec56</author>
4964
							<desc>Specifies the action to be performed when the PDF document is opened.</desc>
4965
						</info>
4966
						<constraints>
4967
							<enumeration oor:value="0">
4968
								<info>
4969
									<desc>Opens with default zoom magnification.</desc>
4970
								</info>
4971
							</enumeration>
4972
							<enumeration oor:value="1">
4973
								<info>
4974
									<desc>Opens magnified to fit the entire page within the window.</desc>
4975
								</info>
4976
							</enumeration>
4977
							<enumeration oor:value="2">
4978
								<info>
4979
									<desc>Opens magnified to fit the entire page width within the window.</desc>
4980
								</info>
4981
							</enumeration>
4982
							<enumeration oor:value="3">
4983
								<info>
4984
									<desc>Opens magnified to fit the entire width of its boundig box within the window (cuts out margins).</desc>
4985
								</info>
4986
							</enumeration>
4987
						</constraints>
4988
						<value>0</value>
4989
					</prop>
4990
					<prop oor:name="PageLayout" oor:type="xs:int">
4991
						<info>
4992
							<author>beppec56</author>
4993
							<desc>Specifies the page layout to be used when the document is opened.</desc>
4994
						</info>
4995
						<constraints>
4996
							<enumeration oor:value="0">
4997
								<info>
4998
									<desc>Display the pages according to the reader configuration.</desc>
4999
								</info>
5000
							</enumeration>
5001
							<enumeration oor:value="1">
5002
								<info>
5003
									<desc>Display one page at a time.</desc>
5004
								</info>
5005
							</enumeration>
5006
							<enumeration oor:value="2">
5007
								<info>
5008
									<desc>Display the pages in one column.</desc>
5009
								</info>
5010
							</enumeration>
5011
							<enumeration oor:value="3">
5012
								<info>
5013
									<desc>Display the pages in two columns odd pages on the left, to have the odd pages on the right the DirectionR2L properties should be used as well.</desc>
5014
								</info>
5015
							</enumeration>
5016
						</constraints>
5017
						<value>0</value>
5018
					</prop>
4881
				</group>
5019
				</group>
4882
			</group>
5020
			</group>
4883
		</group>
5021
		</group>
(-)vcl/inc/pdfwriter.hxx (-1 / +57 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
    };
430
// These emuns are treated as integer while reading/writing to configuration
431
    enum PDFViewerAction
432
    {
433
        ActionDefault,
434
        FitInWindow,
435
        FitWidth,
436
        FitVisible
437
    };
438
// These emuns are treated as integer while reading/writing to configuration
439
    enum PDFPageLayout
440
    {
441
        DefaultLayout,
442
        SinglePage,
443
        Continuous,
444
        ContinuousFacing
445
    };
446
422
    struct PDFWriterContext
447
    struct PDFWriterContext
423
    {
448
    {
424
        /* must be a valid file: URL usable by osl */
449
        /* must be a valid file: URL usable by osl */
Lines 433-443 public: Link Here
433
            will be submitted.
458
            will be submitted.
434
         */
459
         */
435
        PDFWriter::ExportDataFormat		SubmitFormat;
460
        PDFWriter::ExportDataFormat		SubmitFormat;
461
        /* the following data members are used to customize the PDF viewer
462
           preferences
463
         */
464
        /* see 3.6.1 PDF v 1.4 ref*/
465
        PDFWriter::PDFViewerPageMode    PDFDocumentMode;
466
        PDFWriter::PDFViewerAction      PDFDocumentAction;
467
468
        /* see 8.6 PDF v 1.4 ref
469
           specifies whether to hide the viewer tool
470
          bars when the document is active.
471
        */
472
        bool                            HideViewerToolbar;
473
        bool                            HideViewerMenubar;
474
        bool                            HideViewerWindowControls;
475
        bool                            FitWindow;
476
        bool                            OpenInFullScreenMode;
477
        bool                            CenterWindow;
478
        bool                            DisplayPDFDocumentTitle;
479
        bool                            DirectionR2L;
480
        PDFPageLayout                   PageLayout;
436
481
437
        PDFWriterContext() :
482
        PDFWriterContext() :
438
                Version( PDFWriter::PDF_1_4 ),
483
                Version( PDFWriter::PDF_1_4 ),
439
                Tagged( false ),
484
                Tagged( false ),
440
                SubmitFormat( PDFWriter::FDF )
485
                SubmitFormat( PDFWriter::FDF ),
486
                PDFDocumentMode( PDFWriter::ModeDefault ),
487
                PDFDocumentAction( PDFWriter::ActionDefault ),
488
                HideViewerToolbar( false ),
489
                HideViewerMenubar( false ),
490
                HideViewerWindowControls( false ),
491
                FitWindow( false ),
492
                OpenInFullScreenMode( false ),
493
                CenterWindow( false ),
494
                DisplayPDFDocumentTitle( false ),
495
                DirectionR2L( false ),
496
                PageLayout( PDFWriter::DefaultLayout )
441
        {}
497
        {}
442
    };
498
    };
443
499
(-)vcl/source/gdi/pdfwriter_impl.cxx (-3 / +94 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
4349
    if( m_aContext.PageLayout != PDFWriter::DefaultLayout )
4350
        switch(  m_aContext.PageLayout )
4351
        {
4352
        default :
4353
        case  PDFWriter::SinglePage :
4354
            aLine.append( "/PageLayout/SinglePage\n" );
4355
            break;
4356
        case  PDFWriter::Continuous :
4357
            aLine.append( "/PageLayout/OneColumn\n" );
4358
            break;
4359
        case  PDFWriter::ContinuousFacing :
4360
//the effect of odd page on the right ( /PageLayout/TwoColumnLeft ) can be achieved with DirectionR2L (see below)
4361
            aLine.append( "/PageLayout/TwoColumnRight\n" );
4362
            break;
4363
        }
4364
    if( m_aContext.PDFDocumentMode != PDFWriter::ModeDefault && !m_aContext.OpenInFullScreenMode )
4365
        switch(  m_aContext.PDFDocumentMode )
4366
        {
4367
        default :
4368
            aLine.append( "/PageMode/UseNone\n" );
4369
            break;
4370
        case PDFWriter::UseOutlines :
4371
            aLine.append( "/PageMode/UseOutlines\n" ); //document is opened with outline pane open
4372
            break;
4373
        case PDFWriter::UseThumbs :
4374
            aLine.append( "/PageMode/UseThumbs\n" ); //document is opened with thumbnails pane open
4375
            break;
4376
        }
4377
    else if( m_aContext.OpenInFullScreenMode )
4378
        aLine.append( "/PageMode/FullScreen\n" ); //document is opened full screen
4379
4380
    switch( m_aContext.PDFDocumentAction )
4381
    {
4382
    case PDFWriter::ActionDefault :
4383
    default:
4384
        aLine.append( "/OpenAction [0 /XYZ null null null" ); //page 0 (first) open Default, leave without it
4385
        break;
4386
    case PDFWriter::FitInWindow :
4387
        aLine.append( "/OpenAction [0 /Fit" ); //Open fit page
4388
        break;
4389
    case PDFWriter::FitWidth :
4390
        aLine.append( "/OpenAction [0 /FitH " );
4391
        aLine.append( m_nInheritedPageHeight );//Open fit width
4392
        break;
4393
    case PDFWriter::FitVisible :
4394
        aLine.append( "/OpenAction [0 /FitBH " );
4395
        aLine.append( m_nInheritedPageHeight );//Open fit visible
4396
        break;
4397
    }
4398
    aLine.append( "]\n" );
4399
// viewer preferences, if we had some, then emit
4400
    if( m_aContext.HideViewerToolbar ||
4401
        ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
4402
        m_aContext.HideViewerMenubar ||
4403
        m_aContext.HideViewerWindowControls || m_aContext.FitWindow ||
4404
        m_aContext.CenterWindow || m_aContext.DirectionR2L ||
4405
        m_aContext.OpenInFullScreenMode )
4406
    {
4407
        aLine.append( "/ViewerPreferences<<" );
4408
        if( m_aContext.HideViewerToolbar )
4409
            aLine.append( "/HideToolbar true\n" );
4410
        if( m_aContext.HideViewerMenubar )
4411
            aLine.append( "/HideMenubar true\n" );
4412
        if( m_aContext.HideViewerWindowControls )
4413
            aLine.append( "/HideWindowUI true\n" );
4414
        if( m_aContext.FitWindow )
4415
            aLine.append("/FitWindow true\n");
4416
        if( m_aContext.CenterWindow )
4417
            aLine.append("/CenterWindow true\n");
4418
        if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
4419
            aLine.append( "/DisplayDocTitle true\n" );
4420
        if( m_aContext.DirectionR2L )
4421
            aLine.append("/Direction /R2L\n");
4422
        if( m_aContext.OpenInFullScreenMode )
4423
            switch( m_aContext.PDFDocumentMode )
4424
            {
4425
            default :
4426
            case PDFWriter::ModeDefault :
4427
                aLine.append("/NonFullScreenPageMode/UseNone\n");
4428
                break;
4429
            case PDFWriter::UseOutlines :
4430
                aLine.append("/NonFullScreenPageMode/UseOutlines\n");
4431
                break;
4432
            case PDFWriter::UseThumbs :
4433
                aLine.append("/NonFullScreenPageMode/UseThumbs\n");
4434
                break;
4435
            }
4436
        aLine.append( ">>\n" );
4437
    }
4438
4348
    if( nOutlineDict )
4439
    if( nOutlineDict )
4349
    {
4440
    {
4350
        aLine.append( "   /Outlines " );
4441
        aLine.append( "   /Outlines " );

Return to issue 61139