How to best convert PDF to HTML5

16 October 2024

Converting PDF files into HTML5 format is essential for making your documents more interactive, accessible, and mobile-friendly. Whether you're a web developer, content creator, or business owner, transforming your PDFs into HTML5 opens the door to better user experience and SEO benefits. This document outlines some of the best ways to convert your document to HTML5 with a small guide attached to each of the options.

Traditional Embed

Using an open source tool: Calibre

Calibre is an open-source e-book management tool, but it also includes PDF to HTML conversion capabilities. Although originally designed for e-books, it works well for converting PDFs into HTML5 format.

Step 1: Download and Install Calibre

If you don’t already have Calibre installed, you can download it from the Calibre website. Install it following the instructions for your operating system (Windows, macOS, Linux).

Step 2: Open Calibre and Import Your PDF

Launch Calibre after installation. To add your PDF file, click on the “Add books” button in the top left corner. Browse and select the PDF file you want to convert to HTML.

Step 3: Convert the PDF to HTML

Once the PDF is added to Calibre, select it from your library list by clicking on it. Click the “Convert books” button in the toolbar. A new window will appear with various conversion options.

Step 4: Select Output Format: HTML

In the “Convert books” window, go to the top-right corner where you’ll see the “Output format” drop-down menu. Select “ZIP” from the list of output formats. HTML is outputted as a zipped folder containing multiple files (HTML, images, etc.).

Step 5: Start the Conversion

After adjusting the settings, click the “OK” button to begin converting your document. Calibre will start processing the PDF, and you’ll see a notification when the conversion is complete.

Step 5: Retrieve the HTML Files

Once the conversion is finished, navigate to the “Jobs” area (bottom right corner) to see the progress. After the conversion, the ZIP file containing the HTML will be saved. To access the files, right-click on your converted file in the library and select “Open containing folder”. Extract the HTML files from the ZIP folder.



Pros and cons

So what are the benefits about this approach?

  • Can embed PDFs directly into web pages.
  • Offers control over rendering, allowing you to manipulate pages.
  • Fully client-side, so it works without any server processing.
  • Ideal for web developers who want more control over how the PDF content is displayed.

  • What are some of the negatives with using Calibre?

  • Complex Layouts May Not Convert Well
  • No Direct HTML5 Output
  • Limited Control Over Styling
  • Traditional Embed

    Using a command line tool: MuPDF

    MuPDF is a lightweight PDF viewer that also includes command-line tools for converting PDFs to other formats, including HTML.

    Step 1: Download and Install MuPDF

    Visit the MuPDF official website to download the appropriate version for your operating system (Windows, macOS, or Linux). After downloading, install the application by following the instructions for your operating system.

    Step 2: Open a Command Line Interface (CLI)

    For Windows: Open Command Prompt or PowerShell.
    For macOS or Linux: Open the Terminal.

    Step 3: Navigate to the MuPDF Directory

    Use the cd command to navigate to the folder where you installed MuPDF or where the mutool executable is located. For example:

    cd /path/to/mupdf
    



    Step 4: Run the Conversion Command

    The mutool command is used to convert PDF files to HTML. The basic syntax is:

    mutool convert -o output.html input.pdf
    



    Step 5: View the HTML Output

    After running the conversion, the output.html file will be generated in the current directory. Open the resulting HTML file in a web browser to check the output.

    Pros and cons

    So what are the benefits about using MuPDF?

  • Lightweight and Fast
  • Open-Source and Free. Worth to note though is that is using AGPL which is somewhat restrictive.
  • Supports High-Quality Output

  • What are some of the negatives with using MuPDF?

  • Command-Line Interface (CLI) Only
  • Limited Complex Layout Handling
  • Basic HTML Output
  • Traditional Embed

    Using FlowPaper

    Using FlowPaper to convert a PDF into HTML5 is a great way to create interactive, web-optimized documents. FlowPaper provides tools to convert PDF documents into a format that’s viewable directly in web browsers, with additional features for embedding the converted files into websites. Here’s a guide on how to use FlowPaper for PDF to HTML5 conversion:

    Step 1: Sign Up or Log In to FlowPaper

    Visit the download page and sign up for an account if you haven’t already. You can also download the desktop publishing software if you prefer offline work. FlowPaper offers both a free version and paid plans with additional features.

    Step 2: Choose the Conversion Tool

    Option 1: If you want to use the javascript component, choose the “Javascript API” option in the download dialogue.
    Option 2: If you’re not a developer, open the FlowPaper Desktop Publisher.

    Step 3: Upload Your PDF (if using the desktop publisher)

    Once in the conversion tool, click on the “Import PDF” button. Select the PDF file from your computer that you want to convert to HTML5.

    Step 4: Customize the Conversion Settings

    FlowPaper offers several customization options to tailor the output to your needs. You can find the customization options on the right-hand side in the desktop publisher after importing your PDF.

    Step 5: Convert the PDF to HTML5

    After configuring your settings, click “Publish” and choose “Custom Domain”. FlowPaper will process the PDF and convert it into HTML5 format. This process usually takes a few seconds, depending on the size of the PDF. The resulting HTML5 files will be available in the output folder that gets created.

    Pros and cons

    So what are some of the benefits about using FlowPaper?

  • Interactive and Engaging Viewer Options
  • Responsive HTML5 Output
  • SEO-Friendly
  • Cloud Hosting & Analytics


  • What are some of the negatives with using FlowPaper?

  • Limited Free Features (watermarking)
  • Requires Internet for Online Use
  • Featured Video - Qantas Case study with FlowPaper

    11 October 2024

    In this case study video, we’ll see how Qantas Airlines enhanced their holiday brochure is using FlowPaper. This Qantas Membeship catalog was sent out to hundreds of thousands of their travellers.

    In this video, we’ll go through how Qantas

    • Added page turn effects to their catalog
    • How they used hotspots to highlight links and products
    • Used an interactive table of contents page with internal links

    Featured Video - Air New Zealand Case study with FlowPaper

    28 September 2024

    In this video, we’ll have a look at a case study where Air New Zealand converted their in-flight magazine using FlowPaper. Tag along as we go through a few of the pages and how they ended up when converting the PDF into a responsive format

    In this case study, we’ll go through

    • Why you would want to convert a PDF into a responsive format
    • A introduction into the reflowable template
    • Explanations on how to handle advertisements and how to jump between sections
    • Comparisons between a PDF page and its resulting, responsive page
    • A review of text quality options when converting to HTML5/SVG

    Video review - which flipbook maker should you use to bring your PDFs alive?

    24 September 2024

    Still unsure which flipbook platform to use to bring your catalog, magazine or brochure alive when publishing online? Check out this video review of FlowPaper by Michelle Schneider

    In this review, Michelle will guide you through how to:

    • How does FlowPaper differ from the other digital publishers out there?
    • How to customize realistic 3D skins for your publication
    • Previewing your publication on mobile devices
    • How to use custom styling for your publication skin
    • The intro animation option and how it can be customized
    • Adding interactive elements to your publication

    Video tutorial - how to protect your PDF files online

    17 September 2024

    This week’s highlighed video tutorial comes from Alexandra Monica Cote which is reviewing the best options in how to protect your PDF files from being downloaded

    In this tutorial, Alexandra will guide you through the steps on how to:

    • Password protect a PDF file when you are sharing it online
    • How to protect the PDF file from being embedded on other web sites than yours
    • Adding lead capture forms to your PDF files so you can collect information about your readers
    • Enabling and disabling the copy, print and download functionality of your PDF

    Protecting your documents when publishing them online can be tricky- this tutorial is a great starting point when reviewing the options you have with FlowPaper

    Video - turn on the heat with analytics for your PDF flipbooks

    11 September 2024

    With this video by Michelle Schneider- you’ll get some an insiders look into your PDF readers’ behavior with interactive heatmaps.

    In this tutorial, Michelle will show you how to:

    • How to publish a flipbook and turn on heatmap analytics
    • Where to access basic analytics such as page views, link clicks
    • How to interpret your collected heatmap data

    Heatmaps can provide great insights into how your readers use your PDF publications

    How to best embed PDF files on a website

    11 August 2024

    When it comes to embedding PDF files on a web page, there are different ways to skin a cat. Whether you're sharing an ebook, a whitepaper, or a brochure, embedding PDFs directly onto your site allows visitors to view the content without ever leaving your page. In this post, we’ll explore a few simple methods to help you get those PDFs seamlessly integrated into your website.

    Traditional Embed

    The old school way: iframes

    Step 1: Upload Your PDF File

    First things first, you need to upload your PDF file to your website's server. You can do this via your website’s content management system (CMS) or an FTP client. If you’re using a CMS like WordPress, navigate to the media library and upload the PDF file just like you would an image or video.

    Step 2: Get the PDF URL

    Once your PDF file is uploaded, locate the file in your media library or on your server. Copy the URL of the PDF file, as you’ll need this in the next step. This URL is the direct link to your PDF, and it’s what you’ll use to embed the file on your web page.

    Step 3: Embed the PDF in Your Web Page

    Now, it's time to embed the PDF into your web page. You can do this in a few different ways: Using HTML: The simplest way is to use an <iframe> tag. Here’s an example:
    <iframe src="YOUR_PDF_URL" width="600" height="800" style="border:none;"></iframe>
    


    So what are the positives and negatives about this approach?
    Pro's:
  • No external libraries required

  • Con's:
  • Not responsive
  • Hard to customize
  • Not accessible
  • Hard to navigate in small embeds
  • No analytics
  • PDFJS Embed

    Embedding PDF files using PDF.JS

    If you're a bit more of a web developer, then PDF.js is could be a fantastic option. In this post, we’ll walk you through the steps to seamlessly embed PDFs into your website using PDF.js.

    Step 1: Download PDF.js

    To get started, you need to download the PDF.js library. Follow these steps:
  • Download the Library: Go to the PDF.js GitHub repository and download the latest release. Extract the files to a directory on your server.
  • Host the Library Files: Upload the pdf.js and pdf.worker.js files from the build directory to your server. You’ll reference these files in your HTML code.

  • Step 2: Create a HTML Container

    Next, you need to create a HTML container where the PDF will be rendered. Here’s a basic setup:
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>PDF Viewer</title>
    </head>
    <body>
        <canvas id="pdf-canvas" style="border:1px solid black;"></canvas>
    
        <script src="path/to/pdf.js"></script>
        <script src="path/to/pdf.worker.js"></script>
    </body>
    </html>
    
    Replace "path/to/pdf.js" and "path/to/pdf.worker.js" with the actual paths to these files on your server.

    Step 3: Load and Render the PDF

    Now, it’s time to write the JavaScript code that will load and render your PDF file using PDF.js.
    Here’s how to do it:
    <script>
        var url = 'YOUR_PDF_URL';
    
        // Asynchronously download the PDF
        pdfjsLib.getDocument(url).promise.then(function(pdf) {
            // Fetch the first page
            pdf.getPage(1).then(function(page) {
                var scale = 1.5;
                var viewport = page.getViewport({scale: scale});
    
                // Prepare canvas using PDF page dimensions
                var canvas = document.getElementById('pdf-canvas');
                var context = canvas.getContext('2d');
                canvas.height = viewport.height;
                canvas.width = viewport.width;
    
                // Render PDF page into canvas context
                var renderContext = {
                    canvasContext: context,
                    viewport: viewport
                };
                page.render(renderContext);
            });
        });
    </script>
    
    Replace "YOUR_PDF_URL" with the URL of the PDF file you want to embed. The scale variable controls the zoom level of the PDF. And that's it! You should now be able to see the embedded PDF file on your web page.

    So what are some positives and negatives?
    Pro's:
  • If you have some CSS skills then you can customize the look of the viewer

  • Con's:
  • Slow performance with big PDFs
  • Not easy to use on small devices
  • No analytics
  • FlowPaper embed

    Embedding PDF files using FlowPaper

    With a risk of stating the obvious, you can of course also embed your publications using FlowPaper. FlowPaper supports a range of embedding options including
  • On your own website
  • Using Wordpress
  • Using WIX
  • Embedding on Squarespace


  • FlowPaper is both responsive as well as customizable and provides a range of analytics including heatmaps which will allow you to track your visitors behaviour as they browse your publications.

    How to convert Indesign magazines to animated flipbooks

    7 August 2024

    Looking to elevate your digital publications? Over at Montilla Design, they have explored many PDF-to-flipbook platforms, but Flowpaper stands out in its ability to animate in order make your publications really pop.

    In this tutorial, they will show you how to:

    • Export your InDesign magazine layout as a PDF.
    • Convert it into an interactive flipbook using Flowpaper.
    • Animate text and objects.
    • Set up a photo gallery.
    • Create button interactions for videos.

    Discover how Flowpaper’s tools can bring your layouts to life. Check it out and take your digital content to the next level!

    FlowPaper 3.8.5 Release Notes

    1 August 2024

    3D flipbook video

    Boost Your Social Media with FlowPaper’s HD 3D Flipbook Clips

    Want to make your publications pop on social media? FlowPaper’s got you covered! We’ve introduced high-definition 3D clips that transform your flipbooks into eye-catching videos perfect for sharing. Here’s how FlowPaper helps you generate these shareable clips effortlessly:

    Easy Conversion

    Upload your PDF or flipbook to FlowPaper. Customize with animations and transitions. Convert to a high-definition 3D video clip after uploading your publication to FlowPaper cloud.

    High Definition Quality

    Version 3.8.5 ensures your 3D clips are crystal clear, maintaining the sharpness and professionalism of your original publication.

    Versatile Sharing

    Perfect for Instagram, Facebook, Twitter, and more. Tailor your clips to fit any platform and captivate your audience everywhere.

    Track and Optimize

    With built-in analytics, see how your publications perform and optimize your strategy for better results.

    Ready to elevate your social media game? Start using FlowPaper and turn your flipbooks into stunning 3D video clips that everyone will want to share!

    Upcoming Features - Video Magic and Cloud Publishing Upgrades

    6 July 2024

    FlowPaper is about to drop some awesome new features that will make creating and sharing your Flipbooks even more exciting.

    Flipbooks to high definition Videos

    Reach More People: Videos get tons of engagement on social media. By turning your Flipbooks into videos, you can share your content with a broader audience and get more eyes on your work. Videos are a fun and dynamic way to present your content. Whether it’s a product catalog, a magazine, or a brochure, turning it into a video can really grab your audience’s attention. We are improving the ways you can generate promotional content to video clips so that you can spread your content to channels such as TikTok, Instagram, Linkedin.

    New Cloud API

    We’re working on launching a new cloud publishing API which will allow you to publish and manage large amounts of publications via an easy-to-use API. Features include being able to search accross multiple publications as well as automatic reading order detection. Let us know if you want to know when this API is launched and we’ll make sure you’re first in line!

    New YouTube content related to making flipbooks

    Quite a lot of new content is being seen on YouTube for FlowPaper such as the tutorial below which was posted by Alexandra. Hope you’ll enjoy it.