On Fri, 9 Nov 2018 09:23:42 +0100
ale rimoldi <ale.comp_06 at xox.ch> wrote with subject
"Re: [scribus] script to convert e-mail and web addresses to PDF links":

> hi gare
> 
> > New to Scribus scripting and because of the version of Scribus and 
> > Ghostscript I'm running, exporting to PDFs is a pain. I have to save
> > the .sla file then fire up my laptop, which is running an older
> > version of Debian, to create the PDF. Debian/Buster has a problem
> > with importing postscript & PDFs and with creating PDFs.
> > 
> > However the far larger problem I'm currently having is that I have
> > a hundred-page document with hundreds of e-mail addresses and a lot
> > of web addresses that I'd like to automatically locate and create
> > external links for. Doing this by hand will take forever.
> > 
> > After manually creating a few then looking at the .sla file, I note
> > that the PDF links are, as expected, not really associated with the
> > text. Instead, as the create sequence implies, they are associated
> > with a bit of real estate on the page that (hopefully) aligns with
> > some underlying text or image.
> > 
> > This suggests that a script would need to:
> > 
> > 1) seek e-mail addresses (identified by text that looks like an
> > e-mail address),
> > 
> > 2) identify the position and size of the address on the page,
> > 
> > 3) create a PDF link element with that address.
> > 
> > Has anyone seen / used such a script or something similar that I
> > can work from?  
> 
> i don't think there is a way to do this through scripting.
> and automatically adding the pdf link frames from c++ is imo not
> a good idea at all.
> 
> one simple solution, is to rely on the pdf reader to make links
> clickable. many readers do it.
> 
> the other way -- a more long term one -- is to come up with a good way
> to do that through "formatting".
> does anybody have an idea how to edit and display links in scribus.
> if yes, please make a proposal in this list or add a ticket to the bug
> tracker (https://bugs.scribus.net).
> it's probably not trivial to find the optimal way to do that, but me
> might have a few very clever heads around here...
> just keep in mind that scribus is mainly a tool for creating pdf that
> will be professional printed, so the solution will probably have to
> ensure that printed document do look good! (probably, you will not
> have underlined urls in a printed document... but you might want them
> highlighted in a pdf for online reading...)
> 
> sorry, that i cannot give you *the* solution... maybe, somebody
> will come up with a better idea than the ones of mine...
> 
> ciao
> a.l.e
> 
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net
> 


Hi there

Some time ago I did something similar. This involved following steps:

* Export file as pdf (Stage 1)
* Use an external tool to find keywords with positions
* Re-use these positions with a python script in Scribus
* Export file as pdf (Stage 2 - final)

The key problem is that you cannot link/reference single words of a text frame 
from python scripter engine. But this has to be implemented in C++ and I've got 
no time. (Don't even be able to update the python3 patch to development branch 
which seems to be moving.)

BR
 Jonas





Reply via email to