Scribus Forums

Scribus => Layout Issues => Topic started by: Farland on April 05, 2018, 05:47:20 am

Title: Problems with tables as images
Post by: Farland on April 05, 2018, 05:47:20 am
Okay so I see people on here saying that you shouldn’t use tables in Scribus, because they aren’t really ready for prime time. And indeed I have had tables crash Scribus multiple times. But here’s the problem I’m up against. I can do tables at 300 dpi using MS Word, which I then export to a pdf, open in PS, save as a tiff, and insert as an image. That works fine, except I want to create the same document for print with all the images at 300 dpi and then also for digital, with the images capped at a lower resolution. You see the problem, I’m guessing: the text in tables in the digital file doesn’t look great, because the tables are being downgraded in resolution. Any idea what I could do to address this problem?
Title: Re: Problems with tables as images
Post by: GarryP on April 05, 2018, 11:39:14 am
Why are you converting the PDF to a TIFF before putting it into an image frame?
Are you having problems when inserting the PDF itself into an image frame?
The preview you see on-screen isn't high resolution but the output from Scribus should be fine.
Title: Re: Problems with tables as images
Post by: a.l.e on April 05, 2018, 12:01:17 pm
Here my "best choice", between the multiple ways one has for getting a table into Scribus:

https://webmshare.com/jq8dL

- create the table in Office
- export it to PDF
- open the PDF with Inkscape
- (shrink it from document to "table" size)
- export it to (plain) SVG
- import the SVG in Scribus
- (ungroup the SVG until it's not possible anymore and regroup it to (partially) avoid artifacts)
- place the table as a vector (text will not be editable) in your document.

With Scribus 1.5 you can try to directly load the PDF as a vector.
Title: Re: Problems with tables as images
Post by: Farland on April 05, 2018, 03:26:54 pm
Thank you both.

Gary, I hadn’t tried importing the PDF straight. Would that help my issue or do you mean just in terms of a faster workflow?  I’m aware Scribus shows a lower res preview to keep the app functioning quickly. What I mean is the tables won’t look good for screen when I export the final PDF with the images lower than 300 dpi.

a.l.e.: I’m using 1.5.3. If I import the svg file as a vector (how do I import it, btw? do I use the image frame to do that?) will it maintain resolution when I lower the res if all the other image files upon export? If so that would work for me if Scribus can handle it.
Title: Re: Problems with tables as images
Post by: GarryP on April 05, 2018, 04:24:44 pm
If Office exports the tables as vectors (and fonts?*), and Scribus treats the vectors (and fonts*) in the "imported" PDF properly, there should be no issues with resolution when you export your document.
Vectors and fonts are resolution-independent so they should look right at any scale.
I've not done extensive testing but it's worked fine for me the few times I've used it in 1.4.6.
The best thing to do is try a few tests for yourself and see what happens.

* I don't know how Scribus handles fonts in an "imported" PDF so I don't know if it outlines them or not but as long as they're handled in a "vector-based manner" it should be fine.
Title: Re: Problems with tables as images
Post by: Farland on April 05, 2018, 04:28:43 pm
Alright, excellent.  I did a little bit of reading and testing just now, and it looks like I can import the PDF in Inkscape, save it as an SVG file (with the option of outlining fonts), import it in Scribus using Import>Get Vector File and it looks great.  Now my question is will handling a large amount of svg tables bog down Scribus? It seems to increase the size of the .sla file by a good amount (in the case of my imported test file, 1 MB) per imported vector? If I use this method, I need to import a rather large amount of tables as vectors.
Title: Re: Problems with tables as images
Post by: GarryP on April 05, 2018, 04:59:02 pm
You should be able to import the table PDF directly into a Scribus image frame without converting it to a SVG in Inkscape.
I'm not sure what benefit you would get from the conversion - in the case you describe - except that you can more easily see what it looks like in Scribus before you export your document.

When you convert fonts to vectors you lose the "compression" that the font gives you. After conversion, every character is represented by a long string of coordinates (and other things) that describe the shape of that character rather than just a look-up from a character value to the vector tables in the font file. For example, every single "9" will be a long string of vector description and this long string will be repeated everywhere you have a "9". The same goes for every character. So, if you have lots of tables, you will have lots of repeated strings of vector descriptions and this will take up more memory.
Title: Re: Problems with tables as images
Post by: Farland on April 05, 2018, 05:16:31 pm
Okay, on testing, you make a good point-- importing the pdf as a vector file directly into Scribus does seem to eliminate the need to save it as an svg file.  That's great.  The pdf directly imported seems to increase the .sla file size by about 200 KB over the svg file, though.

So now my question is: is a quite large .sla file (ie one filled with vector tables) going to make it difficult to work in Scribus? Do you think it will bog down or crash Scribus? My laptop is decently powered.
Title: Re: Problems with tables as images
Post by: Farland on April 06, 2018, 05:52:19 am
Update: okay I went the Import pdf as vector route and it seems to be working out beautifully. It has definitely increased the size of the .sla file but Scribus seems to be handling it just fine. I’m thinking it will actually decrease the size of the final exported pdf while making it better quality. Thanks for all your help, guys!
Title: Re: Problems with tables as images
Post by: Farland on April 09, 2018, 05:01:09 am
Next update: I may have spoken too soon.  There was no problem working with the vector tables inside Scribus, but the exported PDF now seems unworkable.  It takes forever to open, it takes a long time to move from page to page, and it takes upwards of an hour to save. Is there anyway to save this? It turns out creating all tables as vector images may not have worked in the end.
Title: Re: Problems with tables as images
Post by: GarryP on April 09, 2018, 03:00:45 pm
You could put your tables on a separate layer and temporarily switch that layer off to try and get some document-browsing speed back but that's not an ideal solution even if it works, and it doesn't help with save/load times.

You could try splitting the document into smaller "sub-documents" but that's not ideal either.

Another option would be to use LaTeX in a render frame but I'm fairly sure that just creates bitmaps anyway.

If importing the tables as vectors makes the document too large then you'll probably have to go back to using bitmaps and not capping the resolution for the non-print version.

If your tables are black and white then you could try converting the bitmaps to 1-bit indexed mode (in GIMP, menu Image -> Mode -> Indexed / 1-bit). Export them as TIFs (with LZW compression) and the file sizes should drop to about 10% of the originals. GIMP or ImageMagick might be able to process multiple images in batch mode but remember to not overwrite the originals.

I haven't tried using 1-bit images in Scribus, so you will have to do some testing before using it in a real document.

I'm not sure what else to suggest.
Title: Re: Problems with tables as images
Post by: Farland on April 09, 2018, 03:08:46 pm
Alright, thanks for the advice.  It honestly seems like the best solution would be to build the tables right in Scribus. Is the table functionality really that bad?
Title: Re: Problems with tables as images
Post by: GarryP on April 09, 2018, 03:58:51 pm
"Bad" really depends on what you want.
If you want something very simple then it's quite usable, but as soon as you want any complexity you might start to have trouble.
Tables are just grouped cells with a little bit of extra functionality thrown in.

Can you give visual examples of some tables you want to create, with some notes on how things need to be formatted? Also, how many tables - of each kind - do you need to create?
It's always easier to give advice when you can see what you're advising on.

You might need to use a mix of native tables and imported ones.
Title: Re: Problems with tables as images
Post by: Farland on April 09, 2018, 04:41:43 pm
The tables I am trying to make are actually rather simple. I just have a LOT of them to make. 

One example would be something like the "Draconic Ancestry Table" on this page: https://www.5esrd.com/races/dragonborn/

Or like the tables on this page: http://www.5esrd.com/backgrounds/
Title: Re: Problems with tables as images
Post by: a.l.e on April 09, 2018, 05:05:42 pm
with a bit of creativity, you can also use tabulators for that...

https://www.youtube.com/watch?v=V8LHozLpWa8&t=4s
Title: Re: Problems with tables as images
Post by: GarryP on April 09, 2018, 05:42:14 pm
I would be cautious using tabulators without some proper testing.

Just as a quick test, I created a small text file containing what I wanted in a table with a tab between the items.
Then I created a text frame and imported the text file.
Then I changed the tabulator settings.
Most of it worked but I couldn't get the first "column" to be anything other than left-justified.
Not a major problem, but then I re-imported the text and most of the tabulator settings had gone.
The "columns" were still there but the centre/right-justifications had been changed to left-justified and the tab stops had gone missing from the tabulator dialog altogether.

This was with 1.4.6. I don't know if 1.5.x has more solid functionality.
If 1.5.x does things better then I would be tempted to use the tabulator in that (as a.l.e suggests), but not with 1.4.6.

Just make sure it does what you want before using it "in the field".
Title: Re: Problems with tables as images
Post by: Farland on April 09, 2018, 06:39:24 pm
I am using 1.5.3 (I think it's .3. I am at work.) I will give the tabulator method a try, as well as just trying to use the included table function. I'll report back.
Title: Re: Problems with tables as images
Post by: Nermander on April 09, 2018, 09:33:42 pm
I have been working on "cheat cards" for 5e (instead of a DM screen), and I have been using TABs for almost all tables I think.

Ok, they were done in MS Word and not in Scribus, but since I used a 2 cell table for each card (back and front), it became difficult to use "real" tables.

I enclose a PDF of the current draft (some text in Swedish since I am Swedish and have been doing these for myself).

Title: Re: Problems with tables as images
Post by: Farland on April 09, 2018, 10:06:40 pm
That looks pretty good, Nermander.  Thanks for sharing.
Title: Re: Problems with tables as images
Post by: LesCM19 on May 16, 2018, 06:54:32 pm
I use a postscript virtual printer for my biggest tables that I am just no way going to draw up again!

https://www.stat.tamu.edu/~henrik/GSPSprinter/GSPSprinter.html

Select print area>print; rename .prn file created  to .ps; import vector graphic into Scribus.

Sometimes the area of table selected goes wonky-haven't worked out why-been using it with Excel & Word docs with 100% success (eventually).

UPDATE: THE IMPORTING OF VECTOR FILES IN THIS WAY WOULD APPEAR TO BE INCOMPATIBLE WITH PUBLISHING VIA WARGAME VAULT AND POSSIBLY LIGHTNING SOURCE TOO. IT'S FINE IF YOU JUST WANT TO CREATE A PDF BUT PROBABLY/POSSIBLY NOT NOT FOR POD PURPOSES!!
The book contents file will not upload to WV and they say it 'appears to be corrupted'. Versions prior to adding my vector files DO upload.