ScribusGenerator icon indicating copy to clipboard operation
ScribusGenerator copied to clipboard

Running Generator without GUI within Scribus

Open jvr14115 opened this issue 7 years ago • 10 comments

Dear Berteh,

Is it possible to modify generator so it runs on preset values without GUI (within Scribus, since I need to create a lot of pdfs). Can you explain how?

Kind regards Jeroen

jvr14115 avatar Apr 04 '18 19:04 jvr14115

Hello Jeroen.

It's already available in the form off 'save' and 'load'.

The idea is: you run your project once with GUI and click 'save' in the dialog. All active settings get thereby saved in your SLA template file.

You can then use the 'load' option in a later execution with the same SLA template, both from GUI and CLI. The saved values are then considered as 'default', you can override them using the usual command line options.

Hope this works for you. Have a look at the documentation for more info.

Feel free to send me an improved paragraph to document this feature if it works for you.

Berteh.

Le mer. 4 avr. 2018 21:46, jvr14115 [email protected] a écrit :

Dear Berteh,

Is it possible to modify generator so it runs on preset values without GUI (within Scribus, since I need to create a lot of pdfs). Can you explain how?

Kind regards Jeroen

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/berteh/ScribusGenerator/issues/105, or mute the thread https://github.com/notifications/unsubscribe-auth/AACQVpBwjmTR102xWHN9R5efdO1qeh0-ks5tlSMngaJpZM4THY9G .

berteh avatar Apr 04 '18 20:04 berteh

Not sure what you mean with the "load" option. If I press the refresh icon, I get a message no settings are saved.

Bigger issue is that the people using my template have no clue what they are doing. It needs to be fully automated and creating pdf's. I tried the to-pdf.py option, but it takes forever and the constant popping up of scribus basically blocks the computer from doing anything else.

The option I am now looking for is a "hardwired" generator script that starts up with scribus. (all settings written in the script and without GUI). Start up as "scribus.exe -py script template.sla" I guess it should be possible to somehow modify the existing scripts, I am just not sure how.

  1. How could I skip the GUI and simply run SG using the default settings?
  2. How can I change the default setting for delimiter from "," to ";"? Your help is much appreciated

jvr14115 avatar Apr 04 '18 20:04 jvr14115

  1. Is it possible to minimize Scribus while running SG?

jvr14115 avatar Apr 04 '18 20:04 jvr14115

Hello Jeroen.

Did you already try the command line mode of SG? Looks to me like that could match some of your requests: https://github.com/berteh/ScribusGenerator#running-scribus-generator-from-the-command-line ... but i still found no way to generate PDF without the disturbance of Scribus freezing the computer (asked a Scribus dev at https://github.com/aoloe/scribus-script-repository/issues/30).

for your questions:

3: possible to minimize Scribus while running SG? no. you could use CLI to not run Scribus at all, but then would generate only the SLA documents, not the PDF, which would need to-pdf.py afterwards (at night when no one's bothered?).

2: in command line: --csvDelimiter ';', in GUI: set Data Field Separator to ; and in both cases set option to save at the same time (--save or tick box and close your project without saving again after SG run: as the "save" option rewrites it, Scribus needs to reload it before it's working). Or you could set CSV_SEP = ";" in ScribusGeneratorBackend.py on line 49, but I would advise against this option as it makes later scripts update more difficult.

1: I need to think about that one. How would you see it more useful ? would it use default settings, or settings saved in the template file ? Would it be enough to simply load the projet saved values when the SG GUI is displayed... you users would then simply need to click on "generate" without changing anything.

by the way: In the current Scribus API there's no way to make the pdf generation more "silent"; so that part would not be much more comfortable.

Berteh.

berteh avatar Apr 06 '18 23:04 berteh

@jvr14115 I reported the problem with to-pdf.py not being usable because of focus theft by scribus -g to the Scribus devs at https://bugs.scribus.net/view.php?id=15255

Kindly confirm the bug there by explaining briefly your story. It may help getting a bit of attention to it. B.

berteh avatar Apr 08 '18 01:04 berteh

Thanks for your replies.

So far the fastest and easiest sollution to create the pdf fully automated would be to use a script with default values, without GUI, that starts when opening the scribus template from command line like: scribus.exe -g -py [script] [templatename] I see to options for the script:

  1. Copy the script and manually add the values in the script with notepad 2.Parse arguments in the command line (this for sure would require more programming) Option 1 would be ok for me.

jvr14115 avatar Apr 10 '18 08:04 jvr14115

option 1 seems feasible. Would it be OK for your users to click on something in the "script" menu ? I found no "autorun script" possibility so far that could be save in the SLA.

berteh avatar Apr 12 '18 12:04 berteh

So far I got the script adapted to my needs and let the users click "Generate". It would be nice if they didn't have to. Regarding auto-run: "to-pdf" seems to auto-run. Why would that not be possible with generator?

jvr14115 avatar Apr 22 '18 22:04 jvr14115

Hi Berteh, I have been able to modify the script to get the right values on default. Since the outcome needs to be in pdf, the option top open scribus and let the user click "Generate" seems the quickest.

Now I would like the script to automatically close Scribus after the script is finished. Any clue on how to do that?

Thanks!

jvr14115 avatar May 29 '18 20:05 jvr14115

Since all values are set from the start, it would also be nice if the user doesnt have to click "Generate", but the script would simply run when opened.

jvr14115 avatar May 29 '18 21:05 jvr14115