[scribus] Get articles content online

Gregory Pittman gpittman at iglou.com
Wed May 2 13:35:00 UTC 2018


On 05/02/2018 08:43 AM, niilos wrote:
> Hello !
> 
> I’m new on this mailing list but I’m spreading Scribus as an InDesign
> alternative for several years now.
> I am writing a little booklet each summer with about 10 people and I am
> using Scribus to print it. We are writing the articles on a custom web
> app. It would be great if we could tell scribus to fetch the articles
> content online ! Our web app have a REST API to access the articles.
> Is there a Scribus plugin that can get some content online ?
> 

Hi Niilos,

I recently was working on a script, part of which included getting an
image from the web. It was challenging. Here is what ended up working:

	imagefr = scribus.createImage(175, 14, 20, 7)
        logo =
cStringIO.StringIO(urllib.urlopen("https://website/image.jpg").read())
        img = Image.open(logo)
        img.save('/tmp/savedimage.jpg')
        scribus.loadImage('/tmp/savedimage.jpg', imagefr)
        scribus.setScaleImageToFrame(1,1,imagefr)

This required a statement at the beginning:

import PIL, urllib, cStringIO

As written above, it worked on Linux. To make it work on Windows, you
have to locate the appropriate temporary directory where you are allowed
to save the file to. I couldn't figure out a way to make it work without
the PIL (Python Imaging Library).

If you're trying to get text content, I don't know where to start.

Greg



More information about the scribus mailing list