-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Exception with long seqs #220
Comments
I can reproduce the issue locally. Unfortunately, there really isn't much to go on from the stack trace, but it appears that it might be a bug in the underlying OpenPDF library. |
Thanks, good that you could reproduce locally. It was driving me crazy. Anyway, I was wondering about the number 46, which seemed overly arbitrary to me. Then I had a look at the PDF for the number 45. The whole page was filled. So my hypothesis now is that the 46th line is causing a new page, and that this somehow break things. I then tried some other numbers, and the number 90 gave me the same NullPointerException, but this time with a stacktrace (I have no idea why). Observe: (let [things (repeat 90 {:foo "foo"})
show-things (fn [{:keys [foo]}] [:paragraph foo])]
(clj-pdf.core/pdf
[{}
(map show-things things)]
"doc.pdf")) Output:
Line 167 of (defn write-header-footer-content-row [{:keys [table x y]} ^PdfWriter writer]
(.writeSelectedRows ^PdfPTable table (int 0) (int -1) (float x) (float y) (.getDirectContent writer))) Seems one or more of the locals here are nil. I put a breakpoint on the line that invokes this function and got this: So, it seems Does this give some hint as to what might be wrong? |
I ran into an exception while rendering a long-ish sequence of things in a PDF. I can reproduce the exception in a more minimal fashion with this code:
On my machine, this produces:
The value of
*e
in the REPL is:Not much info there. But if I change the number 46 to 45, it works. I converged on these numbers by trial and error.
The text was updated successfully, but these errors were encountered: