Cobrowse.io Docs
  • Getting started
  • SDK Installation
    • Web
    • iOS
    • Android
    • React Native
    • Flutter
    • .NET Mobile
    • macOS
    • Windows
  • SDK Features
    • Account config
    • Identify your devices
    • Use 6-digit codes
    • Redact sensitive data
    • Viewing PDFs
    • Universal Cobrowse
    • Customize the interface
      • Active session controls
      • 6-digit code screen
      • User consent dialog
      • Remote control consent dialog
      • Full device consent dialog
      • Localization / translation
    • Initiate sessions with push
    • Listening for events
    • Full device capabilities
      • Full device screen sharing
      • Full device remote control
      • Managing full device mode
    • Advanced configuration
      • Starting and stopping the SDK
      • Declaring capabilities
      • Intercepting mobile SDK network requests
      • Web
        • IFrames support
        • IE 11 polyfills
        • Cross-domain session support
        • Ignore Views
      • iOS
        • Alternate render method
        • Custom touch handling
      • Android
        • Backporting TLS to older Android versions
  • Agent-side integrations
    • Agent-side overview
    • Platform integrations
      • Zendesk
      • Salesforce
        • Migrating from legacy to v2
        • Salesforce (Legacy)
      • Genesys
        • Genesys Cloud
        • Engage Workspace Web Edition (WWE)
        • Engage Workspace Desktop Edition (WDE)
      • Intercom
      • Freshworks
      • Talkdesk
      • NICE
    • Custom integrations
    • Agent SDK
      • API Reference
      • Sample code snippets
    • Authentication (JWTs)
      • JWT Policies
    • Authentication (SAML 2.0)
    • IFrame embeds
  • Enterprise self-hosting
    • Self-hosting overview
    • Docker Compose
    • Helm chart
      • Image Pull Secret
      • Environment Variables
      • Optional recording components
      • Pod Annotations
    • AWS terraform
      • AWS metrics configuration
    • Azure terraform
      • Azure metrics configuration
    • GCP terraform
      • GCP metrics configuration
    • Sizing guidelines
    • Running your instance
      • Adding a superuser
      • Limiting account creation
      • Limiting magic link recipients
      • Configuring SMTP
      • Managing your deployment
    • Monitoring your instance
      • Available metrics
      • Self-Hosted Prometheus
    • Advanced configuration
      • Air gap configuration
      • Pin web SDK version
      • L7 firewall configuration
      • Docker proxy configuration
    • Troubleshooting
Powered by GitBook
On this page

Was this helpful?

  1. SDK Features

Viewing PDFs

Ensure a seamless experience when viewing PDF documents.

PreviousRedact sensitive dataNextUniversal Cobrowse

Last updated 9 months ago

Was this helpful?

If you offer PDF documents on your website and want to include them in your Cobrowse sessions you just need to enable the PDF viewing feature on the Cobrowse SDK.

With this feature enabled an embedded viewer will load the documents directly into the browser without requiring downloads or the full device mode.

Configuration

// links in your website ending with the .pdf extension
CobrowseIO.pdfLinks = ['*.pdf']

// links to the example.com domain with the path starting with /assets/pdfs/
CobrowseIO.pdfLinks = ['https://example.com/assets/pdfs/*']

// links to any domain with /pdfs/ as part of the path and the .pdf extension
CobrowseIO.pdfLinks = ['*/pdfs/*.pdf']
// links in your website ending with the .pdf extension
CobrowseIO.pdfLinks = [/.*\.pdf/]

// links to the example.com domain with the path starting with /assets/pdfs/
CobrowseIO.pdfLinks = [/https\:\/\/example\.com\/assets\/pdfs\/.*\.pdf/]

// links to any domain with /pdfs/ as part of the path and the .pdf extension
CobrowseIO.pdfLinks = [/.*\/pdfs\/.*\.pdf/]

The pdfLinks property is an array which will accept either of these formats.

The PDF Viewer functionality is configured with URLs of the PDFs as they are linked on your website. To make it simpler to configure this be done using with which you can use to match different patterns:

the same can be achieved using :

glob patterns
Javascript RegExp