Comments (5)
@martin19 thanks for pointing that out. I added a small example snippet that should outline the issue.
When I run this, it creates the following output:
issue21.pdf
If you are referring to the issue, that the cell border is "broken", than I would say, that works as designed, because the next row starts again evenly. The height of the row is the maximum height of the contained cells. But the border is pained around each cell, and not around each row.
The only error that I could discover is the bottom padding of the inner table - depicted with a black block in the below image:
So please clarify what exactly your expectations are.
If you dislike the border than I recommend to change new PLTableCell (new PLText (...)).setPadding
to new PLTableCell (new PLBox (new PLText (...)).setPadding ())
- so to wrap the text in a "PLBox" and put the padding on the box instead,
See this PDF for comparison:
issue21a.pdf
Looking like this:
hth
from ph-pdf-layout.
hi @phax I've found the solution you mention by putting the padding on the inner element of the cell, thanks for pointing that out. I think I expected all cells in a row to have equal height always (including borders like html tables). You can call this a feature to have this kind of staircase table - I don't wanna bargain on that. The reason I'm doing all this is to "emulate" rowspan/colspan: the inner table has no outer border so it beautifully blends with the cell borders of the outer table - Is there a better way to do this?
I've only had some minor issues (yet) that might interest you:
- otf fonts don't seem to work with the library (there is an exception thrown) while ttf files work well
- sometimes there are "blank" pages in the PDF (I assume there might be some margin of another element above on this page). I'll need to debug that.
- had a bit of a hard time to implement a full size page header with page margin - I finally got it to work with document padding
Thanks you for your work.
from ph-pdf-layout.
Thanks for your feedback.
What you may want to emulate is "padding" on the row of the outer table I guess. This can be done by calling setPadding
which will effectively set it on all contained cells...
- Regarding the fonts: I am limited on what is offered by the FontBox project which is part of PDFBox - http://pdfbox.apache.org/ - I recommend you place any features requests there
- Regarding the blank pages: with
PLDebugRender.setDebugRender(true)
you can create helper lines etc. that might help you identify the issue. It outlines page sets, block elements and inline elements with different colors. With classPLDebugLog
you can increate debug logging. - What do you mean with "Full size page header" - you mean spawning the full width? But anyway, glad you were able to resolve it....
from ph-pdf-layout.
Hi @phax, thank you for the setDebugRender tip. That will probably make it lots easier to see what is going on. With full size header I actually meant full-width.
There is a problem I've been thinking about. Is it possible to determine the actual position of the currently rendered object in the page? I'd like to implement a policy for inserting page breaks depending on the amount of content that is on the current page. If yes - great - if no what would be the effort to implement such thing.
Thank you!
from ph-pdf-layout.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from ph-pdf-layout.
Related Issues (20)
- Two tables on the same PDF HOT 9
- Integrating PDFBox and XChart with ph-pdf-layout HOT 6
- How to embed the image/icon in the Table while creating PDF HOT 4
- How to correct display Chinese? HOT 19
- There is no vertical center style when I use Chinese font HOT 13
- Export table as image HOT 5
- Expose PDPageContentStreamExt in PDPageContentStreamWithCache? HOT 2
- font Weight HOT 2
- Render tables with text rotated by 90 degrees HOT 11
- Adding page number to the footer HOT 2
- No splitting performed when nesting non-splittable within splittable PLVBox HOT 3
- PLTableCell.createEmptyCell() with column span? HOT 5
- Vertically splittable table HOT 7
- Issue with Centering Text in Single Line HOT 2
- Having issues importing and using HOT 40
- Need to determine how many table rows can fit on the current page HOT 10
- Cut Text like "overflow:hidden" in css HOT 6
- No assertions for pdfs created during tests? HOT 6
- PLText rendering problem when horizontal alignment is set to JUSTIFY HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ph-pdf-layout.