Foxit Developer Blog

    Insights, tutorials, and updates from the Foxit PDF SDK engineering team.

    Foxit PDF SDK for Web

    Additional Language support with Foxit PDF SDK for Web

    Foxit PDF SDK for Web has adopted the i18Next international framework to implement additional language support. Find out more here. 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 demo.

    Read Article
    Foxit PDF SDK for Web

    How to Customize Language Resources with Foxit PDF SDK for Web

    Click here to find out more on how Foxit PDF SDK for Web can help customize language resources for your application.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/.

    Read Article
    Tech

    How to Display Password Protected PDFs in a Web Application

    PDFs are among the most widely used formats for business documents, so properly securing them is a critical part of many workflows. If you’re building a web application that needs to open PDFs, you’ll probably run into a situation where you have to deal with password-protected documents. Building this functionality yourself will require a lot [...]

    Read Article
    Foxit PDF SDK for Web

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

    Foxit PDF SDK for Web allows you save PDF files to a web server easily with a short code. Find out more about it here. 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() { this.getPDFUI() .getPDFViewer() .then(pdfViewer => { pdfViewer.setActiveElement(null); const buffers = []; return pdfViewer.currentPDFDoc .getStream(({ arrayBuffer }) => { buffers.push(arrayBuffer); }) .then(_ => { return [buffers, pdfViewer.currentPDFDoc.getFileName()]; }); }) .then(([buffers, fileName]) => { if (!fileName || fileName.length === 0) { fileName = "unknown.pdf"; } const blob = new Blob(buffers, {type: 'application/pdf'}) console.info('start uploading', blob); // ajax upload here }); } }] }] })

    Read Article
    Foxit PDF SDK for Web

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

    Foxit PDF SDK for Web comes with lots of customization options and you can now edit the loading icon and text. Click here to find out more. 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 Snippet:

    Read Article
    Foxit PDF SDK for Web

    How to Add Annotations with Foxit PDF SDK for Web

    Click here to find out more on how to add annotations through Foxit PDF SDK for Web. 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)

    Read Article
    Tech

    How to Create a PDF Invoicing Web Application

    Getting paid is one of the most critical functions in any business, and digital invoices are becoming standard practice in a wide swath of industries. With this in mind, web application developers are often tasked with generating and sending PDF invoices programmatically. Whether you’re automating the invoice generation and notification process or building a GUI [...]

    Read Article
    Foxit PDF SDK for Web

    How to Show the First Third of a PDF with Foxit PDF SDK for Web

    Often times you need to show just certain parts of a PDF. This is often due to a particular PDF template that a company follows with the same kinds of information in the same location. For example, a 6 page invoice where you just want to show the first 2 pages that contains the key information you’re after. The following example will show you how to produce a PDF that shows only the first third of pages of a document in our Web-based JavaScript PDF viewer.

    Read Article
    Foxit PDF SDK for Web

    How to Customize Right Click Annotation Menus with Foxit PDF SDK for Web

    This guide highlights how to Customizing a right-click menu for supported annotations, Customizing a right-click menu for unsupported annotations, Hiding a right click menu or menu items & Showing a customized right-click menu.

    Read Article
    Foxit PDF SDK for Web

    How to Customize the Floating Text Selection Tooltip with Foxit PDF SDK for Web

    Customizing the floating tooltip involves two steps. Click here to find out these two steps.

    Read Article