Added function to get the page count of the currently generated instance. Removed the file and input stream atributes of the template in favor of a simple byte array atribute, this way the template can be used multiple times, we avoid writing to disk and we have only one atribute with the template data.