Creating PDFs in javascript with jsPdf

If you’ve been in web development long enough, you’ve probably had to create a PDF of some sort. For years the go to standard for generating PDFs in code has been iText from by Bruno Lowagie. If you have to do serious work with embedded fonts, complex layouts, drawing etc. it beats everything hands down.

But what if you just need to generate a simple pdf, and your entire app is already in javascript? In this case jsPDF (https://github.com/MrRio/jsPDF) can come in very handy.

Continue reading Creating PDFs in javascript with jsPdf

What Is New In Javascript?

Javascript is an interpreted, lightweight and object-oriented language. It is famous for being the scripting language for website pages and runs on the client side of the Web. JavaScript contains a library of objects and a core set of language elements. You can use it to interact with HTML source code to enable Web authors to jazz up a site with dynamic content. Details about popular frameworks are below. Continue reading What Is New In Javascript?

Angular 2 Charts

This morning I started to look at putting some charts on an Angular 2 site. I was expecting to use HighCharts and do something similar to how I integrated with tinymce. I always run a quick search before building something new to see if there’s any libraries/snippets/info on the web that might be useful or teach me a better way to look at the problem.

To my delight, valor software has put together a nice integration with chartjs called ng2-charts.

Continue reading Angular 2 Charts

Javascript for Upgrading Websites

Javascript is one of the most commonly used languages on the web. It is a high-level and interpreted programming language. Most websites use Javascript and virtually every major modern web browser can interpret it. It is fast, flexible and easy to use. It provides a number of different user experiences that increase web functionality exponentially. Unity Data Systems is a custom web development firm that is expert at programming in Javascript. For that reason, leading companies are increasingly choosing Unity Data Systems for their custom development needs. The firm is trusted for its quality, expertise and outstanding value. It also has expertise in a number of other frequently used programming languages.

Continue reading Javascript for Upgrading Websites

Angular 2 Inline Templates

Earlier when looking at versioning/cache busting I changed my templates from using the templateURL: ‘./template.html’ syntax to template: require(‘./template.html’).  The more time I spend building out pages on the site, the slower it’s getting. Today, we’re going to look at in-lining html templates in our javascript files as a build step.

This should reduce the amount of http requests and hopefully load time as well. To load the homepage, my site is making 404 http requests, transferring 2.2Mb of data, and takes 5.31s to load. I’d like to bring the initial page load time down to 1s or less if possible.

Continue reading Angular 2 Inline Templates

Angular 2 SystemJS Cache Busting

Browser caching of files yields major performance benefits, reduced network usage, decreased load times etc.

One of the most annoying things is when you update some javascript and your users don’t see the changes because they have a cached version of the file.

Today we’re going to look at a simple way to achieve versioning in an angular 2 app using a query string parameter.

Continue reading Angular 2 SystemJS Cache Busting

Angular 2 User Permissions

I’ve been working on an Angular 2 app recently and needed the ability to hide/show content based on a user’s roles in the system.

I will walk through an example of how to build an angular 2 directive which takes in an array of roles, and calls a data service to match against what roles a user has. The directive will not render the components/html a user doesn’t have the right roles to access.

Continue reading Angular 2 User Permissions

Stopping Vimeo Video On Modal Close

Say you have some vimeo videos setup in bootstrap modal dialogs.

Consider the following scenario:

  • User opens modal and starts playing video
  • User closes the modal. This could be an accidental click or they just don’t want to watch the video anymore
  • Video keeps playing in the background

A video which continues to play in the background will be annoying if it contains audio and you have your speakers/headphones on.

Thankfully, bootstrap and vimeo have provided all the tools necessary to stop playing a video when the modal closes.

Continue reading Stopping Vimeo Video On Modal Close