not able to write text at bottom of file
See original GitHub issueHi, I am using pdfkit successfully and able to write text to multiple coordinates as shown in attached pdf.
I am having issues writing to the bottom/right side/edges of the pdf.
when writing to the right side of the page - it has a tendency to wrap and go to next line even if I see plenty of space in right side. Similarly, when writing to the bottom, it goes to next page even if sufficient space is available at the bottom.
As you see in the pdf attached, the image has plenty of space at the bottom where I want to write. But after certain coordinates (712 on Y-axis) text moves to next page.
`var doc = new pdf({ size: ‘letter’, layout : ‘portrait’,
margin : {
top : 0.095 * 72,
left: 0.2 * 72,
right: 0.2 * 72,
bottom: 0
}
});
doc.pipe(fs.createWriteStream(__dirname + "/pdf/" + name));
// doc.pipe (fs.createWriteStream('foo.pdf'));
// doc.pipe(fs.createWriteStream(__dirname + "/pdf/" + name));
//add background image
doc.image(__dirname + "/cms1500.png", {
x: 0.2 * 72,
y: 0.095 * 72,
width: (612 - 2 *0.2 * 72),
height: (792 - 2 *0.095 * 72)
});
doc.font('Times-Roman');
doc.fontSize(8);
for (var i=0; i< 713; i++){ doc.text (i + " => do you see me ", 380, i); }
//-
doc.on('end', function() {
console.log("pdf created");
return cb(true);
});
//--
doc.end();
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Text wont go all the way to the bottom of the page
I have a document where the text on some pages goes right up to the footer at the bottom, but others sometimes leave...
Read more >Word - How to stick text to the bottom of page - Stack Overflow
I want to stick some text of the bottom of the page, like on the screen, just before footer always. When there is...
Read more >310. Why does my text wrap to the next line before reaching ...
Ensure that Indentation, both before and after text, are set to zero and that no special formatting has been set. Click on OK....
Read more >vertical alignment - Putting text at the bottom of the page - TeX
I tried the \vfill option, but this does not seem to do the job. Any ideas? \documentclass{report} \begin{document} \vfill © Copyright by KU ......
Read more >How to change alignment in Excel, justify, distribute and fill cells
Align to upper-left, Align to bottom-right, Center in the middle of a ... In Microsoft Excel, the Tab key does not indent text...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@quicksoftpro Thanks! That got me on the right track, but I had to pass the settings to the constructor when creating the doc like so:
doc.text(text, x, y, {height: doc.page.height}) works for me. However I cannot change the color of the font