You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've a document that shows content in 2 columns so now 1 column size has increased which caused new page to be added but when I'm trying to use doc.switchToPage(0) and doc.text(...) its not working. Even on playground its not working.
Description of the problem
I've a document that shows content in 2 columns so now 1 column size has increased which caused new page to be added but when I'm trying to use doc.switchToPage(0) and doc.text(...) its not working. Even on playground its not working.
Code sample
`// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());
// draw some text
doc.fontSize(25).text('Here is some vector graphics...', 100, 80);
// an SVG path
doc
.scale(0.6)
.translate(470, 130)
.path('M 250,75 L 323,301 131,161 369,161 177,301 z')
.fill('red', 'even-odd')
.restore();
doc.addPage();
doc.addPage();
doc.switchToPage(0);
// and some justified text wrapped into columns
doc
.text('And here is some wrapped text...', 100, 300)
.font('Times-Roman', 13)
.moveDown()
.text(lorem, {
width: 412,
align: 'justify',
indent: 30,
columns: 2,
height: 300,
ellipsis: true
});
// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
iframe.src = stream.toBlobURL('application/pdf');
});`
Your environment
pdfkit version:
Node version:
Browser version (if applicable):
Operating System:
The text was updated successfully, but these errors were encountered:
Related issue,
Let's say we are creating pdf pages with 2 columns. Once the pdf left side column is overflown it creates a new page when all the left side content (suppose 2 pages), we try to switch to the first page this works if we set the bufferPages: truebut when first page right side content is full, the text will be written to 3 page instead of 2nd page
Attaching the text that can be used playground to see the issue pdfplay.txt
After looking at the issues, noticed #1201 should fix but not sure why it's not working
Bug Report
I've a document that shows content in 2 columns so now 1 column size has increased which caused new page to be added but when I'm trying to use
doc.switchToPage(0)
and doc.text(...) its not working. Even on playground its not working.Description of the problem
I've a document that shows content in 2 columns so now 1 column size has increased which caused new page to be added but when I'm trying to use
doc.switchToPage(0)
and doc.text(...) its not working. Even on playground its not working.Code sample
`// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());
// draw some text
doc.fontSize(25).text('Here is some vector graphics...', 100, 80);
// some vector graphics
doc
.save()
.moveTo(100, 150)
.lineTo(100, 250)
.lineTo(200, 250)
.fill('#FF3300');
doc.circle(280, 200, 50).fill('#6600FF');
// an SVG path
doc
.scale(0.6)
.translate(470, 130)
.path('M 250,75 L 323,301 131,161 369,161 177,301 z')
.fill('red', 'even-odd')
.restore();
doc.addPage();
doc.addPage();
doc.switchToPage(0);
// and some justified text wrapped into columns
doc
.text('And here is some wrapped text...', 100, 300)
.font('Times-Roman', 13)
.moveDown()
.text(lorem, {
width: 412,
align: 'justify',
indent: 30,
columns: 2,
height: 300,
ellipsis: true
});
// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
iframe.src = stream.toBlobURL('application/pdf');
});`
Your environment
The text was updated successfully, but these errors were encountered: