Recent posts

#11
General Discussion / Re: How many fields is too man...
Last post by berteh - September 15, 2025, 08:17:39 AM
Hello @GnKnG , @dragonfly ,

The core of ScribusGenerator is a plain text parsing and replace mechanism to generate the SLA documents, even when you use dynamic images and other advanced attributes.

The only limits I reached were in the size of the initial scribus template being too big (eg if you include heavy images inline)... but as soon as the template is efficient/light "enough" to be parsed at once in your RAM you're good to go above 1M csv entries ;)


Generating the PDF files on the other hand is all on Scribus... and that may take quite a while even for just a few pages (you're -kindly- warned ;)
#12
Scripts and Plugins / Re: ScribusGenerator: can no l...
Last post by berteh - September 15, 2025, 08:01:59 AM
Hello @mraskin ,

Just found this post, hope my answer helps others.
The answer to your problem is in https://berteh.github.io/ScribusGenerator/#dynamic-images :

Duplicate any image in this (your images) folder and rename it %VAR_pic% (and similarly for any other variable name you need to use for pictures, %VAR_pic2%, %VAR_photo%).

Then select that duplicate image ("placeholder") when scribus asks you to pic an image for your frame... with the added bonus that it will indeed show a proper content and not just a boring red X sign.

good luck ;)
#13
Scripts and Plugins / Script Console and Dark Theme
Last post by PercyThePenguin - September 15, 2025, 01:47:19 AM
I use KDE. With it set to the dark theme, the script console window uses a black font on a very dark grey background. Is there some way to tell it to use a font colour appropriate for a dark theme?
#14
Scripts and Plugins / Re: Unclosable message box
Last post by PercyThePenguin - September 15, 2025, 01:42:09 AM
The point I'm getting at is that this appears to put Scribus into an unusable state, with a modal dialog that you can't close (or which lacks an obvious way to close it).
#15
Scripts and Plugins / Unclosable message box
Last post by PercyThePenguin - September 15, 2025, 01:40:13 AM
Now in some way ChatGPT is to blame here. (I'm just starting out, trying random examples.) It gave me this script. The problem is that when it is done, the message box appears with no close/ok button, and closing the window did nothing, so I had to kill scribus from the cli.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import scribus

def main():
    if not scribus.haveDoc():
        scribus.messageBox("Error", "Please open or create a document first.", icon=0, button1=1)
        return

    # Create a new master page named "TwoColumn"
    scribus.createMasterPage("TwoColumn")
    scribus.editMasterPage("TwoColumn")

    # Add vertical guides (left margin at 20mm, center, right margin at 190mm)
    scribus.setVGuides([20.0, 105.0, 190.0])   # units are in current document units (usually mm)

    # Add horizontal guides (top at 20mm, baseline at 50mm, bottom at 270mm)
    scribus.setHGuides([20.0, 50.0, 270.0])

    # Done editing master page
    scribus.closeMasterPage()

    scribus.messageBox("Done", "Master page 'TwoColumn' created with guides.", icon=0, button1=1)


if __name__ == "__main__":
    if scribus.haveDoc():
        main()

#16
Beginner Talk / Re: Recommendations for Beginn...
Last post by PercyThePenguin - September 15, 2025, 01:32:59 AM
If I want to write content in some simple markup, is there a way to tell it what paragraph styles to use for each paragraph? e.g.



@Heading1
This is a heading

@ParaStyle1
Hello world said the cat to the dog.

@ParaStyle2
Woof, replied the dog, for he had no other words in his vocabulary.



Is there an existing markup style that does this effectively? Or is it hard to implement something in Python?
#17
Beginner Talk / Re: Email and URL in Scribus >...
Last post by MGD4me - September 14, 2025, 11:09:48 PM
I realize that this is an old thread, but I would like to be able to provide a "Submit form" button on a PDF, which would not only open up an email client, but also attach the completed application form.

Yes, the "mailto" function works properly, but is there a way to include the filled out form as well? At the moment, all I see is a blank email, with the destination email address and Subject line completed?

#18
Beginner Talk / Re: Recommendations for Beginn...
Last post by a.l.e - September 14, 2025, 03:19:40 PM
For scripting: it depends much on your skills in programming and on your goals.

If you already know about Python, you can have a look at similar existing scripts.

All you have to know is then:

  • Scribus script can only run from inside of Scribus.
  • You can start Scribus and tell it to run a specific script.
  • Scripts "must" be short living (no permanent scripts).
  • You can't attach Scribus to the menus (but a "Scripts" toolbar is planned and might get into 1.7)
  • You will be sending commands to Scribus by using its Scripter API (which your are welcome to enhance, if you stumble on missing features)

Voilà, and here is the starter script I'm currently using:

""" Boilerplate for Scribus scripts

For details see the README file.

(c) MIT your name"""

try:
    import scribus
except ImportError as ex:
    print('\nThis script must be run from inside Scribus\n')
    raise ex

def main():
    # Replace the following line by your code
    pass

if __name__ == "__main__":
    main()

And if you need to first learn Python, do that.
There is also a rather exhaustive manual by Gregory Pittman.

https://opensource.com/sites/default/files/ebooks/pythonscriptingwithscribus.pdf

From my point of view, it does not present the best practices, but it can be helpful if you need to also learn the basic programming skills:
#19
Beginner Talk / Re: Recommendations for Beginn...
Last post by PercyThePenguin - September 14, 2025, 01:32:58 PM
I plan to search youtube and google anyway, but are there any recommendations on where to start with regards to python scripting?
#20
Beginner Talk / Re: Resizing when printing
Last post by Nermander - September 14, 2025, 12:49:12 PM
A good rule is to never print from Scribus (becuase Scribus printing is known to not always work optimally), but export to PDF and print the PDF. Most PDF viewers will have scaling options (like "fit to paper size" or percentage scaling).

And the PDF then also works as a proof, it is very rare that a PDF does not print the same way it shows on screen.