Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale and draw text #767

Open
igum123 opened this issue Jan 5, 2018 · 0 comments
Open

Scale and draw text #767

igum123 opened this issue Jan 5, 2018 · 0 comments

Comments

@igum123
Copy link

igum123 commented Jan 5, 2018

When I tryed to draw a text with the x position was bigger than the width of the doc's page, a infinit loop occured.
In fact, the width of the text is compute but it's negative.

An exemple of code:

var doc = new PDFDocument({ size: [200, 200]});
var stream = doc.pipe(blobStream());

doc.save();
doc.scale(0.5,0.5);//doc size must be 400x400, not necessary even without the bug occured

doc.fontSize(10)
   .text('Test', 300, 80);//x position is bigger than the width of the page (300 > 200)
   
doc.end();
stream.on('finish', function() {
  iframe.src = stream.toBlobURL('application/pdf');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant