Code Monkey home page Code Monkey logo

scribus-project-manager's People

Contributors

jluc avatar luzpaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

scribus-project-manager's Issues

disable comments info (option)

as for now, text comments (texts with AAA, XXX, YYY or PPP) are listed while compiling the book

provide an command line option to NOT list these.

or a book config to set default.

Alternate title style

When creating the map of the document's chapter, use a defined alternate title style when the defined main title style is not used in a chapter.

optimize -noimages

makebook -noimages creates all chapter's PDF anew, each time it's launched, even for chapters that have not changed.

Ensure makebook -noimages only creates required PDFs (whose SLA has been updated).

See also #16

check scribus, xmllint and xmlstarlet are available

Before launching work, first check scribus exec, xmllint and xmlstarlet are installed.

  • scribus exec is specified in scribuscommand variable in slacheck script. Check it's possible to set it in slacheck.config.
  • when xmlstarlet is not installed, the script empties the sla and user has to recover backed version. So also check that also immediately before using it.

-replace with empty string

When using -xmlfind option with -replace specifying an empty string, the test issues a "missing parameter" error : -replace option must have additionnal parameter = replacement string.

Example : makebook -find '<ITEXT FONT="Liberation" FCOLOR="Vert" CH="remember the milk"/>' -replace ''

In makebook, test is : if [ "$1" = "" ]

refactor -vecto

with vecto

  • FontEmbedding="1" (paradoxicaly)
  • no <font ... >
  • no <Subset ... >

-vecto should

  • set FontEmbedding="1"
  • check that NO font is embeded nor subset (instead of checking that all fonts are)
  • set experimental PDF embed to false

ATTENTION BUG à vérifier :
La production de PDF en ligne de commande par scribus ne permet PAS de créer des PDF vectorisés

Issue with command line PDF exports is :

When i set options to "outline all" when exporting to PDF and later save the SLA,
and later again export it to PDF through the commande line option, using :

    filename = os.path.splitext(scribus.getDocName())[0]
    pdf = scribus.PDFfile()
    pdf.file = filename+".pdf"
    pdf.version = 15
    pdf.save()

then the created PDF has all fonts embeded or subset,
when it should have none, but vectors instead.

William Bader : To see the list of options, on the Scribus menu bar, use Help -> Scribus Manual, and then in the manual, open the Contents tab and navigate to For Developers -> Scripter API -> PDF Export.
PDFFile has a fontEmbedding property that you can set to 1 to request conversion to vectors.
Can you try adding a line pdf.fontEmbedding = 1

Some comments are not found

Some PPP or AAA comments are not found as comments, but are found with -find option.
That is verrrrry strange.

doc and formal doc

ale : « it would be nice to have a more formal definition of what your project manager does and what an improved version should / could do.
Having a "dtd" for the config files and for the output would be -- as an example -- be helpful. »

(ale didnt say whether he tried it)

SLA search tool

Scribus's search tool is useless since it does not show the result (see mantis).

Todo : create a script that searches for a string and outputs context of each occurences :

  • page number,
  • element id
  • a bit of text around, when possible

Options :

  • use regexp
  • search and replace

There is allready a search option now but it doesnt output page number. This could be very difficult to do.

Detect and manage AAA, XXX and PPP

AAA, XXX and PPP are markers in text to mention there is something to check / do / insert

Slacheck should

  • first : display all these notes
  • later : manage some of them, as PPP which is a reference to a page that can be in another document of the same project
  • later : manage project-wide variables (VVVvname), defined in the project config file

Find comments in layers

Some comments are not found as comments, but -find option finds them. Fix regexp ?

Both AAAs and PPPs

Eg

    <PAGEOBJECT XPOS="691.538636995078" YPOS="391.347826086957" OwnPage="-1" ItemID="1505579706" PTYPE="4" WIDTH="156.819875776397" HEIGHT="117.465838509317" FRTYPE="0" CLIPEDIT="0" PWIDTH="1" PLINEART="1" LOCALSCX="1" LOCALSCY="1" LOCALX="0" LOCALY="0" LOCALROT="0" PICART="1" SCALETYPE="1" RATIO="1" COLUMNS="1" COLGAP="22.6771653543307" AUTOTEXT="0" EXTRA="0" TEXTRA="0" BEXTRA="0" REXTRA="0" VAlign="0" FLOP="0" PLTSHOW="0" BASEOF="0" textPathType="0" textPathFlipped="0" path="M0 0 L156.82 0 L156.82 117.466 L0 117.466 L0 0 Z" copath="M0 0 L156.82 0 L156.82 117.466 L0 117.466 L0 0 Z" ImageRes="0" gXpos="691.538636995078" gYpos="391.347826086957" gWidth="0" gHeight="0" LAYER="0" NEXTITEM="-1" BACKITEM="-1">
      <StoryText>
        <DefaultStyle/>
        <ITEXT CPARENT="Default Character Style" CH="[AAA gnagna]"/>
        <trail/>
      </StoryText>
    </PAGEOBJECT>

Mais pareil sans les crochets.

Also :

        <PAGEOBJECT XPOS="901.470472440951" YPOS="225.529348733981" OwnPage="0" ItemID="1489022282" PTYPE="4" WIDTH="266.852362204721" HEIGHT="55.164906759196" FRTYPE="0" CLIPEDIT="0" PWIDTH="1" PLINEART="1" LOCALSCX="1" LOCALSCY="1" LOCALX="0" LOCALY="0" LOCALROT="0" PICART="1" SCALETYPE="1" RATIO="1" COLUMNS="1" COLGAP="22.6771653543307" AUTOTEXT="0" EXTRA="0" TEXTRA="0" BEXTRA="0" REXTRA="0" VAlign="0" FLOP="0" PLTSHOW="0" BASEOF="0" textPathType="0" textPathFlipped="0" path="M0 0 L266.852 0 L266.852 55.1649 L0 55.1649 L0 0 Z" copath="M0 0 L266.852 0 L266.852 55.1649 L0 55.1649 L0 0 Z" ImageRes="0" gXpos="-1099.3937007874" gYpos="-2626.18763427061" gWidth="89.6870078740174" gHeight="107.087598425196" ALIGN="0" LAYER="1" NEXTITEM="-1" BACKITEM="-1">
            <StoryText>
                <DefaultStyle ALIGN="0" FCOLOR="Brun feuillemorte foncée" BGCOLOR="None"/>
                <ITEXT FONT="Life Savers Bold" FONTSIZE="11" FEATURES="inherit outline shadowed" FCOLOR="Brun feuillemorte foncée" SCOLOR="orangeoyant" BGCOLOR="None" BGSHADE="20" TXTSHX="4" TXTSHY="-3" TXTOUT="0.5" SCALEV="100" KERN="0" LANGUAGE="fr" CH="É..."/>
                <breakline/>
                <ITEXT FONT="Life Savers ExtraBold" FONTSIZE="15" FEATURES="inherit outline shadowed" FCOLOR="Brun feuillemorte foncée" SCOLOR="orangeoyant" BGCOLOR="None" BGSHADE="20" TXTSHX="4" TXTSHY="-3" TXTOUT="0.5" SCALEV="100" KERN="0" LANGUAGE="fr" CH="    AAA é "/>
                <trail ALIGN="0" LINESPMode="0" LINESP="19"/>
            </StoryText>
        </PAGEOBJECT>

and

      <PAGEOBJECT XPOS="877.037892436666" YPOS="638.56089797286" OwnPage="0" ItemID="1489162618" PTYPE="4" WIDTH="379.234042553191" HEIGHT="59.2340425531914" FRTYPE="0" CLIPEDIT="0" PWIDTH="1" PLINEART="1" LOCALSCX="1" LOCALSCY="1" LOCALX="0" LOCALY="0" LOCALROT="0" PICART="1" SCALETYPE="1" RATIO="1" COLUMNS="1" COLGAP="22.6771653543307" AUTOTEXT="0" EXTRA="0" TEXTRA="0" BEXTRA="0" REXTRA="0" VAlign="0" FLOP="0" PLTSHOW="0" BASEOF="0" textPathType="0" textPathFlipped="0" path="M0 0 L379.234 0 L379.234 59.234 L0 59.234 L0 0 Z" copath="M0 0 L379.234 0 L379.234 59.234 L0 59.234 L0 0 Z" ImageRes="0" gXpos="877.037892436666" gYpos="-523.643826436589" gWidth="0" gHeight="0" LAYER="1" NEXTITEM="-1" BACKITEM="-1">
           <StoryText>
               <DefaultStyle/>
               <ITEXT FONT="Life Savers Bold" FONTSIZE="11" FEATURES="inherit" FCOLOR="Magenta foncé" SCOLOR="Yellow" BGCOLOR="None" BGSHADE="20" TXTSHX="4" TXTSHY="-3" TXTOUT="0.5" SCALEV="100" KERN="0" LANGUAGE="fr" CH=" "/>
               <breakline/>
               <ITEXT FONT="Life Savers Bold" FONTSIZE="11" FEATURES="inherit" FCOLOR="Magenta foncé" SCOLOR="Yellow" BGCOLOR="None" BGSHADE="20" TXTSHX="4" TXTSHY="-3" TXTOUT="0.5" SCALEV="100" KERN="0" LANGUAGE="fr" CH="AAA"/>
               <ITEXT FONT="Life Savers ExtraBold" FONTSIZE="14" FEATURES="inherit" FCOLOR="Magenta foncé" SCOLOR="Yellow" BGCOLOR="None" BGSHADE="20" TXTSHX="4" TXTSHY="-3" TXTOUT="0.5" SCALEV="100" KERN="0" LANGUAGE="fr" CH="... "/>
               <trail ALIGN="0" LINESPMode="0" LINESP="19"/>
           </StoryText>
       </PAGEOBJECT>

revoir option -noimage

Plutôt que la bidouille actuelle qui renomme temporairement les répertoires d'images et regénére le PDF (Cf #35), utiliser les outils PDFs permettant d'enlever les images ou les vecteurs d'un PDF , et sauvegarder sous un autre nom.

  • Il semble qu'il n'y a pas d'option scribus pour générer le PDF sans image. Vérifier.

  • ghostscript : (Cf stackoverflow )

 gs -o noIMG.pdf   -sDEVICE=pdfwrite -dFILTERIMAGE                input.pdf
 gs -o noTXT.pdf   -sDEVICE=pdfwrite -dFILTERTEXT                 input.pdf
 gs -o noVCT.pdf   -sDEVICE=pdfwrite -dFILTERVECTOR               input.pdf

 gs -o onlyTXT.pdf -sDEVICE=pdfwrite -dFILTERVECTOR -dFILTERIMAGE input.pdf 
 gs -o onlyIMG.pdf -sDEVICE=pdfwrite -dFILTERVECTOR -dFILTERTEXT  input.pdf
 gs -o onlyVCT.pdf -sDEVICE=pdfwrite -dFILTERIMAGE  -dFILTERTEXT  input.pdf

  • cpdf -draft original.pdf -o version_without_images.pdf (Cf askubuntu )

It is not in the repositories but you can find a download (pre-compiled or source) on their website.

Manual: 15.1 Draft Documents
The -draft option removes bitmap (photographic) images from a file, so that it can be printed with less ink. Optionally, the -boxes option can be added, filling the spaces left blank with a crossed box denoting where the image was. This is not guaranteed to be fully visible in all cases (the bitmap may be have been partially covered by vector objects or clipped in the original).

For example: cpdf -draft -boxes in.pdf -o out.pdf

fix slasync -m

slasync doesnt work for masterpages :

  • it imports masteroage declaration
  • but not the masterpage definition

refactor -noimage

-noimage uses a prehistoric technic like temporarily renaming image folder

instead : use dedicated xml attributes

Combiner les configs

Permettre d'associer plusieurs configs pour un même projet / un même chapitre

Ainsi on pourrait définir une config pour le PDF et une pour chaque sorte de caractéristiques des pages.

En les combinant à volonté, on pourrait les réutiliser d'un projet à l'autre.

Définir les config principales :

  • A4.config
  • A5.config
  • cropmarks.config
  • nocropmarks.config

etc

config file

Use configuration file rather than inline definition

Basic config code :
7 #Initialisation des variables
8 if [ ! -f "${VARIABLES_FILE:=variables.conf}" ]; then
9 echo "Le fichier ${VARIABLES_FILE:=variables.conf} manquant"
10 exit 1
11 fi
12

13 . "${VARIABLES_FILE:=variables.conf}"
14

and variables.conf is made of :
1 #Initialisation des variables
2 SVN_REPOSITORY="svn.spip.org/spip-zone/"
3 SVN_DIRECTORY="/var/svn-repos/spip-zone/"
4 SVN_ROOTS=('plugins' 'outils' 'dev');
5 SVN_PROJECTS_SUBGIT=()

etc

Images list

Create book_images.md with all images listed by chapter (as with comments)

slagetstart + slasetstart

scripts to easyer get and set <Section ... Start="xxx"...> in a sla

calls slasetattre

will enable to later automatically adjust page numbers inside global project

Uncheck all fonts in fonts preference dialogs

Owen :

Sometimes we make mistakes, like install Docbook, and end up getting 2000+ unwanted fonts being recognized by Scribus.

After you have unticked the first hundred and realize that you have another two hours to go, you ask, is there a better way?

Go to your .scribus directory and run;

sed 's/<Font\ Use="1"/<Font\ Use="0"/'scribus150.rc > new_rc_file

and then (after inspection of new_rc_file) move the new_rc_file to scribus150.rc

Now you problem has been changed to going through fonts and selecting
maybe the 20 or 30 you want to use.

-replace with xml text

-replace option for search and replace is broken in the makbook script

  • file is saved as .before_replace.sla
  • occurences to find are replaced
  • occurences to replace are not replaced

command is sed -i -- "s/$xmlsearched/$replaced/g" "$fic.sla"
and errors with sed: -e expression n°1, caractère 43: option inconnue pour s'`

Ah.

It bugs when replaced expression contains a slash / (or a " also ?) : for example <COLOR NAME="Yellow" CMYK="#0000ff00"/>

Got to escape first, or use some other tool :

Use .sla doc as config

Instead of copying a whole list of <DOCUMENT> attributes as variable initiatializations into a shell configuration script (as now), use a config_document.sla file as a master for desired <DOCUMENT> attributes.

This document is then parsed so as to extract desired attributes. There must be a list of attributes to be checked (whitelist or blacklist)... in a simplified config file !

-find doit chercher aussi dans les notes

les notes sont et contiennent un morceau de texte encodé : Text="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;SCRIBUSTEXT &gt;&lt;defaultstyle parent=&quot;Notes&quot; /&gt;&lt;p &gt;&lt;style /&gt;&lt;span &gt;&lt;charstyle Features=&quot;inherit &quot; /&gt;des fermes vivrières ou de moins de 20&lt;/span&gt;&lt;span &gt;&lt;charstyle Features=&quot;inherit &quot; Font=&quot;Arimo Regular&quot; /&gt; &lt;/span&gt;&lt;span &gt;&lt;charstyle Features=&quot;inherit &quot; /&gt;ha ('&lt;/span&gt;&lt;span &gt;&lt;charstyle Features=&quot;inherit &quot; Font=&quot;Montserrat Light Italic&quot; /&gt;smallholding&lt;/span&gt;&lt;span &gt;&lt;charstyle Features=&quot;inherit &quot; /&gt;s' dans le texte anglais) &lt;/span&gt;&lt;/p&gt;&lt;/SCRIBUSTEXT&gt;&#10;"

Create PDF

  • create pdf from mak
  • create pdf without images from mak (renaming images to images.bak and bak)

list bookmarks + warn if missing + set if missing (option)

It's handy when the book's PDF features a bookmark for each chapter

Add options

  • to list declared bookmarks
  • to warn in case a chapter has no bookmarks
  • in case a chapter has no bookmark, to add a bookmark to the first textframe appearing in the document (first in SLA ? Or smallest x,y ?)

Automate changing left/right start of chapter

Make it easy to command-line change the left/right start of a chapter

When -set option changes the start page, change the masterpage for all pages accordingly : odd=right default masterpage, even=left default masterpage -- unless the masterpage isn't the default one.

And change the UI setting that says "it begins left/right" (even if it has no effect on PDF)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.