Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sufficient spacing after header #198

Merged
merged 9 commits into from
Jun 7, 2020

Conversation

MawiraIke
Copy link
Contributor

@MawiraIke MawiraIke commented Jun 6, 2020

Fixes #182

Add

This code automatically calculates the height of the header table and starts writing the body (excl. header) after (+ calculated-height top-margin). One can however specify a custom height after which the body is written hence (+ custom-height top-margin). This can be used to add padding below the table. However, when the given custom height is lesser than the height of the table, the table and the content will overlap as occurs with the current code. Fair to note that the custom height provided is not used to change the height of the table, but just assumed to be the height of the table by the code, if it exists.

Example of adding padding

(pdf
  [{:header {:table
             [:pdf-table
              {:header [[[:pdf-cell {:colspan 2}
                          [:paragraph {:align :center :style :bold} "Customer Orders"]]]
                        [[:phrase {:style :bold} "Name"]
                         [:phrase {:style :bold} "Order Amount"]]]}
              [50 50]
              ["Joe" "$20.00"]
              ["Bob" "$7.50"]
              ["Mary" "$18.90"]]
             :height 130}}    ;; Add key height, this key can be omitted for automatic
   [:list {:roman true}
    [:chunk {:style :bold} "a bold item"]
    "another item"
    "yet another item"]
   [:phrase "some text"]
   [:phrase "some more text"]
   [:paragraph "yet more text"]]
  "ike-doc.pdf")

Addition of images to headers
Add underlines option for chunks (clj-pdf#193)
Fix for vertical alignment in pdf-cell
Signed-off-by: Ike Mawira <mawiraike@gmail.com>
Signed-off-by: Ike Mawira <mawiraike@gmail.com>
Signed-off-by: Ike Mawira <mawiraike@gmail.com>
@yogthos yogthos merged commit 2e98480 into clj-pdf:master Jun 7, 2020
@yogthos yogthos mentioned this pull request Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding sufficient spacing after header
2 participants