[scribus] script to convert e-mail and web addresses to PDF links
Jonas Bechtel
post at jbechtel.de
Fri Nov 9 17:03:34 UTC 2018
On Fri, 9 Nov 2018 13:11:17 +0100
JLuc <jluc at no-log.org> wrote with subject
"Re: [scribus] script to convert e-mail and web addresses to PDF links":
> Le 09/11/2018 à 09:52, Jonas Bechtel a écrit :
> > 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
>
> what kind of tool was that ?
> and what kind of data did it output ?
I use: pdftotext -bbox infile.pdf outfile.xml
Given a page which contains the ending of sentence "[Diese
Nachbearbeitung der vorläufigen Zeitpunkte bewirkt, dass eine Vibration
zu einem zukünftigen Zeitpunkt (also 1-9 Messwerte später) nicht zum
aktuellen Zeitpunkt als Bewegung gewertet wird, während] ansonsten die
korrekten Bewegungsmeldungen beibehalten werden."
The tool takes lots of CPU power.
It outputs following:
<page width="595.280000" height="841.890000">
<word xMin="33.579210" yMin="46.010160" xMax="81.819210"
yMax="58.970160">ansonsten</word>
<word xMin="85.719210" yMin="46.010160" xMax="100.155210"
yMax="58.970160">die</word>
<word xMin="104.055210" yMin="46.010160" xMax="149.811210"
yMax="58.970160">korrekten</word>
<word xMin="153.711210" yMin="46.010160" xMax="260.043210"
yMax="58.970160">Bewegungsmeldungen</word>
<word xMin="263.943210" yMin="46.010160" xMax="319.059210"
yMax="58.970160">beibehalten</word>
<word xMin="322.959210" yMin="46.010160" xMax="360.807210"
yMax="58.970160">werden.</word>
That get's parsed by python.
I used it for my study thesis, see
jbechtel.de/site/Tools/Zellortung/
I had a in-text scripting language which had ##IF(), ##SET(), ##GET(),
etc. functions. The actual function using word position was ##PAGEOF()
which could find words in the document after stage 1 has run. (Always
returned "1" before stage 1 has run)
The most relevant file is
Zellortung-0.451_Ausschnitt.tar.bz2:/doc/Studienarbeit/Switch_Text.py
BR
Jonas
> JL
>
> > * 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.)
>
>
> ___
> 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
More information about the scribus
mailing list