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

Fixes issue with continuedX sometimes not being reset by explicit line break. #511

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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