mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
36 lines
1003 B
JavaScript
36 lines
1003 B
JavaScript
var {runDocTest} = require('./helpers');
|
|
|
|
describe('text', function () {
|
|
test('simple text', function () {
|
|
return runDocTest(function(doc) {
|
|
doc.text('Really simple text', 100, 100);
|
|
});
|
|
});
|
|
|
|
test('alignment', function () {
|
|
return runDocTest(function(doc) {
|
|
doc.text('Left aligned text', {align: 'left'});
|
|
doc.text('Right aligned text', {align: 'right'});
|
|
doc.text('Justified aligned text - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in suscipit purus.', {align: 'justify'});
|
|
});
|
|
});
|
|
|
|
test('decoration', function () {
|
|
return runDocTest(function(doc) {
|
|
doc.fillColor("blue").text('Here is a link!', 100, 100, {
|
|
link: 'http://google.com/',
|
|
underline: true
|
|
});
|
|
doc.text('Strike', 100, 130, {
|
|
strike: true
|
|
});
|
|
});
|
|
});
|
|
|
|
test('list', function () {
|
|
return runDocTest(function(doc) {
|
|
doc.fillColor('#000').list(['One', 'Two', 'Three'], 100, 150);
|
|
});
|
|
});
|
|
});
|