Created
March 28, 2012 11:18
-
-
Save xk/2225501 to your computer and use it in GitHub Desktop.
doc.rotate(90) fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PDFDocument= require('pdfkit'); | |
var doc= new PDFDocument(); | |
doc.save(); | |
doc.x= doc.pages[0].width/2; | |
doc.y= doc.pages[0].height/2; | |
doc.fontSize(30); | |
doc.rotate(89.9, {origin: [doc.x, doc.y]}); | |
doc.text('OK, GOOD'); | |
doc.restore(); | |
doc.save(); | |
doc.x= doc.pages[0].width/2; | |
doc.y= doc.pages[0].height/2; | |
doc.fontSize(30); | |
doc.rotate(90, {origin: [doc.x, doc.y]}); | |
doc.text('FAILURE'); | |
doc.restore(); | |
doc.write('test.pdf'); | |
require('child_process').exec('open test.pdf'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like the
doc.rotate(90, {origin: [doc.x, doc.y]});
doesn't fail anymore