Comments (28)
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.
Tables do not support fixed heights, yet :-/
from pdfjs.
@rkusa any way I can help to land that feature?
from pdfjs.
@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.
cc @ismyrnow
from pdfjs.
@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.
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.
@rkusa generating mailing labels, which come in specific sizes, since they are pre-cut stickers.
from pdfjs.
That is, you'll also need some kind of vertical alignment option, doesn't you?
from pdfjs.
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.
I've added a height
option for rows and cells. A height
option for the whole table is still on my todo
from pdfjs.
Nice, I'll give it a try
from pdfjs.
So that works, but if the content goes outside of the height it breaks the heights..
from pdfjs.
@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.
@rkusa I think you mean @knownasilya :)
from pdfjs.
Haha... note to myself: dont answer issues before the first coffee ☕
from pdfjs.
Jep, such a universal rule ☕
from pdfjs.
Haha, and here I go breaking it.
from pdfjs.
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.
2.0.0-alpha.1
has a feature regression here, both height
and overflow
have to be re-implemented
from pdfjs.
Was this fixed in 2.0 release? Or still for 2.1?
from pdfjs.
Still for 2.1, sorry 😔
from pdfjs.
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.
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.
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.
What's the status here? Does minHeight
replace what height
used to be? What about overflow
?
from pdfjs.
@knownasilya I still have it in the back of my mind, but no update yet, I am afraid.
from pdfjs.
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)
- Error: Using spaces or \t at the beginning of a line when using Chinese will result in no line breaks HOT 1
- ExternalDocument can not create pdf from buffer HOT 1
- TypeError: Cannot read property '12' of undefined HOT 11
- Can I create a large pdf without loading the entire file into memory? HOT 1
- Missing outline when merging PDF files HOT 1
- how can I extract contents from a pdf HOT 1
- Downscale images in external PDF HOT 1
- Cannot catch error in asBuffer() HOT 21
- imported in .vue file but giving issue HOT 1
- Combined PDF size is bigger than the originals HOT 2
- Fragments are appearing in wrong order... HOT 1
- Invalid throw code in text._render HOT 1
- Issue with Inaccurate Text Highlighting in PDF Search Using ng2-pdfjs-viewer - Version 13 HOT 1
- The add() method of the table cell text method does not respect the "textAlign" or "alignment" properties HOT 1
- How do I set the font My characters are now garbled ? HOT 1
- Improve client-side support HOT 1
- Failed to add document containing lexer HOT 1
- Crash when processing PDF using nodejs HOT 2
- Underline does not seem to work well
- I get Process error while using this library in react js
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 pdfjs.