Skip to content

Conversation

@bjnsn
Copy link
Contributor

@bjnsn bjnsn commented Jun 11, 2016

Fixes issue with calls to text that have continued option not having continuedX reset when an explicit carriage return causes a break.

For example, if you paste this code into the browser demo you'll find that the subsequent lines do not have their position reset to the left edge of the column as expected.

// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());

 doc.font('Times-Roman', 13)
       .text('First, we cause it to wrap onto the next', {
         width: 412,
         columns: 2,
         height: 300,
         continued: true,
         paragraphGap: 10
       });

for (var i = 0; i < 10; ++i) {
    doc.text('\nand then we cause it to wrap onto the next', {continued: i < 9});
}

// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
  iframe.src = stream.toBlobURL('application/pdf');
});

…ntinuedX reset when an explicit carriage return causes a break.
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

Successfully merging this pull request may close these issues.

1 participant