Skip to main content
PDF Viewer - Configuration API

This article list all available configuration for PDF viewer.

Updated over a month ago
$w("#pdfViewer1").setConfiguration(options)
{
name: '',
pages: [],
tableOfContent: [],
tableOfContentCloseOnClick: true,
thumbsCloseOnClick: true,
deeplinkingEnabled: false,
deeplinkingPrefix: '',
assets: {
preloader: '../assets/images/preloader.jpg',
flipMp3: '../assets/mp3/turnPage.mp3',
spinner: '../assets/images/spinner.gif',
backgroundMp3: '../assets/mp3/background.mp3',
},
pdfUrl: null,
pdfBrowserViewerIfMobile: false,
pdfBrowserViewerIfIE: false,
pdfBrowserViewerFullscreen: true,
pdfBrowserViewerFullscreenTarget: '_blank',
rangeChunkSize: 64,
disableRange: false,
disableStream: true,
disableAutoFetch: true,
pdfAutoLinks: false,
htmlLayer: true,
rightToLeft: false,
startPage: 0,
sound: true,
backgroundColor: 'rgb(81, 85, 88)',
backgroundImage: '',
backgroundPattern: '',
backgroundTransparent: false,
thumbSize: 130,
loadAllPages: false,
loadPagesF: 2,
loadPagesB: 1,
autoplayOnStart: false,
autoplayInterval: 3000,
autoplayLoop: true,
skin: 'light',
layout: '3',
menuOverBook: false,
menuFloating: false,
menuBackground: '',
menuShadow: '',
menuMargin: 0,
menuPadding: 0,
menuTransparent: false,
menu2OverBook: true,
menu2Floating: false,
menu2Background: '',
menu2Shadow: '',
menu2Margin: 0,
menu2Padding: 0,
menu2Transparent: true,
skinColor: '',
skinBackground: '',
btnColor: '',
btnBackground: 'none',
btnSize: 18,
btnRadius: 2,
btnMargin: 2,
btnPaddingV: 10,
btnPaddingH: 10,
btnShadow: '',
btnTextShadow: '',
btnBorder: '',
btnColorHover: '',
btnBackgroundHover: '',
sideBtnColor: '#FFF',
sideBtnBackground: '#00000033',
sideBtnSize: 25,
sideBtnRadius: 0,
sideBtnMargin: 0,
sideBtnPaddingV: 10,
sideBtnPaddingH: 10,
sideBtnShadow: '',
sideBtnTextShadow: '',
sideBtnBorder: '',
sideBtnColorHover: '#FFF',
sideBtnBackgroundHover: '#00000066',
floatingBtnColor: '#EEE',
floatingBtnColorHover: '',
floatingBtnBackground: '#00000044',
floatingBtnBackgroundHover: '',
floatingBtnSize: null,
floatingBtnRadius: null,
floatingBtnMargin: null,
floatingBtnPadding: null,
floatingBtnShadow: '',
floatingBtnTextShadow: '',
floatingBtnBorder: '',
btnOrder: [
'currentPage',
'search',
'btnFirst',
'btnPrev',
'btnNext',

'btnLast',
'btnZoomIn',
'btnZoomOut',
'btnRotateLeft',
'btnRotateRight',
'btnAutoplay',
'btnSearch',
'btnSelect',
'btnBookmark',
'btnNotes',
'btnToc',
'btnThumbs',
'btnShare',
'btnPrint',
'btnDownloadPages',
'btnDownloadPdf',
'btnSound',
'btnExpand',

'btnClose',
],
currentPage: {
enabled: true,
title: 'Current page',
vAlign: 'top',
hAlign: 'left',
marginH: 0,
marginV: 0,
color: '',
background: '',
},
search: {
enabled: false,
},
btnFirst: {
enabled: false,
title: 'First page',
svg: 'last',
iconReverse: true,
},
btnPrev: {
enabled: true,
title: 'Previous page',
svg: 'next',
iconReverse: true,
},
btnNext: {
enabled: true,
title: 'Next page',
},
btnLast: {
enabled: false,
title: 'Last page',
},
btnZoomIn: {
enabled: true,
title: 'Zoom in',
svg: 'plus',
},
btnZoomOut: {
enabled: true,
title: 'Zoom out',
svg: 'minus',
},
btnRotateLeft: {
enabled: false,
title: 'Rotate left',
},
btnRotateRight: {
enabled: false,
title: 'Rotate right',
},
btnAutoplay: {
enabled: true,
title: 'Autoplay',
svg: 'play',
svgAlt: 'pause',
},
btnSearch: {
enabled: false,
title: 'Search',
},
btnSelect: {
enabled: true,
title: 'Select tool',
},
btnBookmark: {
enabled: true,
title: 'Bookmark',
},
btnNotes: {
enabled: false,
title: 'Notes',
},
btnToc: {
enabled: true,
title: 'Table of Contents',
svg: 'list',
},
btnThumbs: {
enabled: true,
title: 'Pages',
},
btnShare: {
enabled: true,
title: 'Share',
hideOnMobile: true,
},
btnPrint: {
enabled: true,
title: 'Print',
hideOnMobile: true,
},
btnDownloadPages: {
enabled: true,
title: 'Download pages',
url: 'images/pages.zip',
name: 'allPages.zip',
svg: 'download',
},
btnDownloadPdf: {
forceDownload: false,
enabled: true,
title: 'Download PDF',
url: null,
openInNewWindow: true,
name: 'allPages.pdf',
svg: 'pdf',
},
btnSound: {
enabled: true,
title: 'Volume',
hideOnMobile: true,
svgAlt: 'mute',
},
btnExpand: {
enabled: true,
title: 'Toggle fullscreen',
svgAlt: 'compress',
},
btnClose: {
title: 'Close',
hAlign: 'right',
vAlign: 'top',
size: 20,
},
btnShareIfMobile: false,
btnSoundIfMobile: false,
btnPrintIfMobile: false,
sideNavigationButtons: true,
hideMenu: false,
shareUrl: null,
shareTitle: null,
shareImage: null,
whatsapp: {
enabled: true,
},
twitter: {
enabled: true,
},
facebook: {
enabled: true,
},
pinterest: {
enabled: true,
},
email: {
enabled: true,
},
linkedin: {
enabled: true,
},
digg: {
enabled: false,
},
reddit: {
enabled: false,
},
pdf: {
annotationLayer: false,
},
pageTextureSize: 2048,
pageTextureSizeSmall: 1500,
thumbTextureSize: 300,
pageTextureSizeMobile: 1500,
pageTextureSizeMobileSmall: 1024,
viewMode: 'webgl',
singlePageMode: false,
singlePageModeIfMobile: false,
zoomMin: 0.95,
zoomMin2: 0.15,
zoomMax2: null,
zoomSize: null,
zoomStep: 2,
zoomTime: 300,
zoomReset: false,
zoomResetTime: 300,
wheelDisabledNotFullscreen: false,
arrowsDisabledNotFullscreen: false,
arrowsAlwaysEnabledForNavigation: true,
responsiveView: true,
responsiveViewRatio: 1,
responsiveViewTreshold: 768,
minPixelRatio: 1,
pageFlipDuration: 1,
contentOnStart: false,
thumbnailsOnStart: false,
searchOnStart: false,
sideMenuOverBook: true,
sideMenuOverMenu: false,
sideMenuOverMenu2: true,
sideMenuPosition: 'left',
lightBox: false,
lightBoxOpened: false,
lightBoxFullscreen: false,
lightboxCloseOnClick: false,
lightboxResetOnOpen: true,
lightboxBackground: null,
lightboxBackgroundColor: null,
lightboxBackgroundPattern: null,
lightboxBackgroundImage: null,
lightboxStartPage: null,
lightboxMarginV: '0',
lightboxMarginH: '0',
lightboxCSS: '',
lightboxPreload: false,
lightboxShowMenu: false,
lightboxCloseOnBack: true,
disableImageResize: true,
pan: 0,
panMax: 10,
panMax2: 2,
panMin: -10,
panMin2: -2,
tilt: 0,
tiltMax: 0,
tiltMax2: 0,
tiltMin: 0,
tiltMin2: -5,
rotateCameraOnMouseMove: false,
rotateCameraOnMouseDrag: true,
lights: true,
lightColor: 0xffffff,
lightPositionX: 0,
lightPositionZ: 1400,
lightPositionY: 350,
lightIntensity: 0.6,
shadows: true,
shadowMapSize: 1024,
shadowOpacity: 0.2,
shadowDistance: 0,
pageRoughness: 1,
pageMetalness: 0,
pageHardness: 2,
coverHardness: 2,
pageSegmentsW: 10,
pageSegmentsH: 1,
pageMiddleShadowSize: 2,
pageMiddleShadowColorL: '#999999',
pageMiddleShadowColorR: '#777777',
antialias: false,
preloaderText: '',
fillPreloader: {
enabled: false,
imgEmpty: 'images/logo_light.png',
imgFull: 'images/logo_dark.png',
},
logoImg: '',
logoUrl: '',
logoCSS: 'position:absolute;',
logoHideOnMobile: false,
printMenu: true,
downloadMenu: true,
cover: true,
backCover: true,
pdfTextLayer: true,
annotationLayer: true,
googleAnalyticsTrackingCode: null,
minimumAndroidVersion: 6,
linkColor: 'rgba(0, 0, 0, 0)',
linkColorHover: 'rgba(255, 255, 0, 1)',
linkOpacity: 0.4,
linkTarget: '_blank',
rightClickEnabled: true,
pageNumberOffset: 0,
flipSound: true,
backgroundMusic: false,
doubleClickZoomDisabled: false,
pageDragDisabled: false,
pageClickAreaWdith: '10%',
noteTypes: [
{ id: 1, title: 'User', color: 'green', enabled: true },
{ id: 2, title: 'Group', color: 'yellow', enabled: true },
{ id: 3, title: 'Admin', color: 'blue', enabled: true },
],
pageRangeStart: null,
pageRangeEnd: null,
strings: {
print: 'Print',
printLeftPage: 'Print left page',
printRightPage: 'Print right page',
printCurrentPage: 'Print current page',
printAllPages: 'Print all pages',
download: 'Download',
downloadLeftPage: 'Download left page',
downloadRightPage: 'Download right page',
downloadCurrentPage: 'Download current page',
downloadAllPages: 'Download all pages',
bookmarks: 'Bookmarks',
bookmarkLeftPage: 'Bookmark left page',
bookmarkRightPage: 'Bookmark right page',
bookmarkCurrentPage: 'Bookmark current page',
search: 'Search',
findInDocument: 'Find in document',
pagesFoundContaining: 'pages found containing',
noMatches: 'No matches',
matchesFound: 'matches found',
page: 'Page',
matches: 'matches',
thumbnails: 'Thumbnails',
tableOfContent: 'Table of Contents',
share: 'Share',
notes: 'Notes',
pressEscToClose: 'Press ESC to close',
password: 'Password',
addNote: 'Add note',
typeInYourNote: 'Type in your note...',
},
mobile: {
shadows: false,
pageSegmentsW: 5,
},
}

Did this answer your question?