File tree Expand file tree Collapse file tree
AdvancedUsage/RenderingOptionsByFileType
RenderingLotusNotesDatabase Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Import modules
2+ require './Common.rb'
3+
4+ # This example demonstrates how to to filter Lotus Notes database messages
5+ class FilterMailStorage
6+ def self . Run ( )
7+ apiInstance = GroupDocsViewerCloud ::ViewApi . from_config ( $config)
8+ viewOptions = GroupDocsViewerCloud ::ViewOptions . new
9+ viewOptions . file_info = GroupDocsViewerCloud ::FileInfo . new
10+ viewOptions . file_info . file_path = "SampleFiles/sample.nsf"
11+ viewOptions . view_format = "HTML"
12+ viewOptions . render_options = GroupDocsViewerCloud ::HtmlOptions . new
13+ viewOptions . render_options . mail_storage_options = GroupDocsViewerCloud ::MailStorageOptions . new
14+ viewOptions . render_options . mail_storage_options . text_filter = "April 2015"
15+ viewOptions . render_options . mail_storage_options . address_filter = "test@test.com"
16+
17+ request = GroupDocsViewerCloud ::CreateViewRequest . new ( viewOptions )
18+ response = apiInstance . create_view ( request )
19+
20+ puts ( "FilterMailStorage completed: " + response . pages . length . to_s )
21+ end
22+ end
Original file line number Diff line number Diff line change 1+ # Import modules
2+ require './Common.rb'
3+
4+ # This example demonstrates how to render a text files using rows and pages restrictions
5+ class SpecifyMaxCharsAndRows
6+ def self . Run ( )
7+ apiInstance = GroupDocsViewerCloud ::ViewApi . from_config ( $config)
8+ viewOptions = GroupDocsViewerCloud ::ViewOptions . new
9+ viewOptions . file_info = GroupDocsViewerCloud ::FileInfo . new
10+ viewOptions . file_info . file_path = "SampleFiles/sample.txt"
11+ viewOptions . view_format = "HTML"
12+ viewOptions . render_options = GroupDocsViewerCloud ::HtmlOptions . new
13+ viewOptions . render_options . text_options = GroupDocsViewerCloud ::TextOptions . new
14+ viewOptions . render_options . text_options . max_chars_per_row = 100
15+ viewOptions . render_options . text_options . max_rows_per_page = 100
16+
17+ request = GroupDocsViewerCloud ::CreateViewRequest . new ( viewOptions )
18+ response = apiInstance . create_view ( request )
19+
20+ puts ( "SpecifyMaxCharsAndRows completed: " + response . pages . length . to_s )
21+ end
22+ end
Original file line number Diff line number Diff line change 1+ # Import modules
2+ require './Common.rb'
3+
4+ # This example demonstrates how to render Visio documents figures
5+ class RenderVisioDocumentFigures
6+ def self . Run ( )
7+ apiInstance = GroupDocsViewerCloud ::ViewApi . from_config ( $config)
8+ viewOptions = GroupDocsViewerCloud ::ViewOptions . new
9+ viewOptions . file_info = GroupDocsViewerCloud ::FileInfo . new
10+ viewOptions . file_info . file_path = "SampleFiles/sample.vssx"
11+ viewOptions . view_format = "PNG"
12+ viewOptions . render_options = GroupDocsViewerCloud ::ImageOptions . new
13+ viewOptions . render_options . visio_rendering_options = GroupDocsViewerCloud ::VisioRenderingOptions . new
14+ viewOptions . render_options . visio_rendering_options . render_figures_only = true
15+ viewOptions . render_options . visio_rendering_options . figure_width = 250
16+
17+ request = GroupDocsViewerCloud ::CreateViewRequest . new ( viewOptions )
18+ response = apiInstance . create_view ( request )
19+
20+ puts ( "RenderVisioDocumentFigures completed: " + response . pages . length . to_s )
21+ end
22+ end
Original file line number Diff line number Diff line change 1+ # Import modules
2+ require './Common.rb'
3+
4+ # This example demonstrates how to set output image size limits when rendering single image to PDF/HTML.
5+ class HtmlViewerLimitImageSize
6+ def self . Run ( )
7+ apiInstance = GroupDocsViewerCloud ::ViewApi . from_config ( $config)
8+ viewOptions = GroupDocsViewerCloud ::ViewOptions . new
9+ viewOptions . file_info = GroupDocsViewerCloud ::FileInfo . new
10+ viewOptions . file_info . file_path = "SampleFiles/sample.jpg"
11+ viewOptions . view_format = "HTML"
12+ viewOptions . render_options = GroupDocsViewerCloud ::HtmlOptions . new
13+ viewOptions . render_options . image_max_width = 800
14+ viewOptions . render_options . image_max_height = 800
15+
16+ request = GroupDocsViewerCloud ::CreateViewRequest . new ( viewOptions )
17+ response = apiInstance . create_view ( request )
18+
19+ puts ( "HtmlViewerLimitImageSize completed: " + response . pages . length . to_s )
20+ end
21+ end
Original file line number Diff line number Diff line change 1+ # Import modules
2+ require './Common.rb'
3+
4+ # This example demonstrates how to optimize output HTML for printing
5+ class HtmlViewerOptimizeForPrinting
6+ def self . Run ( )
7+ apiInstance = GroupDocsViewerCloud ::ViewApi . from_config ( $config)
8+ viewOptions = GroupDocsViewerCloud ::ViewOptions . new
9+ viewOptions . file_info = GroupDocsViewerCloud ::FileInfo . new
10+ viewOptions . file_info . file_path = "SampleFiles/sample.docx"
11+ viewOptions . view_format = "HTML"
12+ viewOptions . render_options = GroupDocsViewerCloud ::HtmlOptions . new
13+ viewOptions . render_options . for_printing = true
14+
15+ request = GroupDocsViewerCloud ::CreateViewRequest . new ( viewOptions )
16+ response = apiInstance . create_view ( request )
17+
18+ puts ( "HtmlViewerOptimizeForPrinting completed: " + response . pages . length . to_s )
19+ end
20+ end
You can’t perform that action at this time.
0 commit comments