I'm using javascript library jsPDF to create PDFs and I'd like to add a font to use it as text. This is how to call the function:
var doc = new jsPDF();
doc.addFont(PostScriptName, fontName, fontStyle, encoding);
And here is the info from the library:
- @property id {String} PDF-document-instance-specific label assinged to the font.
- @property PostScriptName {String} PDF specification full name for the font
- @property encoding {Object} Encoding_name-to-Font_metrics_object mapping.
- @name FontObject
What is PostScriptName and where to find it? I was looking for some information but can't find anything good. How can I use this function?
What i already tried was this:
var doc = new jsPDF(); doc.addFont("Arial", "Arial", "Regular","Ansi");
And i get and error:
TypeError: Object #
EDIT: ok, what I also find out that encoding must be type object. Does anyone know what kind of object should i put there?