Skip to content

Commit

Permalink
Improve text attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
HughePaul committed Oct 4, 2019
1 parent ccc5f06 commit 482a29e
Show file tree
Hide file tree
Showing 6 changed files with 430 additions and 1,630 deletions.
26 changes: 25 additions & 1 deletion lib/pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,32 @@ const styleKeys = {
paragraphGap: Number,
pre: Boolean,
trim: Boolean,

lineBreak: Boolean,
columns: Number,
columnGap: Number,
indent: Number,
wordSpacing: Number,
characterSpacing: Number,
fill: Boolean,
stroke: Boolean,
oblique: Boolean,
baseline: Number,

href: String
};

const styleDefaults = {
continued: true,
underline: false,
strike: false,
lineBreak: true,
fill: true,
stroke: false,
oblique: false,
link: null
};

const edgeKeys = {
top: 'Top',
left: 'Left',
Expand Down Expand Up @@ -533,7 +556,8 @@ class PDF {

let options = _.clone(state.style);
options.continued = true;
options.link = state.style.href || undefined;
options.link = state.style.href;
_.defaults(options, styleDefaults);

debugText('Rendering text',
textContent,
Expand Down
Loading

0 comments on commit 482a29e

Please sign in to comment.