Code Monkey home page Code Monkey logo

Comments (28)

rkusa avatar rkusa commented on August 16, 2024 1

I've pushed a minHeight option today
@chadRoberge Since those are features I am not needing for my own use-case, no ETA, sorry

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

Tables do not support fixed heights, yet :-/

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

@rkusa any way I can help to land that feature?

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

@knownasilya Yes, tell me how you'd expect the fixed height to work. E.g. should the last row take the remaining space, or should the rows be distributed among the fixed height, and how should content bigger than the fixed height be handled?

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

cc @ismyrnow

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

@rkusa seems like if the table height is set, the last row should fill i the remaining height, otherwise just use the height set.

If content overflows it should probably be hidden, since you are setting a fixed height.

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

I took a look at how HTML and in comparison Pages and Word handle these situations. All three distribute the height among their rows and the height cannot be smaller than the content.

@knownasilya May I ask what your use case for a fixed height table in a PDF is?

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

@rkusa generating mailing labels, which come in specific sizes, since they are pre-cut stickers.

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

That is, you'll also need some kind of vertical alignment option, doesn't you?

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

Not sure, but we could just start an implementation and see what's needed from there. Make it iterative, or just good enough for 1.0 and gain use cases for 2.0

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

I've added a height option for rows and cells. A height option for the whole table is still on my todo

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

Nice, I'll give it a try

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

So that works, but if the content goes outside of the height it breaks the heights..

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

@schurb Yes, imitates the behaviour found in HTML, Word, Pages, ... for your use case there is probably the need of an CSS overflow equivalent. I'll have a look ...

from pdfjs.

schurb avatar schurb commented on August 16, 2024

@rkusa I think you mean @knownasilya :)

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

Haha... note to myself: dont answer issues before the first coffee ☕

from pdfjs.

schurb avatar schurb commented on August 16, 2024

Jep, such a universal rule ☕

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

Haha, and here I go breaking it. :neckbeard:

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

I've started to implement the overflow: hidden option. Example:

  var table = doc.table({
    borderWidth: 1,
    borderColor: 0xdddddd,
    padding: 10,
    widths: [200]
  })

  var tr = table.tr({ height: 220, overflow: 'hidden' })
  tr.td(fixtures.lorem.short)

It is not well tested, yet. However, if you don't mind, it would be nice if you could test it against your usecase.

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

2.0.0-alpha.1 has a feature regression here, both height and overflow have to be re-implemented

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

Was this fixed in 2.0 release? Or still for 2.1?

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

Still for 2.1, sorry 😔

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

Wait so height doesn't work now as well? If so I might not be able to update to 2.0 yet, aww..

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

Yes, height does not work as well. If 1.x works fine for you, I don't think you are missing out one something with 2.0, yet

from pdfjs.

chadRoberge avatar chadRoberge commented on August 16, 2024

Looking to use this library to generate checks, will also need the fixed height, and looking forward to it. There a time frame for 2.1?

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

What's the status here? Does minHeight replace what height used to be? What about overflow?

from pdfjs.

rkusa avatar rkusa commented on August 16, 2024

@knownasilya I still have it in the back of my mind, but no update yet, I am afraid.

from pdfjs.

knownasilya avatar knownasilya commented on August 16, 2024

Would love to get both of these back. Finally upgraded due to node versions, but now having issues due to both of these missing.

from pdfjs.

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.