Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Generator without GUI within Scribus #105

Open
jvr14115 opened this issue Apr 4, 2018 · 10 comments
Open

Running Generator without GUI within Scribus #105

jvr14115 opened this issue Apr 4, 2018 · 10 comments

Comments

@jvr14115
Copy link

jvr14115 commented Apr 4, 2018

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

@berteh
Copy link
Owner

berteh commented Apr 4, 2018 via email

@jvr14115
Copy link
Author

jvr14115 commented Apr 4, 2018

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
Copy link
Author

jvr14115 commented Apr 4, 2018

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

@berteh
Copy link
Owner

berteh commented Apr 6, 2018

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 aoloe/scribus-script-repository#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
Copy link
Owner

berteh commented Apr 8, 2018

@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.

@jvr14115
Copy link
Author

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.

@berteh
Copy link
Owner

berteh commented Apr 12, 2018

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.

@jvr14115
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants