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

Table being truncated after first page #203

Closed
pmonks opened this issue Jul 4, 2020 · 4 comments
Closed

Table being truncated after first page #203

pmonks opened this issue Jul 4, 2020 · 4 comments

Comments

@pmonks
Copy link

pmonks commented Jul 4, 2020

My understanding (which may be wrong) is that a [table] that's too big to fit on one page will be automatically split across pages, however I'm not seeing that behaviour. Instead, after the first page the table contents are truncated, and don't appear in the PDF file at all.

Steps to Reproduce:

Download large-table-edn.zip, unzip it to produce large-table.edn, then:

$ clj -Sdeps '{:deps {clj-pdf #:mvn {:version "2.5.3"}}}'
Clojure 1.10.1
user=> (require '[clojure.java.io :as io])
nil
user=> (require '[clojure.edn :as edn])
nil
user=> (require '[clj-pdf.core :as pdf])
nil
user=> (def pdf-data (edn/read (java.io.PushbackReader. (io/reader "large-table.edn"))))
#'user/pdf-data
user=> (pdf/pdf pdf-data "large-table.pdf")
nil

Open large-table.pdf and compare to the source data - you should see that the last visible row in the table is the row with the text "Scheduled start 8:15 PM UTC:"; the following 14 rows contained in the source data are missing.

@yogthos
Copy link
Collaborator

yogthos commented Jul 4, 2020

Looks like it's caused specifically by setting the background color in the header, and removing {:background-color [200 200 200]} renders all the items as expected. I bumped up to the latest version of openpdf, and that appears to fix the problem on my end. I just pushed out 2.5.4, let me know if that fixes the problem for you.

@pmonks
Copy link
Author

pmonks commented Jul 6, 2020

Awesome! Will take it for a spin tonight.

It didn’t even occur to me to mess with the background colour of the table heading row- that’s bizarre. 😉

@yogthos
Copy link
Collaborator

yogthos commented Jul 6, 2020

Yeah, that certainly was unexpected. :)

@pmonks
Copy link
Author

pmonks commented Jul 6, 2020

Looking great in my tests here - thanks for hunting this down!

@pmonks pmonks closed this as completed Jul 6, 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

No branches or pull requests

2 participants