PDF to HTML5 conversion – video

The PDF file format allows you to embed video directly inside a PDF file. So, I wondered, how easy would it be to write it out to HTML5. The data is embedded as a binary bytestream in one of several formats (mp4, swf). It turns out that HTML5 also supports these formats and it has a special tag (video) for the purpose. So it is actually reasonably straight-forward to extract it from the PDF and make it available in HTML.

Here is my first attempt as an example for our PDF to HTML5 convertor (and it works on IPad as well!). What do you think?

Click here to see all the other articles in the PDF to HTML5 conversion series.

This post is part of our “HTML5 Article index” in these articles, we aim to help you understand the world of HTML5.

Related Posts:

The following two tabs change content below.

Mark Stephens

System Architect and Lead Developer at IDRSolutions
Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.
Markee174

About Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.

He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

4 thoughts on “PDF to HTML5 conversion – video

  1. James Robb

    I looked at the exported code, and unfortumately it doesn’t look like the converter is compensating for browser type. I am using FireFox, and .mp4 files will not play, as FireFox only implements OGG (http://en.wikipedia.org/wiki/Theora). You converter needs to have a format converter to export an OGG when its not available, and an mp4 when it’s not available. There also doesn’t appear to be a flash fallback.

    Best of luck!

  2. Thanks for pointing that out. I tested it on Safari (Mac and IPad) and Chrome, but had not yet tried Firefox. I’ll look at something for the next version.

  3. web

    HTML5 will change your website is by no longer needing to rely on Flash for animation and hence to learn Html5 will be a lot more beneficial . Granted, there are some types of visual rendering (i.e. movie trailers, etc), that still would benefit from technologies like Flash, but when it comes to the standard types of animation you see on so many websites nowadays

  4. Dave

    Very cool.

    This is a great step forward for viewing pdf’s purely in the browser.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>