File: window_main_tool.cc

package info (click to toggle)
pdfchain 1:0.4.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,352 kB
  • sloc: cpp: 4,861; sh: 1,352; makefile: 432
file content (413 lines) | stat: -rw-r--r-- 19,428 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
/*
 * window_main_tool.cc
 * Copyright (C) Martin Singer 2009-2013 <m_power3@users.sourceforge.net>
 * 
 * pdfchain is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * pdfchain is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "window_main_tool.h"


/*** Section : Tool ***********************************************************/

// Constructor
cSection_Tool::cSection_Tool( Gtk::Window& ref_window )
:
mHBox_SourceFile( false , Pdfchain::SPACING ),	// homogenous , spacing
mHBox_UpdateInfo( false , Pdfchain::SPACING ),
mHBox_FillForm(   false , Pdfchain::SPACING ),

mTable_Tool( 15 , 4 , false ),	// y_rows , x_columns , homogenous )

mFCButton_SourceFile(   ref_window , _("Tools - Select source PDF file ...") ),	// parent_window , title
mFCButton_DumpDataFile( ref_window , _("Tools - Select dump data file ...")  ),
mFCButton_FdfFile(      ref_window , _("Tools - Select FDF file ...")        ),

mFCDialog_SelectFolder( ref_window , _("Tools - Select output folder ...")     ),	// parent_window , title
mFCDialog_SaveAs_Pdf(   ref_window , _("Tools - Save output PDF file as ...")  ),
mFCDialog_SaveAs_Fdf(   ref_window , _("Tools - Save output FDF file as ...")  ),
mFCDialog_SaveAs_Dump(  ref_window , _("Tools - Save output dump file as ...") ),

mLabel_SourceFile(   _("Document:")       , Gtk::ALIGN_END , Gtk::ALIGN_CENTER , false ),	// label , xalign , yalign , mnemonic
mLabel_DumpDataFile( _("Dump data file:") , Gtk::ALIGN_END , Gtk::ALIGN_CENTER , false ),
mLabel_FdfFile(      _("FDF file:")       , Gtk::ALIGN_END , Gtk::ALIGN_CENTER , false ),

mCButton_DumpDataFields_Utf8( _("UTF-8")            , false ),	// label , mnemonic
mCButton_DumpData_Utf8(       _("UTF-8")            , false ),
mCButton_UpdateInfo_Utf8(     _("UTF-8")            , false ),
mCButton_FillForm_DropXfa(    _("Drop XFA")         , false ),
mCButton_FillForm_Flatten(    _("Flatten")          , false ),
mCButton_FillForm_Appearance( _("Need appearances") , false ),

mRButton_Repair(         mRBGroup_Tool , _("Repair docu_ment")                     , true ),	// group , label , mnemonic
mRButton_UnpackFiles(    mRBGroup_Tool , _("Un_pack attached files from document") , true ),
mRButton_Uncompress(     mRBGroup_Tool , _("_Uncompress document")                 , true ),
mRButton_Compress(       mRBGroup_Tool , _("C_ompress document")                   , true ),
mRButton_DumpDataAnnots( mRBGroup_Tool , _("Dump a_nnotation data from document")  , true ),
mRButton_DumpDataFields( mRBGroup_Tool , _("Dump data _fields from document")      , true ),
mRButton_DumpData(       mRBGroup_Tool , _("_Dump data from document")             , true ),
mRButton_UpdateInfo(     mRBGroup_Tool , _("Update _info of document")             , true ),
mRButton_GenerateFdf(    mRBGroup_Tool , _("_Generate FDF from document")          , true ),
mRButton_FillForm(       mRBGroup_Tool , _("Fill fo_rm of document")               , true ),
mRButton_Flatten(        mRBGroup_Tool , _("Document f_latten")                    , true ),
mRButton_DropXfa(        mRBGroup_Tool , _("Drop _XFA from document")              , true ),

mHSeparator_A( Gtk::ORIENTATION_HORIZONTAL ),	// orientation
mHSeparator_B( Gtk::ORIENTATION_HORIZONTAL ),
mHSeparator_C( Gtk::ORIENTATION_HORIZONTAL ),
mHSeparator_D( Gtk::ORIENTATION_HORIZONTAL ),

mVSeparator_FillForm( Gtk::ORIENTATION_VERTICAL ),

rSGroup_FCButton( Gtk::SizeGroup::create( Gtk::SIZE_GROUP_HORIZONTAL ) )
{
	
	mRButton_Repair.set_tooltip_text(         _("Repairs corrupted XREF table and stream lengths, if possible") );
	mRButton_UnpackFiles.set_tooltip_text(    _("Copys Documents attachments into output directory") );
	mRButton_Uncompress.set_tooltip_text(     _("Uncompess for editing PDF code with text editor (like vim or emacs)") );
	mRButton_Compress.set_tooltip_text(       _("Restores compession") );
	mRButton_DumpDataAnnots.set_tooltip_text( _("Reports link annotations of document") );
	mRButton_DumpDataFields.set_tooltip_text( _("Reports form field data of document") );
	mRButton_DumpData.set_tooltip_text(       _("Reports statistics of document") );
	mRButton_UpdateInfo.set_tooltip_text(     _("Changes the bookmarks and metadata at document") );
	mRButton_GenerateFdf.set_tooltip_text(    _("Generates a dummy FDF from document") );
	mRButton_FillForm.set_tooltip_text(       _("Fills document's form fields with the data from an FDF file or XFDF file") );
	mRButton_Flatten.set_tooltip_text(        _("Merges document's interactive form fields (and their data) with the document's pages") );
	mRButton_DropXfa.set_tooltip_text(        _("Removes the form's XFA data") );

	mCButton_DumpDataFields_Utf8.set_tooltip_text( _("Generate UTF-8 encoding") );
	mCButton_DumpData_Utf8.set_tooltip_text(       _("Generate UTF-8 encoding") );
	mCButton_UpdateInfo_Utf8.set_tooltip_text(     _("Generate UTF-8 encoding") );
	mCButton_FillForm_DropXfa.set_tooltip_text(    _("Removes the form's XFA data") );
	mCButton_FillForm_Flatten.set_tooltip_text(    _("Merges document's interactive form fields (and their data) with the document's pages") );
	mCButton_FillForm_Appearance.set_tooltip_text( _("Sets a flag that cues Reader/Acrobat to generate new field appearances based on the form field values.") );

	rSGroup_FCButton->add_widget( mLabel_DumpDataFile );
	rSGroup_FCButton->add_widget( mLabel_FdfFile );

	mFCButton_SourceFile.set_halign(   Gtk::ALIGN_START );
	mFCButton_DumpDataFile.set_halign( Gtk::ALIGN_START );
	mFCButton_FdfFile.set_halign(      Gtk::ALIGN_START );
	
	mAlign_HSeparatorA.set_padding( Pdfchain::BORDER , Pdfchain::BORDER , 0 , 0 );	// top , bottom , left , right
	mAlign_HSeparatorB.set_padding( Pdfchain::BORDER , Pdfchain::BORDER , 0 , 0 );
	mAlign_HSeparatorC.set_padding( Pdfchain::BORDER , Pdfchain::BORDER , 0 , 0 );
	mAlign_HSeparatorD.set_padding( Pdfchain::BORDER , Pdfchain::BORDER , 0 , 0 );

	mAlign_HSeparatorA.add( mHSeparator_A );
	mAlign_HSeparatorB.add( mHSeparator_B );
	mAlign_HSeparatorC.add( mHSeparator_C );
	mAlign_HSeparatorD.add( mHSeparator_D );

	mHBox_SourceFile.set_border_width( Pdfchain::BORDER );
	mHBox_SourceFile.pack_start( mLabel_SourceFile      , false , false , 0 );	// widget , expand , fill , padding
	mHBox_SourceFile.pack_start( mFCButton_SourceFile   , true  , true  , 0 );

	mHBox_UpdateInfo.pack_start( mLabel_DumpDataFile    , false , false , 0 );
	mHBox_UpdateInfo.pack_start( mFCButton_DumpDataFile , true  , true  , 0 );

	mHBox_FillForm.pack_start( mLabel_FdfFile           , false , false , 0 );
	mHBox_FillForm.pack_start( mFCButton_FdfFile        , true  , true  , 0 );
	
	mTable_Tool.set_border_width( Pdfchain::BORDER );
	mTable_Tool.set_col_spacings( Pdfchain::SPACING );
	mTable_Tool.attach( mRButton_Repair              , 0 , 5 ,  0 ,  1 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Repair
	mTable_Tool.attach( mAlign_HSeparatorA           , 0 , 5 ,  1 ,  2 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mRButton_UnpackFiles         , 0 , 5 ,  2 ,  3 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Unpack files
	mTable_Tool.attach( mAlign_HSeparatorB           , 0 , 5 ,  3 ,  4 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mRButton_Uncompress	         , 0 , 5 ,  4 ,  5 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Uncompress
	mTable_Tool.attach( mRButton_Compress            , 0 , 5 ,  5 ,  6 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Compress
	mTable_Tool.attach( mAlign_HSeparatorC           , 0 , 5 ,  6 ,  7 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mRButton_DumpDataAnnots      , 0 , 4 ,  7 ,  8 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Dump data annots
	mTable_Tool.attach( mRButton_DumpDataFields      , 0 , 4 ,  8 ,  9 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Dump data fields
	mTable_Tool.attach( mCButton_DumpDataFields_Utf8 , 4 , 5 ,  8 ,  9 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mRButton_DumpData            , 0 , 4 ,  9 , 10 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Dump data
	mTable_Tool.attach( mCButton_DumpData_Utf8       , 4 , 5 ,  9 , 10 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mRButton_UpdateInfo          , 0 , 4 , 10 , 11 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Update info
	mTable_Tool.attach( mCButton_UpdateInfo_Utf8     , 4 , 5 , 10 , 11 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mHBox_UpdateInfo             , 0 , 5 , 11 , 12 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	
	mTable_Tool.attach( mAlign_HSeparatorD           , 0 , 5 , 12 , 13 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mRButton_GenerateFdf         , 0 , 5 , 13 , 14 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Generate FDF
	mTable_Tool.attach( mRButton_FillForm            , 0 , 1 , 14 , 15 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Fill form
	mTable_Tool.attach( mCButton_FillForm_DropXfa    , 1 , 2 , 14 , 15 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mVSeparator_FillForm         , 2 , 3 , 14 , 15 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mCButton_FillForm_Appearance , 3 , 4 , 14 , 15 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mCButton_FillForm_Flatten    , 4 , 5 , 14 , 15 , Gtk::FILL | Gtk::SHRINK , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mHBox_FillForm               , 0 , 5 , 15 , 16 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );
	mTable_Tool.attach( mRButton_Flatten             , 0 , 5 , 16 , 17 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Flatten
	mTable_Tool.attach( mRButton_DropXfa             , 0 , 5 , 17 , 18 , Gtk::FILL | Gtk::EXPAND , Gtk::FILL | Gtk::SHRINK , 0 , 0 );	// Drop XFA

	mSWindow_Tool.add( mTable_Tool );

	pack_start( mHBox_SourceFile , false , false , 0 );	// widget , expand , fill , padding
	pack_start( mSWindow_Tool    , true  , true  , 0 );

	mRButton_DumpDataFields.signal_toggled().connect( sigc::mem_fun(
		*this , &cSection_Tool::onRButton_DumpDataFields_toggled ) );
		
	mRButton_DumpData.signal_toggled().connect( sigc::mem_fun(
		*this , &cSection_Tool::onRButton_DumpData_toggled ) );
		
	mRButton_UpdateInfo.signal_toggled().connect( sigc::mem_fun(
		*this , &cSection_Tool::onRButton_UpdateInfo_toggled ) );
		
	mRButton_FillForm.signal_toggled().connect( sigc::mem_fun(
		*this , &cSection_Tool::onRButton_FillForm_toggled ) );

	mCButton_FillForm_Flatten.signal_toggled().connect(
		sigc::mem_fun( *this , &cSection_Tool::onCButton_FillForm_Flatten_toggled ) );

	mCButton_FillForm_Appearance.signal_toggled().connect(
		sigc::mem_fun( *this , &cSection_Tool::onCButton_FillForm_Appearance_toggled ) );

	init();
}

// Destructor
cSection_Tool::~cSection_Tool()
{
#ifdef PDFCHAIN_TEST
	std::cout << std::endl << "cSection_Tool::~cSection_Tool()";	//TEST
#endif
}


// Method (public) : clear
void
cSection_Tool::clear()
{
	mFCButton_SourceFile.clear();
	mFCButton_DumpDataFile.clear();
	mFCButton_FdfFile.clear();

	mFCDialog_SelectFolder.clear();
	mFCDialog_SaveAs_Pdf.clear();
	mFCDialog_SaveAs_Fdf.clear();
	mFCDialog_SaveAs_Dump.clear();

	init();
	return;
}


// Method (public) : create command
std::string
cSection_Tool::createCommand()
{
	std::string str_command		= "";
	std::string str_sourcefile	= "";
	std::string str_dumpfile	= "";
	std::string str_fdffile		= "";
	std::string str_output		= "";

	if ( "" != ( str_sourcefile = mFCButton_SourceFile.get_filename() ) ) {

		if ( mRButton_UnpackFiles.get_active() ) {
			switch ( mFCDialog_SelectFolder.run() ) {
				case Gtk::RESPONSE_OK:
					mFCDialog_SelectFolder.hide();
					str_output = mFCDialog_SelectFolder.get_current_folder();
					break;
				default:
					mFCDialog_SelectFolder.hide();
					break;
			}
		}
		else if ( mRButton_DumpDataAnnots.get_active() || mRButton_DumpDataFields.get_active() || mRButton_DumpData.get_active() ) {
			switch ( mFCDialog_SaveAs_Dump.run() ) {
				case Gtk::RESPONSE_OK:
					mFCDialog_SaveAs_Dump.hide();
					str_output = mFCDialog_SaveAs_Dump.get_filename();
				default:
					mFCDialog_SaveAs_Dump.hide();
					break;
			}
		}
		else if ( mRButton_GenerateFdf.get_active() ) {
			switch ( mFCDialog_SaveAs_Fdf.run() ) {
				case Gtk::RESPONSE_OK:
					mFCDialog_SaveAs_Fdf.hide();
					str_output = mFCDialog_SaveAs_Fdf.get_filename();
				default:
					mFCDialog_SaveAs_Fdf.hide();
					break;
			}
		}
		else if ( mRButton_UpdateInfo.get_active() ) {
			if ( "" != ( str_dumpfile = mFCButton_DumpDataFile.get_filename() ) ) {
				switch ( mFCDialog_SaveAs_Pdf.run() ) {
					case Gtk::RESPONSE_OK:
						mFCDialog_SaveAs_Pdf.hide();
						str_output = mFCDialog_SaveAs_Pdf.get_filename();
					default:
						mFCDialog_SaveAs_Pdf.hide();
						break;
				}
			}
		}
		else if ( mRButton_FillForm.get_active() ) {
			if ( "" != ( str_fdffile = mFCButton_FdfFile.get_filename() ) ) {
				switch ( mFCDialog_SaveAs_Pdf.run() ) {
					case Gtk::RESPONSE_OK:
						mFCDialog_SaveAs_Pdf.hide();
						str_output = mFCDialog_SaveAs_Pdf.get_filename();
					default:
						mFCDialog_SaveAs_Pdf.hide();
						break;
				}
			}
		}
		else {
			switch ( mFCDialog_SaveAs_Pdf.run() ) {
				case Gtk::RESPONSE_OK:
					mFCDialog_SaveAs_Pdf.hide();
					str_output = mFCDialog_SaveAs_Pdf.get_filename();
				default:
					mFCDialog_SaveAs_Pdf.hide();
					break;
			}
		}

		if ( "" != str_output ) {
		
			if ( mRButton_Repair.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
			}
			else if ( mRButton_UnpackFiles.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::UNPACK_FILES;
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
			}
			else if ( mRButton_Uncompress.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
				str_command += " " + Pdfchain::Cmd::UNCOMPRESS;
			}
			else if ( mRButton_Compress.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
				str_command += " " + Pdfchain::Cmd::COMPRESS;
			}
			else if ( mRButton_DumpDataAnnots.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::DUMP_DATA_ANNOTS;
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
			}
			else if ( mRButton_DumpDataFields.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );

				if ( true == mCButton_DumpDataFields_Utf8.get_active() ) {
					str_command += " " + Pdfchain::Cmd::DUMP_DATA_FIELDS_UTF8;
				} else {
					str_command += " " + Pdfchain::Cmd::DUMP_DATA_FIELDS;
				}
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
			}
			else if ( mRButton_DumpData.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				
				if ( true == mCButton_DumpData_Utf8.get_active() ) {
					str_command += " " + Pdfchain::Cmd::DUMP_DATA_UTF8;
				} else {
					str_command += " " + Pdfchain::Cmd::DUMP_DATA;
				}
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
			}
			else if ( mRButton_UpdateInfo.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );

				if ( true == mCButton_UpdateInfo_Utf8.get_active() ) {
					str_command += " " + Pdfchain::Cmd::UPDATE_INFO_UTF8;
				} else {
					str_command += " " + Pdfchain::Cmd::UPDATE_INFO;
				}
				str_command += " " + Pdfchain::quote_path( str_dumpfile );
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
			}
			else if ( mRButton_GenerateFdf.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::GENERATE_FDF;
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
			}
			else if ( mRButton_FillForm.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::FILL_FORM;
				str_command += " " + Pdfchain::quote_path( str_fdffile );
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );

				if ( mCButton_FillForm_DropXfa.get_active() ) 
					str_command += " " + Pdfchain::Cmd::DROP_XFA;

				if ( mCButton_FillForm_Flatten.get_active() ) 
					str_command += " " + Pdfchain::Cmd::FLATTEN;

				if ( mCButton_FillForm_Appearance.get_active() ) 
					str_command += " " + Pdfchain::Cmd::NEED_APPEARANCES;
			}
			else if ( mRButton_Flatten.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
				str_command += " " + Pdfchain::Cmd::FLATTEN;
			}
			else if ( mRButton_DropXfa.get_active() ) {
				str_command  = " " + Pdfchain::quote_path( str_sourcefile );
				str_command += " " + Pdfchain::Cmd::OUTPUT;
				str_command += " " + Pdfchain::quote_path( str_output );
				str_command += " " + Pdfchain::Cmd::DROP_XFA;
			}
		}
	}
	
	return str_command;
}


// Method (protected) : init
void
cSection_Tool::init()
{
	mRButton_Repair.set_active( true );

	mCButton_DumpDataFields_Utf8.set_active( true );
	mCButton_DumpData_Utf8.set_active( true );
	mCButton_UpdateInfo_Utf8.set_active( true );
	mCButton_FillForm_DropXfa.set_active( true );
	mCButton_FillForm_Flatten.set_active( false );

	mLabel_DumpDataFile.set_sensitive( false );
	mFCButton_DumpDataFile.set_sensitive( false );
	mLabel_FdfFile.set_sensitive( false );
	mFCButton_FdfFile.set_sensitive( false );
	mVSeparator_FillForm.set_sensitive( false );
	mCButton_DumpDataFields_Utf8.set_sensitive( false );
	mCButton_DumpData_Utf8.set_sensitive( false );
	mCButton_UpdateInfo_Utf8.set_sensitive( false );
	mCButton_FillForm_DropXfa.set_sensitive( false );
	mCButton_FillForm_Flatten.set_sensitive( false );
	mCButton_FillForm_Appearance.set_sensitive( false );

	return;
}