Skip to content

Commit d0cfd30

Browse files
committed
update pdfkit, use dpi setting to fix font size bug, update contract language
1 parent 3e86868 commit d0cfd30

6 files changed

+47
-18
lines changed

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ DEPENDENCIES
1616
mustache
1717
pdfkit
1818
redcarpet
19+
20+
BUNDLED WITH
21+
1.12.5

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ Similar clauses at <https://gist.github.com/postmodern/3242224>
66

77
Disclaimer: I AM NOT A LAWYER. You should run all this by your own legal counsel.
88

9+
# Setup
10+
11+
MacOS:
12+
```
13+
brew install caskroom/cask/wkhtmltopdf
14+
bundle install
15+
```
16+
17+
# Usage
18+
19+
1. edit `contract.md`, especially the variables at the very top of the file
20+
2. `bundle exec ruby process.rb contract.md`
21+
3. open `contract-2000-11-22.pdf` (or whatever today's date is) and proofread it
22+
23+
```
24+
925
<p xmlns:dct="http://purl.org/dc/terms/">
1026
<a rel="license"
1127
href="http://creativecommons.org/publicdomain/zero/1.0/">

contract-2018-05-14.pdf

24 KB
Binary file not shown.

contract-style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
body {
22
font-family: Times, serif;
3-
font-size: 85%;
3+
font-size: 11pt;
44
}
55
h1:not(:first-child) {
66
page-break-before: always;

contract.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@
1010
deposit: 1000
1111
late_fee: five percent (5%)
1212
net_days: ten (10)
13+
work_for_hire: false
1314

1415
# CONSULTING AGREEMENT
1516

16-
This CONSULTING AGREEMENT (the Agreement) is made as of {{effective_date}} (the Effective Date) by and between {{consultant_name}} (Consultant) and {{client_name}} (Client).
17+
This CONSULTING AGREEMENT (the "Agreement") is made as of {{effective_date}} (the "Effective Date") by and between {{consultant_name}} ("Consultant") and {{client_name}} ("Client").
1718

18-
WHEREAS, Client desires to engage Consultant to perform technical consulting services (the Services), and Consultant desires to perform such Services.
19+
WHEREAS, Client desires to engage Consultant to perform technical consulting services (the "Services"), and Consultant desires to perform such Services.
1920

20-
NOW, THEREFORE, Consultant and Client (collectively the Parties), for good and valuable consideration, the receipt of which is hereby acknowledged, agree as follows:
21+
NOW, THEREFORE, Consultant and Client (collectively the "Parties"), for good and valuable consideration, the receipt of which is hereby acknowledged, agree as follows:
2122

2223
1. Services.
23-
For a period of approximately {{duration}} commencing on the Effective Date (or for such longer period as the Parties may agree in writing, which need not be a formal amendment to this Agreement), Consultant will consult and work with Client’s personnel on such specific assignments as are provided from time to time by Company in email or other written directions (the Services). Consultant will perform the Services in a diligent, professional and workmanlike manner, consistent with industry standard.
24+
For a period of approximately {{duration}} commencing on the Effective Date (or for such longer period as the Parties may agree in writing, which need not be a formal amendment to this Agreement), Consultant will consult and work with Client’s personnel on such specific assignments as are provided from time to time by Company in email or other written directions (the "Services"). Consultant will perform the Services in a diligent, professional and workmanlike manner, consistent with industry standard.
2425
Consultant will not perform or invoice Client for Services in excess of {{max_hours}} hours per week without Client’s prior written consent.
2526

2627
2. Fees & Expenses.
@@ -30,19 +31,22 @@ Consultant will transmit an invoice to Client every two weeks, and Client will p
3031
Late payments shall be subject to a late payment fee of {{late_fee}} of the amount due.
3132

3233
3. Intellectual Property.
33-
[Coding:]
34-
As between Consultant and Client, Consultant’s original work product prepared for Client in connection with the Services (the “Work Product”) shall be deemed a “work made for hire” under United States Copyright Law. To the extent such Work Product cannot be deemed a work made for hire, Consultant hereby assigns, sells and conveys all right, title and interest in and to such Work Product to Client in exchange for Client’s covenants hereunder.
35-
Notwithstanding the foregoing, Client understands and agrees that: (a) Ruby on Rails is an open source software (“OSS”) platform; and (b) Consultant’s Work Product shall be subject to the terms and conditions of the applicable Ruby on Rails or other OSS license.
36-
<br>
37-
[Teaching:]
38-
As between Consultant and Client, Consultant’s original work product prepared for Client in connection with the Services shall be deemed the property of Consultant, as long as such work violates neither the conditions in this Section, nor the Confidentiality provisions in Section 5.
34+
{{#work_for_hire}}
35+
(a.) As between Consultant and Client, Consultant’s original work product prepared for Client in connection with the Services (the "Work Product") shall be deemed a "work made for hire" under United States Copyright Law.
36+
(b.) To the extent such Work Product cannot be deemed a work made for hire, Consultant hereby assigns, sells and conveys all right, title and interest in and to such Work Product to Client in exchange for Client’s covenants hereunder.
37+
{{/work_for_hire}}
38+
{{^work_for_hire}}
39+
(a.) As between Consultant and Client, Consultant’s original work product prepared for Client in connection with the Services (the "Work Product") shall be deemed the property of Consultant, as long as such work violates neither the conditions in this Section, nor the Confidentiality provisions in Section 5, nor the Open Source Software provisions in Section 4.
40+
(b.) Upon acceptance by Client, Consultant hereby grants to Client, effective immediately, a worldwide, non exclusive, sublicenseable (through multiple tiers), assignable, royalty free, perpetual, irrevocable, fully-paid right to use, reproduce, distribute (through multiple tiers), create derivative works of, publicly perform, publicly display, digitally perform, make, have made, modify, sell, offer for sale and import the Work Product in any media now known or hereafter known, solely as a part of or as incorporated into Client's offerings.
41+
{{/work_for_hire}}
42+
(c.) Notwithstanding the foregoing, Client understands and agrees that: (i) Consultant may use and contribute patches to Open Source Software (OSS) projects without prior approval; and (ii) Consultant’s Work Product shall be subject to the terms and conditions of the applicable project's OSS license and Section 4.
3943

4044
4. Open Source Software.
41-
It is understood that Consultant may, at Consultant's discretion, make use of libraries from various "Open Source" software products during the course of work.
45+
It is understood that Consultant may, at Consultant's discretion, make use of libraries from various Open Source Software (OSS) products during the course of work.
4246
Consultant may submit back to such libraries any improvements ("patches") made to the Open Source Software during the course of work, as long as the submission of such patches violates neither the conditions in this Section, nor the Confidentiality provisions in Section 5.
4347

4448
5. Confidentiality.
45-
Consultant agrees to maintain in confidence Client’s confidential and proprietary information (Confidential Information), and not to disclose or use such information other than in connection with Consultant’s Services hereunder.
49+
Consultant agrees to maintain in confidence Client’s confidential and proprietary information ("Confidential Information"), and not to disclose or use such information other than in connection with Consultant’s Services hereunder.
4650

4751
6. Term & Termination.
4852
This Agreement is effective as of the Effective Date set forth above, and shall continue until terminated, either immediately due to a material breach or either party’s bankruptcy, insolvency or assignment for the benefit of creditors, or upon thirty (30) days written notice by one party to the other for any other reason. The termination or expiration of this Agreement shall not relieve Client of its obligations to pay Consultant for any Services rendered or expenses incurred prior to termination, or relieve Consultant of his obligation to maintain the confidentiality of Client’s Confidential Information. Sections 3, 4, 5, 6, 7, 8, and 9 shall survive the termination and/or expiration of this Agreement.
@@ -59,7 +63,7 @@ If any provision of this Agreement shall be deemed unenforceable, it shall be re
5963

6064
IN WITNESS WHEREOF, the Parties have executed this Agreement as of the Effective Date.
6165

62-
CONSULTANT
66+
"CONSULTANT"
6367

6468

6569

@@ -68,7 +72,7 @@ By: ____________________________________________
6872
{{consultant_name}}
6973

7074

71-
CLIENT
75+
"CLIENT"
7276

7377
{{client_name}},
7478
a {{client_location}} corporation

process.rb

+9-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def usage
1717
if body.each_line.first =~ /^\s+\w+:/
1818
headers, body = body.split("\n\n", 2)
1919
scope = Hash[headers.each_line.map do |line|
20-
line.split(':', 2).map { |x| x.strip }
20+
line.split(':', 2).map { |x| x.strip }.
21+
map { |x| ["false", "0", "no"].include?(x.downcase) ? false : x }
2122
end]
2223
else
2324
scope = {}
@@ -69,9 +70,14 @@ def usage
6970
# http://asciicasts.com/episodes/220-pdfkit
7071

7172
require 'pdfkit'
72-
kit = PDFKit.new(html, :page_size => 'Letter')
73+
kit = PDFKit.new(html,
74+
page_size: 'Letter',
75+
print_media_type: true,
76+
dpi: 400)
7377
kit.stylesheets << "contract-style.css"
74-
file = kit.to_file("contract.pdf")
78+
79+
today = Date.today.iso8601
80+
file = kit.to_file("contract-#{today}.pdf")
7581

7682
ap file
7783
`open #{file.path}`

0 commit comments

Comments
 (0)