python - <<'PY'
p='/workspace/scratch/patchsla.py';s=open(p).read();s=s.replace("E.SubElement(d,'LAYERS',NUMMER=str(num),LEVEL=str(num),NAME=name,SICHTBAR='1',DRUCKEN='1',EDIT=str(edit),SELECT='0',FLOW='1',TRANS='1',BLEND='0',OUTL='0',LAYERC='#668899')","d.insert(list(d).index(d.find('Printer')),E.Element('LAYERS',NUMMER=str(num),LEVEL=str(num),NAME=name,SICHTBAR='1',DRUCKEN='1',EDIT=str(edit),SELECT='0',FLOW='1',TRANS='1',BLEND='0',OUTL='0',LAYERC='#668899'))")
open(p,'w').write(s)
PY
python /workspace/scratch/patchsla.py
DISPLAY=:99 scribus -g -ns -py /workspace/scratch/export.py > /workspace/scratch/export.log 2>&1
ls -lh /workspace/output/catalogue_press.pdf
python - <<'PY'
import fitz
r=fitz.open('/workspace/output/catalogue_press.pdf');print(len(r),[len(p.get_images()) for p in r]);print(r[0].get_text()[:600]);r[0].get_pixmap(matrix=fitz.Matrix(1.4,1.4)).save('/workspace/scratch/page1.png');r[11].get_pixmap(matrix=fitz.Matrix(1.4,1.4)).save('/workspace/scratch/page12.png')
PY