tencent cloud

masukan

Configuration Item Description

Terakhir diperbarui:2022-10-26 15:23:05

    Display Mode

    Enable different display modes by initializing the configuration option class:

    var demo = COSDocPreviewSDK.config({
       mode: 'normal', 
    })
    

    The configuration options are as described below:

    mode Value Description Default Option
    normal Normal mode, with all functional UIs shown Yes
    simple Simple mode, with no header and toolbar shown No

    Custom Configuration Options

    When initializing the JS-SDK, by configuring different options for different types of files, you can enable or disable specific configurations in a file and control its status when it is opened.

    COSDocPreviewSDK.config({
       // Common option, which is applicable to all types of files.
       commonOptions: {
         isShowTopArea: false, // Hide the top area (header and toolbar).
         isShowHeader: false // Hide the header area.
        },
       // Word file configurations.
       wordOptions: {
         isShowDocMap: false,
         isBestScale: true
       },
       // PDF file configurations.
       pdfOptions: {
         isShowComment: true,
         isInSafeMode: false
       },
       // Presentation file configurations.
       pptOptions: {
         isShowBottomStatusBar: true
       }
    })
    
    • Common configuration items: commonOptions
      Configuration ItemDescriptionDefault Value
      isShowTopAreaWhether to show the top area (header and toolbar)false
      isShowHeaderWhether to show the header areafalse
      isBrowserViewFullscreenWhether to enable full screen mode in the browser areafalse
      isIframeViewFullscreenWhether to enable full screen mode in the iframe areafalse
    • Text file configuration items: wordOptions
      Configuration ItemDescriptionDefault Value
      isShowDocMapWhether to enable the directory feature, which is enabled by default.true
      isBestScaleWhether to display the file at the best scale by default (for PC) when the file is openedtrue
      isShowBottomStatusBarWhether to show the bottom status bar (for PC)false
    • PDF file configuration items: pdfOptions
      Configuration ItemDescriptionDefault Value
      isShowCommentWhether to show annotations, which are shown by default.true
      isInSafeModeWhether to enable the safe mode (text cannot be selected or copied and links cannot be opened). It is disabled by default.false
      isShowBottomStatusBarWhether to show the bottom status bar (for PC)false
    • Presentation file configuration items: pptOptions
      Configuration ItemDescriptionDefault Value
      isShowBottomStatusBarWhether to show the bottom status bar (for PC)false

    Component Status Settings

    Page components can be hidden or disabled through the commandBars option.

    COSDocPreviewSDK.config({
      // Common option, which is applicable to all types of files.
      commandBars: [
        {
          cmbId: 'Print', // Component ID
          attributes: {
            visible: false, // Whether to show the component. Valid values: `false` (no), `true` (yes). Default value: `true`.
            enable: false, // Whether to enable the component. Default value: `true`.
          },
        },
      ]
    })
    

    The list of currently available components is as follows:

    Component IDDescriptionScope of Application
    PrintPrint feature and the Ctrl + P shortcut for printAll files
    MobileHeaderTop toolbar in the clientAll files
    WriterHoverToolbarsBottom toolbar in the clientWord files
    DownloadImgDownload icon when the image is double-clickedPresentation files
    PlayComponentToolbarToolbar in the top-right corner when in full screen modePresentation files
    PlayContextCheckImageRight click during playback - View original imagePresentation files
    FloatMenuCheckImageFloating menu bar when the image is selected - View original imagePresentation files
    WPPMobileCommentButtonComment button on the bottom toolbar in the clientPresentation files
    PDFMobilePageBarPage number in the clientPDF files
    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24