Foxit PDF SDK for Web

How to use PDF Linearization with Foxit PDF SDK for Web

by Conor Smith | November 17, 2020
PDF linearization is a quick web viewing format which displays pages instantly without having to wait for an entire file to be completely downloaded. To make use of this feature, PDF SDK for Web’s viewer checks at the initialization stage to programmatically detect if it is a linearization document. If it is, the Web viewer […]
Keep reading Keep reading

Quick tips to speed up PDF SDK for Web’s performance

by Conor Smith | November 17, 2020
If you experience slow page loading with PDF SDK for Web, use Chrome Dev Tools to inspect your Network activity to check if the slowness is related to repeat file loading. If so, you should consider using a cache policy on static assets to optimize repeat page load speed. PDF SDK for Web allows a temporary […]
Keep reading Keep reading

How to use the preload worker thread with Foxit PDF SDK for Web

by Conor Smith | November 17, 2020
preloadJRWorker is our web SDK worker thread to perform tasks in the background. With version 7, we have made major improvements to the worker in order to reduce loading time. It can run simultaneously with the SDK JS libraries to initialize data in different threads. The following shows code examples to set up the preloadJrWorker […]
Keep reading Keep reading

How to Set Custom Fonts with PDF SDK for Web

by Conor Smith | September 15, 2020
Foxit PDF SDK for Web has a huge range of custom fonts available with the package. You can customize as much as you wish by using the 2 sample codes below. Setting up the font Path var pdfui = new PDFUI({         viewerOptions: {             libPath: '../../../lib',             preloadJR: true,             jr: {             licenseSN:"",             LicenseKey:"",             fontPath:"../external/brotli"             }         }) Setting up custom fonts function setCustomFonts(){         pdfui.getWebPDFJR().then(function(jr) {             var fontCalibri = {                 nameMatches: [ /(calibri)/ig ],                 glyphs: [  […]
Keep reading Keep reading

Additional Language support with Foxit PDF SDK for Web

by shanqing_lin | September 12, 2020
Internalization Resources Foxit PDF SDK for Web has adopted the i18Next international framework to implement additional language support. The localization resources are stored at ~lib\locales. Each folder contains two resource files – the ui_.json and viewer_.json. The first one is for the advanced web viewer demo, and the other is for the basic web viewer […]
Keep reading Keep reading

How to Customize Language Resources with Foxit PDF SDK for Web

by Conor Smith | September 12, 2020
Assumption Assume you have an assets/in your website root directory, where you will configure the language resources. Let’s call this path as websiteRoot/assets/. Configuration Copy lib/locals inside the SDK to websiteRoot/assets/. Set up the I18N path for loading resources. new UIExtension.PDFUI({ i18n: { absolutePath: 'websiteRoot/assets/locals' }, // the other options... }); Add more languages Create a new […]
Keep reading Keep reading

How to Save PDFs back to a Web Server with PDF SDK for Web

by Conor Smith | September 10, 2020
Foxit PDF SDK for Web allows you save PDF files to a web server easily with a short code. Please add the code below to do so: var FRAGMENT_ACTION = UIExtension.UIConsts.FRAGMENT_ACTIONar FRAGMENT_ACTION = UIExtension.UIConsts.FRAGMENT_ACTION var pdfui = new PDFUI({ fragments: [{ target: 'download-file-button', action: FRAGMENT_ACTION.AFTER, template: '<xbutton icon-class="customers-save-button-icon-css-class" name="upload-to-server-button"></xbutton>', config: [{ target: 'upload-to-server-button', callback: function() { […]
Keep reading Keep reading

How to Change the Loading Icon & Text with PDF SDK for Web

by Conor Smith | September 8, 2020
Foxit PDF SDK for Web comes with lots of customization options and you can now edit the loading icon and text. This icon/text refers to the time between UI initialization and document display. Follow the guidelines below to update this icon and text, or you can have neither a loading icon/text if you wish. Code […]
Keep reading Keep reading

How to Add Annotations with Foxit PDF SDK for Web

by Conor Smith | September 6, 2020
Add an annotation on a given page   Programmatically add an annotation   var pdfviewer = await pdfui.getPDFViewer();var pdfdoc = await pdfviewer.getCurrentPDFDoc();var page = await pdfdoc.getPageByIndex(0);var json = {type:’square’,rect:{left:98,right:200,top:500,bottom:450},contents:’this is a rectangle’,color: 0x008080,borderInfo:{width:15}};await page.addAnnot(json) Add a group annotation on a given page UI Programmatically add group annotations NO var pdfviewer = await pdfui.getPDFViewer();var pdfdoc = […]
Keep reading Keep reading
Used everywhere

Trusted by