178 Commits

Author SHA1 Message Date
Pedro Teixeira
d4604b4a74 fixes #433 2015-10-20 09:53:52 +01:00
Devon Govett
a04155fc76 != -> isnt 2015-04-02 15:27:15 -07:00
Brian Reavis
d28983d0ee Allow automatic first page to be disabled (#65). 2015-04-02 15:19:33 -06:00
Devon Govett
22a9bfdfab Get rid of PDFObject.s and use JS String object to represent PDF strings
Also improves escaping based on the spec, and detects unicode strings automatically, which are converted to UTF16-BE.
2015-03-19 20:22:44 -07:00
Devon Govett
1e0e7f9567 Merge branch 'Fix_PDF_Object_Output' of https://github.com/Nathanaela/pdfkit into Nathanaela-Fix_PDF_Object_Output
Conflicts:
	lib/object.coffee
2015-03-19 20:19:02 -07:00
Lee Symes
c0abc88a64 Fixed regression caused by CoffeeScript 1.9.0+.
This fixes #376
2015-03-17 16:41:32 +13:00
Nathanael Anderson
cba6f80b4e Update object.coffee code to eliminate .isString and .isRaw hacks and replace with the Buffer object so that anything can be supported. 2015-03-16 13:57:06 -05:00
Nathanael Anderson
ca8c3c38ff Fix missing object.coffee outputs. 2015-03-15 20:29:42 -05:00
Denys Koch
87ddddfc31 Fixed wrong XRef size 2014-12-11 12:25:48 +01:00
Laszlo Balogh
18927a5d91 Fixed diminishing left-margin 2014-11-21 16:37:30 +00:00
Devon Govett
b36c548a0d Merge pull request #308 from ef4/continued-breaker
Avoid unnecessarily breaking inside words when using `continued`
2014-09-15 14:05:52 -04:00
Devon Govett
38e5b73e58 Move TTF table tags to prototype 2014-09-15 11:35:42 -04:00
Devon Govett
2eb9fa3aa2 Merge branch 'master' of github.com:yelouafi/pdfkit into yelouafi-master 2014-09-15 11:32:13 -04:00
yelouafi
9f4c6345c5 Moved @tag definition to the derived Table constructors 2014-09-13 17:30:42 +00:00
yelouafi
c7c20ef6b7 removed @constructor.name line, corrected @tag params 2014-09-12 21:47:46 +00:00
Edward Faulkner
838afe15a0 Infinite loop when first word is longer than line 2014-09-12 16:25:12 -04:00
Edward Faulkner
1a5df016ce Avoid unnecessarily breaking inside words when using continued
`continued` is implemented by temporarily shortening the lineWidth,
which can cause the linewrapper to break inside words when that's not
really necessary.
2014-09-12 15:11:56 -04:00
Devon Govett
95b149e16d Minor style changes 2014-09-12 15:09:49 -04:00
Edward Faulkner
1c48bad333 bufferedPages support 2014-09-12 14:59:45 -04:00
yelouafi
7f8714a40f TTFFont.parse should call *Table constructors with explicit @tag param 2014-09-12 18:34:44 +00:00
Devon Govett
8383dee3cb Merge pull request #303 from ef4/blank-ascender
Prevent missing ascender from breaking layout
2014-09-11 21:05:09 -04:00
Devon Govett
33920c3f2a Merge pull request #301 from ef4/center-spacing
Fix center-aligned character spacing
2014-09-11 19:51:10 -04:00
Edward Faulkner
3acfa5833d prevent missing ascender from breaking layout 2014-09-11 19:31:21 -04:00
Edward Faulkner
3e19194802 Fix center-aligned character spacing 2014-09-11 16:09:54 -04:00
Edward Faulkner
5b433d808a fix indent with continued 2014-09-11 13:34:51 -04:00
Devon Govett
09ed15b2e4 Fix unicode annotations 2014-08-29 11:49:20 -04:00
Devon Govett
3418299ac7 Merge pull request #277 from mishoo/fix-reading-uint32
Fix reading UInt32
2014-08-16 09:52:56 -04:00
Mihai Bazon
b60fe860e0 Fix reading UInt32
In JS, 0x80 << 24 yields a negative result.  Also, 0x80000000|0 < 0.
Bitwise ops should be avoided for very long unsigned ints.
2014-08-16 11:57:54 +03:00
Mihai Bazon
e61366b37f Fix reading cmap table
The data offset must be saved before parsing one entry and restored
thereafter.  Otherwise only the first table is parsed properly, and garbage
is returned for the rest.  Fails on i.e. georgiai.ttf.

When reading the glyphIds, divide count by 2 (we read 16-bit words).
2014-08-16 11:50:52 +03:00
Devon Govett
1241997715 Refactor font loading code and add support for ArrayBuffers 2014-07-29 09:42:48 -07:00
Aaron Fischer
c2c61bb2e2 added support for add font as Uint8Array 2014-07-29 09:15:39 -07:00
Devon Govett
e58a7ce809 Formatting 2014-07-14 20:48:00 -07:00
jkol
64df00fa13 Added "valign" option to image "fit" scaling
valign can be set to "center" or "bottom" now and when "valign" === "center" is combined with "align" === "center" any aspect ratio image can be centered into a bounding area.
2014-07-14 18:23:11 -05:00
Ryan Wersal
c77add8f56 Remove text state handling as it doesn't surive graphic stack saves/restores
Saving and/or restoring the graphics state causes each text object to have to
reinitialize that text state. As a result, the mode/characterSpacing commands
would not get re-added until their value(s) had changed.
2014-05-10 01:11:06 -05:00
Ryan Wersal
aadc589a62 Improve sizing of text underline 2014-05-09 00:05:17 -05:00
Ryan Wersal
acc0a2e4ba Use a regex to capture the base64 encoded string 2014-05-06 00:43:02 -05:00
Ryan Wersal
2b34173dec Add ability to add base64 URI images 2014-05-05 22:47:33 -05:00
Devon Govett
a6f6f4df8a Don't use trimRight since it isn't supported in IE 2014-04-14 09:58:26 -07:00
Devon Govett
6e447cae7a Don't embed fonts that haven't been referenced 2014-04-13 19:54:18 -07:00
Devon Govett
22499ee4bd Include a static list of standard fonts so they can be included by browserify/brfs 2014-04-12 20:48:29 -07:00
Devon Govett
78946e97fc Rework mixin so it can be statically compiled by browserify 2014-04-12 20:47:54 -07:00
Devon Govett
98489d64a8 Store the font name 2014-04-12 20:45:42 -07:00
Devon Govett
4b8b031188 Don't embed fonts until they are actually used 2014-04-12 20:45:15 -07:00
Devon Govett
bb9b77cb82 Allow loading fonts from Buffers in addition to filenames 2014-04-12 20:44:19 -07:00
Devon Govett
801981728c Make AFMFont.open different from constructor 2014-04-12 20:35:14 -07:00
Devon Govett
8c51ee077f Make sure that sfnt key exists in dfont so we don't throw random errors 2014-04-09 23:44:31 -07:00
Devon Govett
f463512b2f Don't embed fonts more than once 2014-04-09 23:41:40 -07:00
Devon Govett
87fd69b7e5 Don't overwrite cmap method 2014-04-09 23:41:06 -07:00
Devon Govett
ae28782eb1 Fix writing indexed PNG palettes 2014-04-09 09:51:59 -07:00
Devon Govett
876db9e067 Don't set the Length key on images. It will be set by the PDFReference class automatically 2014-04-09 09:51:43 -07:00