Viewer Options

const config = {
documentId: 'your-document-number',
darkMode: true,
themeColor: '#FF0000',
initialMaxWidth: 800,
appBarColored: true
};
CloudPDF(config, document.getElementById('viewer')).then((instance) => {});
  • documentId After you upload your document to CloudPDF you will receive a documentId. How to upload a document?
  • darkMode Default: false You can set the viewer to light or dark mode by changing this variable to true or false
  • themeColor Set hex color for example "#FF0000"
  • initialMaxWidth Set initial max width of the document for example if you don't want the inial page width to be bigger than 800 pixels you can set it to 800
  • appBarColored Default: false if set to true the toolbar of the PDF viewer will be coloured
  • token (optional) If the document is public you don't have to add a security token. By default the document is private and you will have to generate a token.