Free Support Forum - aspose.com

Table- Row or Cell Height

I need to create PDFs for two reasons. The first is reporting and I’ve successfully written six different reports so far (thank you Aspose…though still waiting on a way to enforce embedded tables not to break across pages). My next challenge though is labels!

Part of the reason I started using Aspose.Pdf is because of the demo labels report. But now I’ve just realized there is no way to enforce a Height setting on tables, rows or cells. Is this something that could/will be implemented soon?

Has anyone else created labels with this product and/or have any recommendations? I think my best bet so far is to to figure out how many pixels in height a specific text paragraph takes up. Has anyone done the math, ie an 8pt Times-Roman paragraph segment is X pixels in height? I hope that’s a constant.

I’d like to hear everyone’s input. Maybe I’m missing a simple solution?

Thanks!

Chris

Could you insert a blank image in one of the cells? It should force the height of the cell to match the image.

That would probably work, good idea.

Hmmm, I guess I’ll have to upgrade up to the Standard edition to take advantage of the ‘hidden’ image :wink:

Thanks! Don’t stop here though everyone, what other suggestions are out there?

Chris

Well, I guess if you can’t insert images that would be a problem.

If you are looking for work arounds, another option would be to always include the right number of text lines to get the size you need. Of course if there is no text, the cell won’t alot the space for the line. But, if you had an extra cell with the right number of lines of text in it and the color of the text was white…

Another possible work around would be to create a “Graph” object of the correct size followed immediately by a Text object which has a negative MarginTop to position it over the top of the graph. I have useed this before and it works nicely.

FYI,

I ended up using the extra cell / image idea. Made a 1x1 pixel image and set the height to however tall the particular label needed to be.

It would be nice if there was a way to make it so the label didn’t grow any bigger when the text extended downwards greater than the height of the image. The extra text would just go off into never never land and the next row’s label would still be in the correct place. As it is right now all the rows below are in the incorrect place. I just have to put in some error handing to now allow more lines of text than the label can hold at the moment.

On a different note, it would be nice if more general information was posted about Aspose.PDF. For example, I at first didn’t realize the pdf was at 72 dpi and was confused at how many pixels were in an inch. Also, it would be nice if there was somewhere to look to see a known list of bugs. I fought with the Table.IsBroken option for several hours the other day…thanks Aspose for fixing it so fast once I mentioned it!

Chris