Comparing version 0.2.4 to 0.2.5
@@ -129,3 +129,4 @@ (function() { | ||
this.y = y || this.y; | ||
} else { | ||
} | ||
if (options.lineBreak !== false) { | ||
margins = this.page.margins; | ||
@@ -132,0 +133,0 @@ if ((_ref = options.width) == null) { |
@@ -11,3 +11,3 @@ (function() { | ||
PDFObject = (function() { | ||
var pad; | ||
var pad, swapBytes; | ||
@@ -54,4 +54,20 @@ function PDFObject() {} | ||
swapBytes = function(buff) { | ||
var a, i, l, _ref; | ||
l = buff.length; | ||
if (l & 0x01) { | ||
throw new Error("Buffer length must be even"); | ||
} else { | ||
for (i = 0, _ref = l - 1; i < _ref; i += 2) { | ||
a = buff[i]; | ||
buff[i] = buff[i + 1]; | ||
buff[i + 1] = a; | ||
} | ||
} | ||
return buff; | ||
}; | ||
PDFObject.s = function(string) { | ||
string = string.replace(/\\/g, '\\\\\\\\').replace(/\(/g, '\\(').replace(/\)/g, '\\)').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); | ||
string = swapBytes(new Buffer('\ufeff' + string, 'ucs-2')).toString('binary'); | ||
return { | ||
@@ -58,0 +74,0 @@ isString: true, |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["pdf", "pdf writer", "pdf generator", "graphics", "document", "vector"], | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"homepage": "http://pdfkit.org/", | ||
@@ -8,0 +8,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1395614
70
4258