User Tools

Site Tools


software:inkscape_scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
software:inkscape_scripts [2016/05/08 01:27] adminsoftware:inkscape_scripts [2016/05/11 21:47] (current) admin
Line 66: Line 66:
     svg="$(cat ${DNM}/${SFX}/${NF})"     svg="$(cat ${DNM}/${SFX}/${NF})"
  
-    # Strip everything until after the first appearance of '<path'+    # Strip everything until after the first appearance of '<path'
 +    # grep $svg first to prevent the subsequent substring removal to freeze 
 +    # in case of embedded images in svg files. 
 +    svg=$(echo $svg | grep -oP '<path.*')
     svg="${svg#*<path}"     svg="${svg#*<path}"
          
Line 89: Line 92:
       # check if $svg still contains '<path', if yes, cut off everything until after the next first <path:       # check if $svg still contains '<path', if yes, cut off everything until after the next first <path:
       if [[ $svg == *"<path"* ]]; then       if [[ $svg == *"<path"* ]]; then
 +        # Strip everything until after the first appearance of '<path':
 +        # grep $svg first to prevent the subsequent substring removal to freeze
 +        # in case of embedded images in svg files.
 +        svg=$(echo $svg | grep -oP '<path.*')
         svg="${svg#*<path}"         svg="${svg#*<path}"
       else       else
Line 105: Line 112:
     FILES="${FILES} ${DNM}/${SFX}/${NF}.pdf"     FILES="${FILES} ${DNM}/${SFX}/${NF}.pdf"
   done   done
-  echo "Merging all pdf files..."+  echo -n "Creating ${INPD}${OUTF}, containing all svg files..."
   /usr/bin/gs -dBATCH -sPAPERSIZE=a4 -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=${INPD}${OUTF} $FILES   /usr/bin/gs -dBATCH -sPAPERSIZE=a4 -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=${INPD}${OUTF} $FILES
   rm $FILES   rm $FILES
 +  echo " done."
 else else
   echo -e "Please create a placeholder directory '${SFX}' where\nthe converted files can be stored, then restart script..."   echo -e "Please create a placeholder directory '${SFX}' where\nthe converted files can be stored, then restart script..."
 fi fi
 </code> </code>
software/inkscape_scripts.1462663674.txt.gz · Last modified: 2016/05/08 01:27 by admin