189 Commits

Author SHA1 Message Date
Devon Govett
665fd935ef Make loading images from buffers way faster by not converting to a string inadvertently 2014-04-06 19:19:17 -07:00
Devon Govett
50f2f84987 v0.5.2 2014-03-29 20:46:39 -07:00
Devon Govett
c9ca2c6151 Release v0.5.1 2014-03-29 20:46:01 -07:00
Devon Govett
8eece7e9ea Make sure heightOfString doesn't break pages 2014-03-29 20:36:10 -07:00
Devon Govett
c72b50927c Add heightOfString method that uses the line wrapper without actually adding content to the document.
Very useful for layout purposes
2014-03-29 20:22:21 -07:00
Devon Govett
cf564ac3da Fixes for text justification 2014-03-29 19:56:36 -07:00
Devon Govett
c30c001e19 Fix coffeescript loading 2014-03-29 19:45:49 -07:00
Devon Govett
16e00aa9e2 Allow setting compress option from constructor 2014-03-29 19:45:41 -07:00
Devon Govett
f2f56fbba5 Fix generating website with new streaming api 2014-03-23 19:47:18 -07:00
Devon Govett
84375a8220 Merge pull request #212 from devongovett/streams
API Change Announcement: Streams instead of write/output methods
2014-03-23 19:34:58 -07:00
Devon Govett
0907968905 Don't store all objects in memory, just offsets once they are written 2014-03-23 18:16:42 -07:00
Devon Govett
9727cfc3fa Bump version and update PDF guide 2014-03-23 17:53:50 -07:00
Devon Govett
64cd3416e5 Update readme with stream info 2014-03-23 17:52:51 -07:00
Devon Govett
ee38da41f6 Update guide for new stream based API 2014-03-23 17:51:18 -07:00
Devon Govett
f6c4b2c226 Free memory after embedding images 2014-03-23 17:37:13 -07:00
Devon Govett
b570ac219e Simplify image loading 2014-03-23 17:31:07 -07:00
Devon Govett
e86289bbff Update guide script for streams 2014-03-23 17:12:31 -07:00
Devon Govett
15c21f8efc Update demo to pipe to a node write stream instead of using deprecated write method 2014-03-23 17:12:22 -07:00
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
d95b826475 Release v0.4.3 2014-02-25 01:03:44 -08:00
Devon Govett
fda5b400e6 Another path parser fix 2014-02-25 00:42:25 -08:00
Devon Govett
06e6419533 Handle reused commands in path parser for last command 2014-02-25 00:08:41 -08:00
Devon Govett
67e6640b92 Fix bug in path parser 2014-02-24 23:44:50 -08: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
50b560debf Add Google analytics tracker for website 2014-02-23 00:25:05 -08:00
Devon Govett
b1aec438e2 Fix link 2014-02-22 23:53:48 -08:00
Devon Govett
bea45827c0 Update link to example PDF 2014-02-22 23:45:00 -08:00
Devon Govett
cb2abf97fc Add script to generate website 2014-02-22 23:33:36 -08:00
Devon Govett
cd0d096e8c Update readme 2014-02-22 23:27:14 -08:00
Devon Govett
98b1e4f953 Clarify docs on margin vs margins properties (#199) 2014-02-22 16:49:46 -08:00
Devon Govett
f3c6e890b2 Release v0.4.2 2014-02-19 12:04:42 -08:00
Devon Govett
4257e69e07 Fix typo 2014-02-19 12:02:57 -08:00
Devon Govett
8139b4fa30 Add missing word count 2014-02-19 12:02:53 -08:00
Devon Govett
55ffe97f03 Merge pull request #200 from dariusk/master
Correcting for edge case in line wrapping
2014-02-19 11:58:50 -08:00
Darius Kazemi
d7336a4bd0 "Dangling" single word lines now get emitted
This commit adds an extra emit to a required line break if there's a "dangling" word on the end.
2014-02-19 14:54:47 -05:00
Darius Kazemi
6637dca8eb Correcting for edge case in line wrapping
If you look at the flow of the `eachWord` function, you'll notice that we add the word to the buffer if the width of the word `w` is less than the space available.

There's an edge case where `linebreaker` says that a line break is required on a word (because of a manual break: `theword\n`) and the width of the word being considered is greater than `spaceLeft`. In the current pdfkit, if this is the case:

 * we do not append the word to the buffer
 * we emit the line
 * we break and move on to the next line, starting with a clean line

This omits the word entirely.

This commit makes it so that we only break the line and start with a clean line if we already had the space to write the line to the buffer. Otherwise, we append the word to the buffer and go to a new line.
2014-02-19 13:38:50 -05:00
Devon Govett
5a530712c3 Fix some typos 2014-02-18 08:26:54 -08:00
Devon Govett
c77d23f1f9 Use old (working) version of codemirror 2014-02-18 08:26:42 -08:00
Devon Govett
b381bd5b05 npm ignore docs 2014-02-18 00:36:43 -08:00
Devon Govett
3c79667337 Add dev dependencies for generator script 2014-02-18 00:34:08 -08:00
Devon Govett
82dd9fc7b7 Update readme with link to new pdf guide 2014-02-18 00:24:31 -08:00
Devon Govett
7825ed41dd Override continued link in doc generator 2014-02-18 00:12:35 -08:00
Devon Govett
a5a9ac4da8 Release 0.4.1 2014-02-18 00:01:11 -08:00
Devon Govett
e11a800af3 Add new self-generating guide
Takes Literate CoffeeScript (Markdown) files and generates a PDF. Includes syntax highlighting for the examples, and even runs them to show the results inline. Good example of new rich text features. Eventually, the website will be generated from the same Markdown files.
2014-02-17 23:43:22 -08:00
Devon Govett
a0901c75a0 Make sure we use global.setImmediate 2014-02-17 23:20:32 -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
415d5a371a Reset continuedX if there is more than one line 2014-02-17 13:53:39 -08:00