Message Boards Message Boards

0
|
2482 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Make a Grid of specific physical size?

Posted 2 years ago

I want to make a table with text strings inserted into its cells, and to send this table to a printer to print it on a real paper.

I want the output table size to be, say, 5 cm in width and 10 cm in height, like in the following, where the table is printed on an A4 paper:

enter image description here

I think that a good solution would be to export a pdf file composed of 1 page with the dimensions of the table.

How can this be done?

The following creates a table, but I need some help with specifying its size.

Grid[{
  {"1st text entry"},
  {"2nd text entry"},
  {"3rd text entry"},
  {"4th"},
  {"5th"}
  }
 , Frame -> All
 ]
POSTED BY: Ehud Behar
Posted 2 years ago

If you don't need pixel perfect accuracy, you can use the ItemSize option. Based on your example, this should work pretty well, since all cells look to be the same size. Read the documentation for ItemSize. You'll see that you can set horizontal and vertical size. Probably easiest to just play with some values until you get the size you want.

If you want pixel perfect accuracy, you'll probably be better off using the various Image manipulation functions. Turn your strings into images, pad them to get the dimensions you want for each cell, and then ImageAssemble them.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract