r/scribus • • 2d ago

Scribus PDF Engine written in python - create PDF's from Scribus without having to launch Scribus.

Hi all. We make personalised books for children, and until now, the workflow has been using scribusgenerator and launching scribus on the server to save the PDF. Its fairly slow, and clunky. I gave claude access to scribus source on github, and showed it the books we build, and i now can create pdf's from scribus files using python. Took a good 8 hour session working with Claude and its absolutely working perfectly. So, can now create PDF's using SLA files, without having to open scribus. I'm happy to share the code.... https://github.com/jasongodwin/sla2pdf

7 Upvotes

13 comments sorted by

2

u/aoloe 1d ago

The idea is good but... I wonder if the tokens would have not been better spent in creating a solution that uses the "native" code for reading the .sla and exporting to .pdf.

Of course:

  • it's not possible to use the files as is and some changes to the importer and exporter will be needed, and

  • there is not guarantee that the patch would be accepted.

But that would need less changes for Claude to do and, in the case you will need to keep your solution outside of Scribus, it is likely that it will be easy to keep up with the changes in upstream Scribus.

And once you have a clean C++ solution, it should be trivial for Claude to create a translation of it in Python.

... I might give it a try... even if I don't have access to Claude.

1

u/Simple-Cook-3001 1d ago

No idea, i was staggered though how it read the code, understood how the complex polygonal text formatting worked, and built a solution which basically recreates the books we make perfectly, and in 1 second as opposed to many more, and no hacky "running scribus in xvfb in headless on the server".

I do like your idea too. Thats cool also.

1

u/supergatito2022 2d ago

well, where is the code?

1

u/Simple-Cook-3001 2d ago

right now, on my computer.... you can see it in action here - https://book.mayanmonkey.es

4

u/Simple-Cook-3001 2d ago edited 2d ago

If you'd like the code, i'll create a project now of a standalone version, and post to github.

1

u/Opussci-Long 1d ago

Can it work if the whole text content is to be changed, i.e. typesetting magazins?

2

u/Simple-Cook-3001 1d ago

I believe so yes. setup the frames and layout in scribus, and use variables for the content, change the content and it should work fine.

1

u/pkdme 1d ago

I was thinking something like this for newspapers. Do you have any plans to make it opensource? I feel motivated that it works for you, I should try to burn some tokens on this for my workflow.

1

u/Simple-Cook-3001 1d ago

It's open source. Should work fine. Have a play ! Let me know how you get on.

1

u/pkdme 1d ago

Can you provide GitHub link here, I couldn't find anywhere on this thread