Code Monkey home page Code Monkey logo

Comments (5)

phax avatar phax commented on May 30, 2024

@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:
grafik

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:
grafik

hth

from ph-pdf-layout.

martin19 avatar martin19 commented on May 30, 2024

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.

phax avatar phax commented on May 30, 2024

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 class PLDebugLog 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.

martin19 avatar martin19 commented on May 30, 2024

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.

stale avatar stale commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.