def Run(self):
        # Create instance of the API
        api = Common_Utilities.Get_ViewApi_Instance()

        try:
            viewOptions = groupdocs_viewer_cloud.ViewOptions()

            fileInfo = groupdocs_viewer_cloud.FileInfo()
            fileInfo.file_path = "viewerdocs\\three-layouts.dwf"
            fileInfo.password = ""
            fileInfo.storage_name = Common_Utilities.myStorage

            viewOptions.file_info = fileInfo

            renderOptions = groupdocs_viewer_cloud.HtmlOptions()
            renderOptions.external_resources = True

            viewOptions.render_options = renderOptions

            request = groupdocs_viewer_cloud.CreateViewRequest(viewOptions)
            response = api.create_view(request)

            print("Expected response type is ViewResult: " + str(response))
        except groupdocs_viewer_cloud.ApiException as e:
            print("Exception while calling API: {0}".format(e.message))
    def Run(self):
        # Create instance of the API
        api = Common_Utilities.Get_InfoApi_Instance()

        try:
            viewOptions = groupdocs_viewer_cloud.ViewOptions()

            fileInfo = groupdocs_viewer_cloud.FileInfo()
            fileInfo.file_path = "viewerdocs\\three-layouts.dwf"
            fileInfo.password = ""
            fileInfo.storage_name = Common_Utilities.myStorage

            viewOptions.file_info = fileInfo

            renderOptions = groupdocs_viewer_cloud.ImageOptions()
            renderOptions.extract_text = True

            viewOptions.render_options = renderOptions
            viewOptions.view_format = "PNG"

            request = groupdocs_viewer_cloud.GetInfoRequest(viewOptions)
            response = api.get_info(request)

            print("Expected response type is InfoResult: " + str(response))
        except groupdocs_viewer_cloud.ApiException as e:
            print("Exception while calling API: {0}".format(e.message))
Esempio n. 3
0
    def Run(self):
        # Create instance of the API
        api = Common_Utilities.Get_ViewApi_Instance()

        try:
            viewOptions = groupdocs_viewer_cloud.ViewOptions()

            fileInfo = groupdocs_viewer_cloud.FileInfo()
            fileInfo.file_path = "viewerdocs\\with-hidden-rows-and-columns.xlsx"
            fileInfo.password = ""
            fileInfo.storage_name = Common_Utilities.myStorage

            viewOptions.file_info = fileInfo

            renderOptions = groupdocs_viewer_cloud.RenderOptions()

            spreadsheetOptions = groupdocs_viewer_cloud.SpreadsheetOptions()
            spreadsheetOptions.paginate_sheets = True
            spreadsheetOptions.count_rows_per_page = 5

            renderOptions.spreadsheet_options = spreadsheetOptions
            viewOptions.render_options = renderOptions

            renderOptions.spreadsheet_options = spreadsheetOptions
            viewOptions.render_options = renderOptions

            request = groupdocs_viewer_cloud.CreateViewRequest(viewOptions)
            response = api.create_view(request)

            print("Expected response type is ViewResult: " + str(response))
        except groupdocs_viewer_cloud.ApiException as e:
            print("Exception while calling API: {0}".format(e.message))
    def Run(self):
        # Create instance of the API
        api = Common_Utilities.Get_ViewApi_Instance()
        
        try:
            viewOptions = groupdocs_viewer_cloud.ViewOptions()

            fileInfo = groupdocs_viewer_cloud.FileInfo()
            fileInfo.file_path = "viewerdocs\\sample.mpp"
            fileInfo.password = ""
            fileInfo.storage_name = Common_Utilities.myStorage
        
            viewOptions.file_info = fileInfo;
            
            renderOptions = groupdocs_viewer_cloud.RenderOptions()

            projectManagementOptions = groupdocs_viewer_cloud.ProjectManagementOptions()
            projectManagementOptions.page_size = "Unknown"
            projectManagementOptions.time_unit = "Months"
            projectManagementOptions.start_date = "2008/07/01"
            projectManagementOptions.end_date = "2008/07/31"
        
            renderOptions.project_management_options = projectManagementOptions
            viewOptions.render_options = renderOptions
        
            request = groupdocs_viewer_cloud.CreateViewRequest(viewOptions)
            response = api.create_view(request)
        
            print("Expected response type is ViewResult: " + str(response))
        except groupdocs_viewer_cloud.ApiException as e:
            print("Exception while calling API: {0}".format(e.message))
    def Run(self):
        # Create instance of the API
        api = Common_Utilities.Get_ViewApi_Instance()
        
        try:
            viewOptions = groupdocs_viewer_cloud.ViewOptions()

            fileInfo = groupdocs_viewer_cloud.FileInfo()
            fileInfo.file_path = "viewerdocs\\four-pages.docx"
            fileInfo.password = ""
            fileInfo.storage_name = Common_Utilities.myStorage
        
            viewOptions.file_info = fileInfo;
            
            renderOptions = groupdocs_viewer_cloud.RenderOptions()        
            renderOptions.start_page_number = 2
            renderOptions.count_pages_to_render = 2
    
            viewOptions.render_options = renderOptions
        
            request = groupdocs_viewer_cloud.CreateViewRequest(viewOptions)
            response = api.create_view(request)
        
            print("Expected response type is ViewResult: " + str(response))
        except groupdocs_viewer_cloud.ApiException as e:
            print("Exception while calling API: {0}".format(e.message))
    def Run(cls):
        infoApi = groupdocs_viewer_cloud.InfoApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.docx"

        request = groupdocs_viewer_cloud.GetInfoRequest(view_options)
        result = infoApi.get_info(request)
        print("GetDocumentInformation completed: " + str(len(result.pages)))
Esempio n. 7
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_attachments.msg"
        view_options.view_format = "HTML"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("GetAttachments completed: " + str(len(response.attachments)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/password_protected.docx"
        view_options.file_info.password = "******"
        view_options.view_format = "HTML"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("ViewProtectedDocument completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/shift_jis_encoded.txt"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()        
        view_options.render_options.default_encoding = "shift_jis"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("SpecifyEncoding completed: " + str(len(response.pages)))
Esempio n. 10
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.docx"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.pages_to_render = [2, 3]

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("RenderSelectedPages completed: " + str(len(response.pages)))
Esempio n. 11
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.jpg"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.image_max_width = 800
        view_options.render_options.image_max_height = 600

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("HtmlViewerLimitImageSize completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_missing_font.pptx"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.default_font_name = "Courier New"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("ReplaceMissingFont completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_jpg_image.pptx"
        view_options.view_format = "PDF"
        view_options.render_options = groupdocs_viewer_cloud.PdfOptions()
        view_options.render_options.jpg_quality = 50

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("PdfViewerAdjustJpgQuality completed: " + response.file.path)
Esempio n. 14
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.docx"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.fonts_to_exclude = ["Times New Roman"]

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("HtmlViewerExcludeFonts completed: " + str(len(response.pages)))
Esempio n. 15
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_missing_font.odg"
        view_options.view_format = "HTML"
        # NOTE: Upload fonts to the folder using storage API before rendering
        view_options.fonts_path = "Fonts"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("RenderWithCustomFonts completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_tracked_changes.docx"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.word_processing_options = groupdocs_viewer_cloud.WordProcessingOptions()    
        view_options.render_options.word_processing_options.render_tracked_changes = True

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("RenderTrackedChanges completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.InfoApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_layers_and_layouts.dwg"
        view_options.view_format = "HTML"

        request = groupdocs_viewer_cloud.GetInfoRequest(view_options)
        response = apiInstance.get_info(request)
        print(" Layers count: " + str(len(response.cad_view_info.layers)))
        print(" Layouts count: " + str(len(response.cad_view_info.layouts)))
        print("GetInfoForCadDrawing completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_folders.zip"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.archive_options = groupdocs_viewer_cloud.ArchiveOptions()
        view_options.render_options.archive_options.folder = "ThirdFolderWithItems"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("RenderArchiveFolder completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_hidden_page.pptx"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.render_hidden_pages = True

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("RenderHiddenPages completed: " + str(len(response.pages)))
Esempio n. 20
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.docx"
        view_options.view_format = "HTML"
        view_options.watermark = groupdocs_viewer_cloud.Watermark()
        view_options.watermark.text = "This is a watermark"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("AddWatermark completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.InfoApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.pdf"
        view_options.view_format = "HTML"

        request = groupdocs_viewer_cloud.GetInfoRequest(view_options)
        response = apiInstance.get_info(request)
        print(" PrintingAllowed: " +
              str(response.pdf_view_info.printing_allowed))
        print("GetInfoForPdfFile completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.InfoApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.ost"
        view_options.view_format = "HTML"

        request = groupdocs_viewer_cloud.GetInfoRequest(view_options)
        response = apiInstance.get_info(request)
        print(" Folders count: " +
              str(len(response.outlook_view_info.folders)))
        print("GetInfoForOutlookDataFile completed: " +
              str(len(response.pages)))
Esempio n. 23
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.docx"
        view_options.view_format = "PNG"
        view_options.render_options = groupdocs_viewer_cloud.ImageOptions()
        view_options.render_options.extract_text = True

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("ImageViewerAddTextOverlay completed: " +
              str(len(response.pages)))
Esempio n. 24
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.docx"
        view_options.view_format = "JPG"
        view_options.render_options = groupdocs_viewer_cloud.ImageOptions()
        view_options.render_options.jpeg_quality = 50

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("ImageViewerAdjustJpgQuality completed: " +
              str(len(response.pages)))
Esempio n. 25
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.txt"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.text_options = groupdocs_viewer_cloud.TextOptions()    
        view_options.render_options.text_options.max_chars_per_row = 100
        view_options.render_options.text_options.max_rows_per_page = 100

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("SpecifyMaxCharsAndRows completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.InfoApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/with_folders.zip"
        view_options.view_format = "HTML"

        request = groupdocs_viewer_cloud.GetInfoRequest(view_options)
        response = apiInstance.get_info(request)
        folders = response.archive_view_info.folders
        for folder in folders:
            print(folder)
        print("GetInfoForArchiveFile completed: " + str(len(response.pages)))
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.msg"
        view_options.view_format = "PDF"
        view_options.render_options = groupdocs_viewer_cloud.PdfOptions()
        view_options.render_options.email_options = groupdocs_viewer_cloud.EmailOptions(
        )
        view_options.render_options.email_options.page_size = "A4"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("AdjustPageSize completed: " + response.file.path)
Esempio n. 28
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.docx"
        view_options.view_format = "PDF"
        view_options.render_options = groupdocs_viewer_cloud.PdfOptions()
        view_options.render_options.permissions = ["DenyModification"]
        view_options.render_options.permissions_password = "******"
        view_options.render_options.document_open_password = "******"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("PdfViewerProtectPdf completed: " + response.file.path)
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.InfoApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.mpp"
        view_options.view_format = "HTML"

        request = groupdocs_viewer_cloud.GetInfoRequest(view_options)
        response = apiInstance.get_info(request)
        print(" Start date: " +
              str(response.project_management_view_info.start_date))
        print(" End date: " +
              str(response.project_management_view_info.end_date))
        print("GetInfoForProjectFile completed: " + str(len(response.pages)))
Esempio n. 30
0
    def Run(cls):
        apiInstance = groupdocs_viewer_cloud.ViewApi.from_config(
            Common.GetConfig())
        view_options = groupdocs_viewer_cloud.ViewOptions()
        view_options.file_info = groupdocs_viewer_cloud.FileInfo()
        view_options.file_info.file_path = "SampleFiles/sample.mpp"
        view_options.view_format = "HTML"
        view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
        view_options.render_options.project_management_options = groupdocs_viewer_cloud.ProjectManagementOptions(
        )
        view_options.render_options.project_management_options.time_unit = "Days"

        request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
        response = apiInstance.create_view(request)
        print("AdjustTimeUnit completed: " + str(len(response.pages)))