Skip to content

Commit

Permalink
added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yogthos committed Jul 10, 2016
1 parent a18e0ca commit a717eaf
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -308,6 +308,22 @@ All fields in the metadata section are optional:
}
```

The `:header` and `:footer` keys can also point to a `:table` element. The `:table` key
must point to a `:pdf-table` type element:

```clojure
{:header {:table
[:pdf-table
{:border false}
[20 15 60]
["This is a table header" "second column" "third column"]]}
:footer {:table {:table
[:pdf-table
{:border false}
[20 15 60]
["This is a table header" "second column" "third column"]]}}
```

available page sizes:

```clojure
Expand Down Expand Up @@ -967,6 +983,7 @@ metadata:
* :bounding-box `[width height]`
* :horizontal-align :left, :rigth, :center, :justified
* :title string
* :width number
* :width-percent number (0-100)

```clojure
Expand Down
Binary file modified example.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions project.clj
Expand Up @@ -20,8 +20,8 @@
:profiles {:dev {:global-vars {*warn-on-reflection* true}
:dependencies [[midje "1.8.3"]
[environ "1.0.1"]
[midje-readme "1.0.8"]]
#_[midje-readme "1.0.8"]]
:plugins [[lein-marginalia "0.7.1"]
[lein-midje "3.0.0"]
[midje-readme "1.0.2"]
#_[lein-midje "3.0.0"]
#_[midje-readme "1.0.2"]
[lein-cloverage "1.0.6"]]}})
31 changes: 30 additions & 1 deletion test/clj_pdf/test/example.clj
Expand Up @@ -22,7 +22,7 @@
(rot g2d -30 (draw-tree g2d (* length 0.75) (- depth 1)))
(rot g2d 30 (draw-tree g2d (* length 0.75) (- depth 1)))))))

(pdf
#_(pdf
[{:title "Test doc"
:header "page header"
:subject "Some subject"
Expand Down Expand Up @@ -178,3 +178,32 @@
</svg>"]]

"example.pdf")

#_(pdf
[{:title "Test doc"
:header {:table
[:pdf-table
{:align :left
:border false}
[20 15 60]
["This is a table header" "second column" "third column"]]}
:subject "Some subject"
:creator "Jane Doe"
:doc-header ["inspired by" "William Shakespeare"]

:right-margin 50
:author "John Doe"
:size "a4"
:pages true
:footer {:table
[:pdf-table
{ ;:width 20
:bounding-box [50 100]
:horizontal-align :right
:spacing-before 100}
[10 20 15]
["foo" [:chunk {:style :bold} "bar"] [:phrase "baz"]]
[[:pdf-cell "foo"] [:pdf-cell "foo"] [:pdf-cell "foo"]]
[[:pdf-cell "foo"] [:pdf-cell "foo"] [:pdf-cell "foo"]]]}}
[:paragraph "this is a test"]]
"footer-header.pdf")

0 comments on commit a717eaf

Please sign in to comment.