pdf_paradise 0.1.66

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pdf_paradise might be problematic. Click here for more details.

Files changed (110) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +705 -0
  3. data/bin/automatic_pdf_title +7 -0
  4. data/bin/combine_these_pdf_pages +7 -0
  5. data/bin/compress_via_hexapdf +7 -0
  6. data/bin/convert_markdown_to_pdf +7 -0
  7. data/bin/convert_pdf_to_text +7 -0
  8. data/bin/delete_first_page_of_this_pdf_file +7 -0
  9. data/bin/merge_then_open +7 -0
  10. data/bin/n_pages +10 -0
  11. data/bin/open_main_pdf +7 -0
  12. data/bin/pdf_paradise +9 -0
  13. data/bin/set_main_book +7 -0
  14. data/bin/set_title_of_this_pdf_file +15 -0
  15. data/doc/README.gen +662 -0
  16. data/doc/todo/todo.md +7 -0
  17. data/lib/pdf_paradise/base/base.rb +239 -0
  18. data/lib/pdf_paradise/base/colours.rb +36 -0
  19. data/lib/pdf_paradise/commandline/commandline.rb +101 -0
  20. data/lib/pdf_paradise/commandline/help.rb +73 -0
  21. data/lib/pdf_paradise/commandline/menu.rb +142 -0
  22. data/lib/pdf_paradise/compress/compress_via_hexapdf.rb +27 -0
  23. data/lib/pdf_paradise/compress_this_pdf_file.rb +87 -0
  24. data/lib/pdf_paradise/constants/constants.rb +76 -0
  25. data/lib/pdf_paradise/convert_text_to_pdf.rb +94 -0
  26. data/lib/pdf_paradise/css/project.css +17 -0
  27. data/lib/pdf_paradise/djvu_to_pdf.rb +85 -0
  28. data/lib/pdf_paradise/gui/README.md +6 -0
  29. data/lib/pdf_paradise/gui/fox/split_pdf_file.rb +77 -0
  30. data/lib/pdf_paradise/gui/gtk2/delete_the_first_or_the_last_page_of_this_pdf_file/delete_the_first_or_the_last_page_of_this_pdf_file.rb +39 -0
  31. data/lib/pdf_paradise/gui/gtk2/pdf_viewer/pdf_viewer.rb +34 -0
  32. data/lib/pdf_paradise/gui/gtk2/split_pdf_file/split_pdf_file.rb +34 -0
  33. data/lib/pdf_paradise/gui/gtk2/statistics_widget/statistics_widget.rb +34 -0
  34. data/lib/pdf_paradise/gui/gtk2/to_pdf/to_pdf.rb +32 -0
  35. data/lib/pdf_paradise/gui/gtk3/controller/controller.rb +212 -0
  36. data/lib/pdf_paradise/gui/gtk3/convert_pdf_to_text/convert_pdf_to_text.rb +34 -0
  37. data/lib/pdf_paradise/gui/gtk3/delete_the_first_or_the_last_page_of_this_pdf_file/delete_the_first_or_the_last_page_of_this_pdf_file.rb +39 -0
  38. data/lib/pdf_paradise/gui/gtk3/pdf_viewer/pdf_viewer.rb +34 -0
  39. data/lib/pdf_paradise/gui/gtk3/split_pdf_file/split_pdf_file.rb +34 -0
  40. data/lib/pdf_paradise/gui/gtk3/statistics_widget/statistics_widget.rb +34 -0
  41. data/lib/pdf_paradise/gui/gtk3/to_pdf/to_pdf.rb +32 -0
  42. data/lib/pdf_paradise/gui/libui/extract_all_images_from_this_pdf_file/extract_all_images_from_this_pdf_file.rb +223 -0
  43. data/lib/pdf_paradise/gui/libui/statistics_widget/statistics_widget.rb +233 -0
  44. data/lib/pdf_paradise/gui/shared_code/convert_pdf_to_text/convert_pdf_to_text_module.rb +277 -0
  45. data/lib/pdf_paradise/gui/shared_code/delete_the_first_or_the_last_page_of_this_pdf_file/delete_the_first_or_the_last_page_of_this_pdf_file_module.rb +443 -0
  46. data/lib/pdf_paradise/gui/shared_code/pdf_viewer/pdf_viewer.css +5 -0
  47. data/lib/pdf_paradise/gui/shared_code/pdf_viewer/pdf_viewer_module.rb +284 -0
  48. data/lib/pdf_paradise/gui/shared_code/split_pdf_file/split_pdf_file.css +0 -0
  49. data/lib/pdf_paradise/gui/shared_code/split_pdf_file/split_pdf_file_module.rb +294 -0
  50. data/lib/pdf_paradise/gui/shared_code/statistics_widget/statistics_widget_module.rb +349 -0
  51. data/lib/pdf_paradise/gui/shared_code/to_pdf/to_pdf_module.rb +281 -0
  52. data/lib/pdf_paradise/hexapdf/001_rainbow_pattern_example.rb +0 -0
  53. data/lib/pdf_paradise/hexapdf/hexapdf.rb +123 -0
  54. data/lib/pdf_paradise/images/PDF_PARADISE_LOGO.png +0 -0
  55. data/lib/pdf_paradise/main_pdf/main_pdf.rb +444 -0
  56. data/lib/pdf_paradise/merge_pdf/menu.rb +63 -0
  57. data/lib/pdf_paradise/merge_pdf/merge_pdf.rb +306 -0
  58. data/lib/pdf_paradise/merge_pdf_namespace.rb +9 -0
  59. data/lib/pdf_paradise/merge_then_open/merge_then_open.rb +105 -0
  60. data/lib/pdf_paradise/pdf_file_n_total_pages.rb +249 -0
  61. data/lib/pdf_paradise/prawn_addons/README.md +2 -0
  62. data/lib/pdf_paradise/prawn_addons/prawn_addons.rb +17 -0
  63. data/lib/pdf_paradise/project/project.rb +22 -0
  64. data/lib/pdf_paradise/remove_pdf_password.rb +391 -0
  65. data/lib/pdf_paradise/requires/batch_require_toplevel_files.rb +22 -0
  66. data/lib/pdf_paradise/requires/colours.rb +7 -0
  67. data/lib/pdf_paradise/requires/colours_and_esystem_and_save_file_and_fileutils_and_opn.rb +11 -0
  68. data/lib/pdf_paradise/requires/esystem_and_colours.rb +10 -0
  69. data/lib/pdf_paradise/requires/esystem_and_opn_and_colours.rb +8 -0
  70. data/lib/pdf_paradise/requires/require_the_whole_project.rb +28 -0
  71. data/lib/pdf_paradise/requires/require_utility_scripts.rb +9 -0
  72. data/lib/pdf_paradise/set_main_book.rb +156 -0
  73. data/lib/pdf_paradise/set_pdf_title.rb +220 -0
  74. data/lib/pdf_paradise/sinatra/embeddable_interface.rb +318 -0
  75. data/lib/pdf_paradise/toplevel_methods/automatic_pdf_title.rb +55 -0
  76. data/lib/pdf_paradise/toplevel_methods/convert_epub_to_pdf.rb +27 -0
  77. data/lib/pdf_paradise/toplevel_methods/convert_markdown_to_pdf.rb +45 -0
  78. data/lib/pdf_paradise/toplevel_methods/convert_ppt_to_pdf.rb +35 -0
  79. data/lib/pdf_paradise/toplevel_methods/e.rb +16 -0
  80. data/lib/pdf_paradise/toplevel_methods/esystem.rb +19 -0
  81. data/lib/pdf_paradise/toplevel_methods/misc.rb +76 -0
  82. data/lib/pdf_paradise/toplevel_methods/number_pages.rb +38 -0
  83. data/lib/pdf_paradise/toplevel_methods/opened_pdf_files.rb +221 -0
  84. data/lib/pdf_paradise/toplevel_methods/query_pdf_title.rb +191 -0
  85. data/lib/pdf_paradise/toplevel_methods/reduce_size_of_this_pdf_file.rb +46 -0
  86. data/lib/pdf_paradise/toplevel_methods/roebe.rb +17 -0
  87. data/lib/pdf_paradise/toplevel_methods/rotate_pdf_file.rb +143 -0
  88. data/lib/pdf_paradise/toplevel_methods/to_pdf.rb +38 -0
  89. data/lib/pdf_paradise/utility_scripts/README.md +3 -0
  90. data/lib/pdf_paradise/utility_scripts/combine_these_pdf_pages.rb +118 -0
  91. data/lib/pdf_paradise/utility_scripts/convert_pdf_to_text.rb +175 -0
  92. data/lib/pdf_paradise/utility_scripts/delete_first_page_of_this_pdf_file.rb +221 -0
  93. data/lib/pdf_paradise/utility_scripts/delete_last_page_of_this_pdf_file.rb +180 -0
  94. data/lib/pdf_paradise/utility_scripts/delete_this_page_of_this_pdf_file.rb +329 -0
  95. data/lib/pdf_paradise/utility_scripts/extract_all_images_from_this_pdf_file.rb +129 -0
  96. data/lib/pdf_paradise/utility_scripts/extract_pdf_page.rb +283 -0
  97. data/lib/pdf_paradise/utility_scripts/pdf_optimizer.rb +111 -0
  98. data/lib/pdf_paradise/utility_scripts/pdf_statistics.rb +148 -0
  99. data/lib/pdf_paradise/utility_scripts/pdf_to_html.rb +75 -0
  100. data/lib/pdf_paradise/utility_scripts/remove_images.rb +110 -0
  101. data/lib/pdf_paradise/utility_scripts/split_pdf.rb +340 -0
  102. data/lib/pdf_paradise/utility_scripts/to_qdf.rb +82 -0
  103. data/lib/pdf_paradise/version/version.rb +19 -0
  104. data/lib/pdf_paradise/www/README.md +2 -0
  105. data/lib/pdf_paradise/www/sinatra/app.rb +276 -0
  106. data/lib/pdf_paradise/yaml/working_on_these_pdf_files.yml +4 -0
  107. data/lib/pdf_paradise.rb +5 -0
  108. data/pdf_paradise.gemspec +61 -0
  109. data/test/testing_pdf_paradise.rb +9 -0
  110. metadata +219 -0
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::CompressThisPdfFile
6
+ #
7
+ # This class can be used to compress a .pdf file.
8
+ #
9
+ # Usage example:
10
+ #
11
+ # PdfParadise::CompressThisPdfFile.new(ARGV)
12
+ #
13
+ # =========================================================================== #
14
+ require 'pdf_paradise/base/base.rb'
15
+
16
+ module PdfParadise
17
+
18
+ class CompressThisPdfFile < ::PdfParadise::Base # === PdfParadise::CompressThisPdfFile
19
+
20
+ include FileUtils::Verbose
21
+
22
+ # ========================================================================= #
23
+ # === NAMESPACE
24
+ # ========================================================================= #
25
+ NAMESPACE = inspect
26
+
27
+ # ========================================================================= #
28
+ # === initialize
29
+ # ========================================================================= #
30
+ def initialize(
31
+ i = nil,
32
+ run_already = true
33
+ )
34
+ reset
35
+ set_commandline_arguments(i)
36
+ run if run_already
37
+ end
38
+
39
+ # ========================================================================= #
40
+ # === reset (reset tag)
41
+ # ========================================================================= #
42
+ def reset
43
+ super()
44
+ # ======================================================================= #
45
+ # === @use_this_compatibility_level
46
+ # ======================================================================= #
47
+ @use_this_compatibility_level = '1.6'
48
+ end
49
+
50
+ # ========================================================================= #
51
+ # === run (run tag)
52
+ #
53
+ # Note that using /ebook rather than /prepress would reduce the file
54
+ # size even further.
55
+ # ========================================================================= #
56
+ def run
57
+ commandline_arguments?.each {|this_file|
58
+ store_into_this_file = 'compressed_PDF_file.pdf'
59
+ cmd = "gs -sDEVICE=pdfwrite "\
60
+ "-dCompatibilityLevel=#{@use_this_compatibility_level} "\
61
+ "-dPDFSETTINGS=/prepress "\
62
+ "-dNOPAUSE -dQUIET -dBATCH "\
63
+ "-sOutputFile=#{store_into_this_file} #{this_file}"
64
+ e
65
+ e rev+
66
+ 'The compressed .pdf file will be stored here: '+
67
+ sfile(store_into_this_file)
68
+ e
69
+ esystem cmd
70
+ e
71
+ }
72
+ end
73
+
74
+ end
75
+
76
+ # =========================================================================== #
77
+ # === PdfParadise.compress_this_pdf_file
78
+ # =========================================================================== #
79
+ def self.compress_this_pdf_file(i = ARGV)
80
+ PdfParadise::CompressThisPdfFile.new(i)
81
+ end
82
+
83
+ end
84
+
85
+ if __FILE__ == $PROGRAM_NAME
86
+ PdfParadise::CompressThisPdfFile.new(ARGV)
87
+ end # compressthispdffile
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'pdf_paradise/constants/constants.rb'
6
+ # =========================================================================== #
7
+ module PdfParadise
8
+
9
+ # ========================================================================= #
10
+ # === HOME_DIRECTORY_OF_USER_X
11
+ # ========================================================================= #
12
+ if ENV['USERS']
13
+ HOME_DIRECTORY_OF_USER_X = ENV['USERS'].to_s+'/x/'
14
+ else
15
+ HOME_DIRECTORY_OF_USER_X = '/home/x/'
16
+ end
17
+
18
+ # ========================================================================= #
19
+ # === MAIN_PDF_YAML_FILE
20
+ # ========================================================================= #
21
+ MAIN_PDF_YAML_FILE =
22
+ "#{HOME_DIRECTORY_OF_USER_X}programming/ruby/src/roebe/lib/roebe/yaml/"\
23
+ "main_pdf.yml"
24
+
25
+ # ========================================================================= #
26
+ # === FILE_ALL_CURRENTLY_OPENED_PDF_FILES
27
+ # ========================================================================= #
28
+ FILE_ALL_CURRENTLY_OPENED_PDF_FILES =
29
+ '/home/Temp/all_currently_opened_pdf_files.md'
30
+
31
+ # ========================================================================= #
32
+ # === AUTOCONVERT_PDF_FILES_RESIDING_IN_THIS_DIRECTORY
33
+ # ========================================================================= #
34
+ AUTOCONVERT_PDF_FILES_RESIDING_IN_THIS_DIRECTORY = '/ingrid/pdf/'
35
+
36
+ # ========================================================================= #
37
+ # === PdfParadise.main_directory?
38
+ # ========================================================================= #
39
+ def self.main_directory?
40
+ AUTOCONVERT_PDF_FILES_RESIDING_IN_THIS_DIRECTORY
41
+ end
42
+
43
+ # ========================================================================= #
44
+ # === PdfParadise.file_main_pdf_yaml_file?
45
+ #
46
+ # This method will return a String such as
47
+ # '/home/x/programming/ruby/src/roebe/lib/roebe/yaml/main_pdf.yml'.
48
+ # ========================================================================= #
49
+ def self.file_main_pdf_yaml_file?
50
+ MAIN_PDF_YAML_FILE
51
+ end; self.instance_eval { alias file_pdf_viewer? file_main_pdf_yaml_file? } # === PdfParadise.file_pdf_viewer?
52
+
53
+ # ========================================================================= #
54
+ # === PdfParadise.file_working_on_these_pdf_files
55
+ #
56
+ # This method will return a String such as
57
+ # '/usr/lib/ruby/site_ruby/3.1.0/pdf_paradise/yaml/working_on_these_pdf_files.yml'.
58
+ # ========================================================================= #
59
+ def self.file_working_on_these_pdf_files
60
+ unless ::PdfParadise.respond_to?(:project_base_directory?)
61
+ require 'pdf_paradise/project/project.rb'
62
+ end
63
+ project_base_directory?+
64
+ 'yaml/working_on_these_pdf_files.yml'
65
+ end
66
+
67
+ # ========================================================================= #
68
+ # === PdfParadise.pdf_viewer?
69
+ #
70
+ # Use the default and registered .pdf viewer.
71
+ # ========================================================================= #
72
+ def self.pdf_viewer?(i = file_main_pdf_yaml_file?)
73
+ YAML.load_file(i)
74
+ end
75
+
76
+ end
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::ConvertTextToPdf
6
+ #
7
+ # Use this class to convert a text file to a .pdf file.
8
+ #
9
+ # Usage examples:
10
+ # PdfParadise::ConvertTextToPdf.new
11
+ # ============================================================================ #
12
+ require 'pdf_paradise/requires/colours.rb'
13
+
14
+ module PdfParadise
15
+
16
+ class ConvertTextToPdf # require 'convert_text_to_pdf'; ConvertTextToPdf.new
17
+
18
+ include Colours
19
+
20
+ # ========================================================================= #
21
+ # === FONT_FAMILY
22
+ # ========================================================================= #
23
+ FONT_FAMILY = 'Courier'
24
+
25
+ # ========================================================================= #
26
+ # === initialize
27
+ # ========================================================================= #
28
+ def initialize(
29
+ i = nil,
30
+ run_already = true
31
+ )
32
+ set_input(i)
33
+ reset
34
+ run if run_already
35
+ end
36
+
37
+ # ========================================================================= #
38
+ # === reset
39
+ # ========================================================================= #
40
+ def reset # reset tag
41
+ @font_family = FONT_FAMILY
42
+ end
43
+
44
+ # ========================================================================= #
45
+ # === set_input
46
+ # ========================================================================= #
47
+ def set_input(i = '')
48
+ i = i.first if i.is_a? Array
49
+ i = i.to_s.dup
50
+ @input = i
51
+ end
52
+
53
+ # ========================================================================= #
54
+ # === convert_this_text_file
55
+ #
56
+ # Use enscript to created a .ps file, and then ps2pdf
57
+ # (or ps2pdfwr) to convert to .pdf
58
+ #
59
+ # The following script creates a .pdf file with 10 pt
60
+ # left and right margins, and uses a courier font that
61
+ # is 7.3 pts wide and 10 pts high, so a 132 col printout
62
+ # fits on an 8 1/2 X 11 page. Use enscript to setup your
63
+ # page, fonts, etc.
64
+ # ========================================================================= #
65
+ def convert_this_text_file(i = @input)
66
+ if File.exist? i
67
+ _ 'enscript -B --margins=10:10: -o outputfile.ps -f '+
68
+ @font_family+'@7.3/10 '+i
69
+ _ 'ps2pdfwr outputfile.ps x.pdf'
70
+ else
71
+ e 'Sorry, there is no file at '+i+'.'
72
+ end
73
+ end
74
+
75
+ # ========================================================================= #
76
+ # === _
77
+ # ========================================================================= #
78
+ def _(i)
79
+ e i
80
+ system i
81
+ end
82
+
83
+ # ========================================================================= #
84
+ # === run
85
+ # ========================================================================= #
86
+ def run # (run tag)
87
+ convert_this_text_file
88
+ end
89
+
90
+ end; end
91
+
92
+ if __FILE__ == $PROGRAM_NAME
93
+ PdfParadise::ConvertTextToPdf.new(ARGV)
94
+ end # text_to_pdf
@@ -0,0 +1,17 @@
1
+ button {
2
+ border: 2px solid black;
3
+ }
4
+
5
+ .BG_yellow {
6
+ background-color: yellow;
7
+ }
8
+
9
+ .BG_floralwhite {
10
+ background-color: floralwhite;
11
+ }
12
+
13
+ scrolledwindow {
14
+ border: 1px solid black;
15
+ padding: 4px;
16
+ margin: 4px;
17
+ }
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::DjvuToPdf
6
+ #
7
+ # Convert a .djvu file to a .pdf file. This functionality depends on
8
+ # bin/ddjvu from the ddjvulibre package.
9
+ #
10
+ # Usage example:
11
+ # PdfParadise::DjvuToPdf.new
12
+ # =========================================================================== #
13
+ # require 'pdf_paradise/djvu_to_pdf.rb'
14
+ # =========================================================================== #
15
+ require 'pdf_paradise/base/base.rb'
16
+
17
+ module PdfParadise
18
+
19
+ class DjvuToPdf < Base # === PdfParadise::DjvuToPdf
20
+
21
+ # ========================================================================= #
22
+ # === initialize
23
+ # ========================================================================= #
24
+ def initialize(
25
+ commandline_arguments = nil,
26
+ run_already = true
27
+ )
28
+ reset
29
+ set_commandline_arguments(
30
+ commandline_arguments
31
+ )
32
+ run if run_already
33
+ end
34
+
35
+ # ========================================================================= #
36
+ # === reset (reset tag)
37
+ # ========================================================================= #
38
+ def reset
39
+ super()
40
+ end
41
+
42
+ # ========================================================================= #
43
+ # === set_input
44
+ # ========================================================================= #
45
+ def set_commandline_arguments(i = '')
46
+ i = [i].flatten.compact
47
+ @commandline_arguments = i
48
+ end
49
+
50
+ # ========================================================================= #
51
+ # === commandline_arguments?
52
+ # ========================================================================= #
53
+ def commandline_arguments?
54
+ @commandline_arguments
55
+ end
56
+
57
+ # ========================================================================= #
58
+ # === first_argument?
59
+ # ========================================================================= #
60
+ def first_argument?
61
+ @commandline_arguments.first
62
+ end
63
+
64
+ # ========================================================================= #
65
+ # === run (run tag)
66
+ # ========================================================================= #
67
+ def run
68
+ first = first_argument?
69
+ cmd = 'ddjvu -format=pdf -quality=85 -verbose '+first+' '+
70
+ first.sub(/#{File.extname(first)}$/, '')+'.pdf'
71
+ esystem cmd
72
+ end
73
+
74
+ # ========================================================================= #
75
+ # === PdfParadise::DjvuToPdf[]
76
+ # ========================================================================= #
77
+ def self.[](i = '')
78
+ self.new(i)
79
+ end
80
+
81
+ end; end
82
+
83
+ if __FILE__ == $PROGRAM_NAME
84
+ PdfParadise::DjvuToPdf.new(ARGV)
85
+ end # djvu_to_pdf
@@ -0,0 +1,6 @@
1
+ This directory will contain code that can be used for various GUI
2
+ bindings, in particular ruby-gtk2 bindings.
3
+
4
+ There will probably be only a very few GUIs, though.
5
+
6
+ The directory fox/ refers to the fxruby bindings to the FOX toolkit.
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::Gtk::SplitPdfFile
6
+ #
7
+ # This is a simple fox-GUI wrapper over the split-pdf functionality
8
+ # of the PdfParadise project.
9
+ #
10
+ # In FOX we can use FXHorizontalFrame for horizontal alignment and
11
+ # FXVerticalFrame for vertical alignment.
12
+ # =========================================================================== #
13
+ # require 'pdf_paradise/gui/fox/split_pdf_file.rb'
14
+ # =========================================================================== #
15
+ require 'pdf_paradise'
16
+ require 'fox16'
17
+
18
+ module PdfParadise
19
+
20
+ module FOX
21
+
22
+ class SplitPdfFile < Fox::FXMainWindow # === PdfParadise::FOX::SplitPdfFile
23
+
24
+ alias e puts
25
+
26
+ # ========================================================================= #
27
+ # === initialize
28
+ # ========================================================================= #
29
+ def initialize(i)
30
+ super(
31
+ i,
32
+ 'Split Pdf',
33
+ width: 500, height: 250
34
+ )
35
+ # ======================================================================= #
36
+ # Separator
37
+ # ======================================================================= #
38
+ Fox::FXVerticalSeparator.new(self,
39
+ Fox::LAYOUT_SIDE_RIGHT|Fox::LAYOUT_FILL_Y|Fox::SEPARATOR_GROOVE)
40
+ statusbar = Fox::FXStatusBar.new(self,
41
+ Fox::LAYOUT_SIDE_BOTTOM|Fox::LAYOUT_FILL_X|Fox::STATUSBAR_WITH_DRAGCORNER
42
+ )
43
+ buttons = Fox::FXHorizontalFrame.new(self, Fox::LAYOUT_SIDE_BOTTOM|Fox::LAYOUT_FILL_X|Fox::PACK_UNIFORM_WIDTH)
44
+ button2 = Fox::FXButton.new(buttons, 'Input the 1')
45
+ button2.connect(Fox::SEL_COMMAND) {|sender, selector, event|
46
+ e 'HMM'
47
+ }
48
+ button3 = Fox::FXButton.new(buttons, '2')
49
+ button4 = Fox::FXButton.new(buttons, '3')
50
+ end
51
+
52
+ # ========================================================================= #
53
+ # === create
54
+ # ========================================================================= #
55
+ def create
56
+ super
57
+ show(Fox::PLACEMENT_SCREEN)
58
+ end
59
+
60
+ end; end
61
+
62
+ # =========================================================================== #
63
+ # === PdfParadise.start_fox_gui
64
+ # =========================================================================== #
65
+ def self.start_fox_gui
66
+ Fox::FXApp.new { |app|
67
+ PdfParadise::FOX::SplitPdfFile.new(app)
68
+ app.create
69
+ app.run
70
+ }
71
+ end
72
+
73
+ end
74
+
75
+ if __FILE__ == $PROGRAM_NAME
76
+ PdfParadise.start_fox_gui
77
+ end # start_fox_gui
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::GUI::Gtk::DeleteTheFirstOrTheLastPageOfThisPdfFile
6
+ #
7
+ # This is a simple gtk-GUI wrapper over the remove-first-page and the
8
+ # remove-last-page functionality of the PdfParadise project. The
9
+ # main box is a VBox (vertical box).
10
+ # =========================================================================== #
11
+ # require 'pdf_paradise/gui/gtk2/remove_first_page_of_pdf_file.rb'
12
+ # PdfParadise.return_widget_remove_first_page_of_pdf_file
13
+ # PdfParadise.start_gtk_gui_remove_first_page_of_pdf_file
14
+ # =========================================================================== #
15
+ require 'gtk_paradise/require_gtk2'
16
+
17
+ module PdfParadise
18
+
19
+ module GUI
20
+
21
+ module Gtk
22
+
23
+ class DeleteTheFirstOrTheLastPageOfThisPdfFile < ::Gtk::VBox # === PdfParadise::GUI::Gtk::DeleteTheFirstOrTheLastPageOfThisPdfFile
24
+
25
+ require 'pdf_paradise/gui/shared_code/delete_the_first_or_the_last_page_of_this_pdf_file/delete_the_first_or_the_last_page_of_this_pdf_file_module.rb'
26
+ include ::PdfParadise::GUI::Gtk::DeleteTheFirstOrTheLastPageOfThisPdfFileModule
27
+
28
+ # ========================================================================= #
29
+ # === PdfParadise::GUI::Gtk::DeleteTheFirstOrTheLastPageOfThisPdfFile.run
30
+ # ========================================================================= #
31
+ def self.run
32
+ ::PdfParadise::GUI::Gtk::DeleteTheFirstOrTheLastPageOfThisPdfFileModule.run
33
+ end
34
+
35
+ end; end; end; end
36
+
37
+ if __FILE__ == $PROGRAM_NAME
38
+ PdfParadise.start_gtk_gui_remove_first_page_of_pdf_file
39
+ end
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::GUI::Gtk::PdfViewer
6
+ # =========================================================================== #
7
+ # require 'pdf_paradise/gui/gtk2/pdf_viewer/pdf_viewer.rb'
8
+ # PdfParadise::GUI::Gtk::PdfViewer.run
9
+ # =========================================================================== #
10
+ require 'gtk_paradise/require_gtk2'
11
+
12
+ module PdfParadise
13
+
14
+ module GUI
15
+
16
+ module Gtk
17
+
18
+ class PdfViewer < ::Gtk::VBox
19
+
20
+ require 'pdf_paradise/gui/shared_code/pdf_viewer/pdf_viewer_module.rb'
21
+ include ::PdfParadise::GUI::Gtk::PdfViewerModule
22
+
23
+ # ========================================================================= #
24
+ # === PdfParadise::GUI::Gtk::PdfViewer.run
25
+ # ========================================================================= #
26
+ def self.run
27
+ ::PdfParadise::GUI::Gtk::PdfViewerModule.run
28
+ end
29
+
30
+ end; end; end; end
31
+
32
+ if __FILE__ == $PROGRAM_NAME
33
+ PdfParadise::GUI::Gtk::PdfViewer.run
34
+ end
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::GUI::Gtk::SplitPdfFile
6
+ # =========================================================================== #
7
+ # require 'pdf_paradise/gui/gtk2/split_pdf_file/split_pdf_file.rb'
8
+ # PdfParadise::GUI::Gtk::SplitPdfFile.run
9
+ # =========================================================================== #
10
+ require 'gtk_paradise/require_gtk2'
11
+
12
+ module PdfParadise
13
+
14
+ module GUI
15
+
16
+ module Gtk
17
+
18
+ class SplitPdfFile < ::Gtk::VBox
19
+
20
+ require 'pdf_paradise/gui/shared_code/split_pdf_file/split_pdf_file_module.rb'
21
+ include ::PdfParadise::GUI::Gtk::SplitPdfFileModule
22
+
23
+ # ========================================================================= #
24
+ # === PdfParadise::GUI::Gtk::SplitPdfFile.run
25
+ # ========================================================================= #
26
+ def self.run
27
+ ::PdfParadise::GUI::Gtk::SplitPdfFileModule.run
28
+ end
29
+
30
+ end; end; end; end
31
+
32
+ if __FILE__ == $PROGRAM_NAME
33
+ PdfParadise::GUI::Gtk::SplitPdfFile.run
34
+ end
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === PdfParadise::GUI::Gtk::StatisticsWidget
6
+ # =========================================================================== #
7
+ # require 'pdf_paradise/gui/gtk2/statistics_widget/statistics_widget.rb'
8
+ # PdfParadise.return_widget_about_this_pdf_file
9
+ # =========================================================================== #
10
+ require 'gtk_paradise/require_gtk2.rb'
11
+
12
+ module PdfParadise
13
+
14
+ module GUI
15
+
16
+ module Gtk
17
+
18
+ class StatisticsWidget < ::Gtk::VBox # === PdfParadise::GUI::Gtk::StatisticsWidget
19
+
20
+ require 'pdf_paradise/gui/shared_code/statistics_widget/statistics_widget_module.rb'
21
+ include ::PdfParadise::GUI::Gtk::StatisticsWidgetModule
22
+
23
+ # ========================================================================= #
24
+ # === PdfParadise::GUI::Gtk::StatisticsWidget.run
25
+ # ========================================================================= #
26
+ def self.run
27
+ ::PdfParadise::GUI::Gtk::StatisticsWidgetModule.run
28
+ end
29
+
30
+ end; end; end; end
31
+
32
+ if __FILE__ == $PROGRAM_NAME
33
+ PdfParadise.start_gtk_gui_statistics_widget
34
+ end
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'pdf_paradise/toplevel_methods/to_pdf.rb'
6
+ # PdfParadise::Gtk::ToPdf
7
+ # =========================================================================== #
8
+ require 'gtk_paradise/require_gtk2'
9
+
10
+ module PdfParadise
11
+
12
+ module GUI
13
+
14
+ module Gtk
15
+
16
+ class ToPdf < ::Gtk::VBox # === PdfParadise::Gtk::ToPdf
17
+
18
+ require 'pdf_paradise/gui/shared_code/to_pdf/to_pdf_module.rb'
19
+ include ::PdfParadise::GUI::Gtk::ToPdfModule
20
+
21
+ # ========================================================================= #
22
+ # === PdfParadise::GUI::Gtk::ToPdf.run
23
+ # ========================================================================= #
24
+ def self.run
25
+ ::PdfParadise::GUI::Gtk::ToPdfModule.run
26
+ end
27
+
28
+ end; end; end; end
29
+
30
+ if __FILE__ == $PROGRAM_NAME
31
+ PdfParadise::GUI::Gtk::ToPdf.run
32
+ end