[scribus] Importing tables

Jean-Paul Gendner jean-paul.gendner at orange.fr
Thu Jun 19 12:44:56 UTC 2014


Hello,

hmm isnt http://wiki.scribus.net/canvas/Create_tables_out_of_csv_data ?

I do not test this script version; however, it is different from the
importcsv2table.py.

+++++++
The differences for my version:
- I corrected a bug. When first column width was different from others,
cells where not juxtaposed properly. Error is in the following line
  hposition=hposition+cellwidthleft #move the position for the next cell
  I replaced cellwidthleft by cellsize.
- I allow specifying a width for each column (only two in original version)
and a height for each row (only one in original version).
- The default values for the widths and heights are calculated to get a
table with the size of the selected frame. If different values are entered,
the default values are updated to finally respect the overall size. However,
different values may be entered. Of course, in this case the table size may
be different from the selected frame.
- Possibility to affect directly a style to all cells. Style must exist when
launching the script.
- Possibility to define a top distance for the texts (distance between top
of textbox and text).

	So much more possibilities are covered: defining width of each
column and height of each row knowing the overall size of the planed table
or knowing individual cells values.

++++++++
	Table cells are normal textboxes, so if a vertically centre function
exist and the corresponding API is available in the new version, it should
work. I am eager to see.

	Thanks,
	Jean-Paul

****************
Jean-Paul Gendner
Site : f5bu.fr
03.88.27.03.44


-----Message d'origine-----
De : JLuc [mailto:jluc at no-log.org] 
Envoyé : jeudi 19 juin 2014 13:01
À : scribus at lists.scribus.info
Objet : Re: [scribus] Importing tables

Le 19/06/2014 12:20, Jean-Paul Gendner a écrit :
> 1) I go to http://wiki.scribus.net and found at least two scripts for
> importing csv files to a table. However, neither was the Importcsv2table

hmm isnt http://wiki.scribus.net/canvas/Create_tables_out_of_csv_data ?

I pasted your modified script there.
Could you explain what are the differences with the original script
so we know without having to study the script ?
It will help testers and core devs to test your script
and maybe merge it in the scribus code.

> 2) In most of the case I will import a table to Scribus, I want that the
> text in each cell is centered horizontally and vertically. The horizontal
> centering is easy to do automatically by using a style. For the automatic
> vertical centering I do not have found a solution at present time.

Scribus 1.5 features vertical centering so this might be the solution,
but i dont know how it works with table cells.
All the more since tables have been completely refactored in 1.5

> I just allow setting the top distance for the texts. However, the number
of lines
> of the texts is not always the same and the height of the cells also is
not
> always the same. So the top distance should be calculated taking into
> account the effective height of the text in each cell.
> So my question: is there an API or function allowing getting the
> height of the entire text in a textbox? Any help will be welcome.

Dont know. If not, post a request on http://bugs.scribus.net

JLuc


___
Scribus Mailing List: scribus at lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net




More information about the scribus mailing list