Devon Govett
f8a40dba76
Make PDFDocument a node stream
2014-03-23 17:11:48 -07:00
Devon Govett
1305a9592a
Switch to 2 space indentation
2014-03-23 12:25:09 -07:00
Devon Govett
350863bfda
Fix the ellipse method
2014-02-24 23:25:41 -08:00
Devon Govett
c1319acff8
Allow 0 opacities
2014-02-24 01:09:27 -08:00
Devon Govett
cb81273b49
Trim spaces from the ends of lines when right aligning
2014-02-17 22:02:55 -08:00
Devon Govett
18512661b5
Apply current transformation to annotations
2014-02-17 22:01:49 -08:00
Devon Govett
3f15f761e2
Calculate lineWidth of underline/strike based on font size
2014-02-17 02:34:27 -08:00
Devon Govett
7df3ccdf4d
Add link, underline, and strike options to text method. #183
...
Should make it way easier to do these common things.
2014-02-17 02:21:29 -08:00
Devon Govett
6a323bf0a2
Make sure justified wordSpacing value is always > 0
2014-02-17 02:19:11 -08:00
Devon Govett
9357ff5a4a
Extend text options for continued segments
2014-02-17 02:18:40 -08:00
Devon Govett
00c6dabf3c
Stop wrapping text after filling specified height, and add ellipsis option. Fixes #149 .
...
No longer makes new pages after user specified heights, but still does so if no height is given (page edge by default). This works with multiple columns too. It will fill the columns in the horizontal and vertical space provided and then stop, rather than going to a new page.
Also adds the `ellipsis` option which can be used to append an ellipsis character like `…` to the end of the cut off text. If you set `ellipsis: true`, it will use the default ellipsis character, but you can also set the option to any string you want to use.
2014-02-16 20:08:19 -08:00
Devon Govett
630bfd74a6
Make sure we don't divide by zero when calculating justification word spacing
2014-02-16 15:54:42 -08:00
Devon Govett
5a74677c66
Store continuedX on the line wrapper instead of the document, since the line wrapper is now reused
2014-02-16 14:48:40 -08:00
Devon Govett
7fafa309b8
Use the same line wrapper instance when text is continued, fixes multicolumns
2014-02-16 14:41:26 -08:00
Devon Govett
b0de8975f9
Fix justification of embedded TTF fonts. Closes #52 .
...
Encodes each word separately instead of relying on Tw operator, which only supports character code 32, which isn't used by embedded fonts.
Still to do: proper unicode word breaking with support for non-space separated languages.
2014-02-16 13:10:18 -08:00
Devon Govett
ebeca3c680
Add continued option to text so that text with inline styles can be created. Closes #60 , #180 , #189 .
...
The following example adds text with three sections (part1, part2, part3) in different fonts and colors.
doc.font('Helvetica', 13)
.text(part1, 100, 300, { continued: yes, indent: 50 })
.fillColor('red')
.text(part2, { indent: 50, continued: yes })
.font('Times', 13)
.fillColor('green')
.text(part3)
2014-02-16 11:56:31 -08:00
Devon Govett
4b3d2c9e30
Save the fill color and restore it after the line wrapper makes a new page
2014-02-16 11:50:59 -08:00
Devon Govett
df43e0eeb0
Set opacity to 1 if none passed to fillColor and strokeColor
2014-02-16 11:49:09 -08:00
Devon Govett
518d545538
Fix some justification issues
2014-02-16 02:00:29 -08:00
Devon Govett
ef6578a486
Rewrite the line wrapper to use an implementation of the Unicode Line Breaking Algorithm
...
Should solve a huge number of issues. The regular express based word matching from before was not good. It was overzealous and caused the most bugs of anything in the project. It also didn't work at all for languages like Chinese which don't have spaces between words.
The new wrapping algorithm supports all of this. It is a separate module at http://github.com/devongovett/linebreak .
2014-02-16 02:00:18 -08:00
Devon Govett
8c83de3354
Allow setting dash spacing to 0. Closes #102
2014-02-15 01:01:38 -08:00
Brian Downing
5fc69d96c8
Fix setting text x or y to 0
...
Because of the use of the construction "@x = x or @x" there was no way
to set x (or y) to 0, since 0 is falsy. Fix to use separate outer tests
and unconditional assignment.
2013-12-01 21:38:38 -06:00
Devon Govett
27c17cf454
Fix behavior of text wrapping with x/y without width. Use options.lineBreak = false to disable linebreaking
2013-11-09 23:13:50 -08:00
Devon Govett
a7c0a63d76
Merge pull request #167 from Nathanaela/Fix_Eating_Chars
...
Fixes the eating of prefix characters:
2013-11-09 22:43:58 -08:00
Devon Govett
f95a68c149
Clean up, and release 0.2.3
2013-11-09 22:41:15 -08:00
Devon Govett
5ef0bd8ac3
Merge pull request #78 from wabbit/master
...
Added image alignment to the image fit option
2013-11-09 22:38:49 -08:00
Nathanael Anderson
e5bbe4dfce
Fixes the eating of prefix characters:
...
;:.-/\?!
2013-10-24 12:43:25 -05:00
Julian Gruber
6775d194a1
make registerFont chainable
2013-06-28 10:51:23 +02:00
Devon Govett
2493e0c34c
Add gradient support (both linear and radial). Closes #95 .
2013-05-12 20:29:53 -07:00
Devon Govett
587456daad
Fix some transform stuff
2013-05-12 20:27:03 -07:00
Devon Govett
bf760a1729
Break line wrapper out into separate class
2013-05-12 20:24:51 -07:00
wabbit
64031f60c1
Added the 'Align' feature to the image fit option. now when you set an image to fit inside a container, you can make it center or right align (left is default, so needs no aligning)
2012-06-28 14:46:16 +03:00
tofutim
e6fb9f0fd1
Using [null null] 0 d for undash causes Acrobat Reader to crash. Use [] 0 d instead.
2012-06-20 21:41:56 -07:00
Devon Govett
273f704186
Remove beginPath function.
...
PDF subpaths are begun automatically by moveTo. Was causing issues with opening and printing some PDFs in Adobe Reader.
2012-05-17 09:24:43 -07:00
Devon Govett
eeae6ad991
Fix image issue. Closes #71 .
2012-05-04 09:07:18 -07:00
Devon Govett
2e457ac0f3
Fix transformation issues. Closes #67 , #68 and #35 .
...
I think 5 decimal places is probably enough.
2012-04-03 20:58:20 -07:00
Devon Govett
b9da8ebedd
Switch to using Node's built in zlib bindings. Fixes #48 .
2012-04-03 19:28:59 -07:00
Devon Govett
513fef78e1
Encode text as hex to avoid an escaping issue when using font subsets. Fixes #33 .
2011-09-05 11:02:56 -04:00
Devon Govett
431a5186fe
Automatically convert text to a string
2011-08-23 10:46:51 -04:00
Devon Govett
753e41462b
Allow zero image coordinates - fixes #25
2011-08-19 18:33:43 -04:00
Devon Govett
927c5d769b
Fix a column wrapping bug
2011-08-16 21:04:27 -04:00
Devon Govett
89dd7fdc8e
Define upfront
2011-07-26 22:02:02 -04:00
Devon Govett
ee86d0493f
Don't move down the paragraph gap when on the first paragraph of a page or column.
2011-07-22 16:33:26 -04:00
Devon Govett
d11b105267
Fix comment
2011-07-22 15:38:24 -04:00
Devon Govett
526e42923f
Support for wrapping text into columns (across multiple pages if needed)!
2011-07-22 15:31:10 -04:00
Devon Govett
0d11ae8777
Make sure that the first line of a paragraph is never by itself at the bottom of a page
2011-07-22 13:12:06 -04:00
Devon Govett
bffd8d9878
Automatically flow text to new pages if it doesn't fit on a single one.
2011-07-22 12:41:02 -04:00
Devon Govett
aab337d215
By default, text now wraps to the page margins which are by default, 1 inch. This will not happen if you pass X and Y coordinates for the text to appear at.
2011-07-22 11:44:32 -04:00
Devon Govett
a9bb4e04db
Support for options.x and options.y in text method is no more.
2011-07-22 10:51:35 -04:00
Devon Govett
9d90e25664
Font subsetting support. Only includes characters in embedded fonts that are actually used in the document. Please report bugs if you find them!
2011-07-17 01:13:44 -04:00