Page 3 of 3

Re: how can I launching external programs?

Posted: Mon Nov 09, 2009 9:08 pm
by methusala
Here's another way to do it, create an svg image using something like this saved to an x.svg file, with the 'Hello out there' words replaced:

Code: Select all

(setf ss "<?xml version=\"1.0\" standalone=\"no\"?>
<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" 
  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">
<svg width=\"10cm\" height=\"3cm\" viewBox=\"0 0 1000 300\"
     xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">
  <desc>Example text01 - \"Hello out there\" in blue</desc>
  <text x=\"250\" y=\"150\" 
        font-family=\"Verdana\" font-size=\"55\" fill=\"blue\" >
    Hello out there
  </text>
  <!-- Show outline of canvas using rect element -->
  <rect x=\"1\" y=\"1\" width=\"998\" height=\"298\"
        fill=\"none\" stroke=\"blue\" stroke-width=\"2\" />
</svg>")

Re: how can I launching external programs?

Posted: Wed Nov 11, 2009 6:09 am
by Wolfgang Tsafack
@methusala

I really don't understand what you mean. You decsrible an xml-script. How can i put my Text inside the svg-image?

@others

1. That' perhaps the better thing to do: visiting an Imagemagick-forum. I will do it, but let talk about the problem again

2. I got it with this code last weekend:

Code: Select all

(system:call-system '("C:/Program Files/ImageMagick-6.5.7-Q16/convert"
                                         "D:/LispWorks/AA/Belege-ocr/20060623-11-48-23.txt"
                                         "+append"
                                         "D:/LispWorks/AA/Belege-ocr/20060623-11-48-23.jpg"))
I became an image created on the specify directory. with add "+append" beetwen the to files-pathes, i make sure that i become only one image.

So now to anther problem. When try to run the same peace of code like this:

Code: Select all

(defun test()
(setf txt "D:/LispWorks/AA/Belege-ocr/20060623-11-48-23.txt")
(setf jpg "D:/LispWorks/AA/Belege-ocr/20060623-11-48-23.jpg")
(system:call-system '("C:/Program Files/ImageMagick-6.5.7-Q16/convert"
                      txt
                      "+append"
                      jpg)))
It didn't work!!! I later want to create image files belong to many text files. That mean I will have this patch stored in a variable. that the reason I make a probe to check out if the code work! Why didn't it work??. I became the following error:
Each element of COMMAND must be of type STRING : (C:/Program
Files/ImageMagick-6.5.7-Q16/convert TXT +append JPG)
. Please note that the first code (editing at the top of this post worked!). Why didn't the second code work?

thank you for all help

Re: how can I launching external programs?

Posted: Wed Nov 11, 2009 6:28 am
by ramarren
Wolfgang Tsafack wrote:Why didn't the second code work?
This is elementary Common Lisp. In:

Code: Select all

'("C:/Program Files/ImageMagick-6.5.7-Q16/convert"
  txt
  "+append"
  jpg)
you create a list with two strings and two symbols. You want to create a list with four string, two of which are values of variables:

Code: Select all

(list "C:/Program Files/ImageMagick-6.5.7-Q16/convert"
      txt
      "+append"
      jpg)
The character #\' is syntax for QUOTE, which does not evaluate its arguments.

EDIT: Also, using SETF this way is wrong. Use LET to establish local variable binding. I suggest that you read a text on Common Lisp written in this millenium, like PCL. Unfortunately, I know not of any comparable text in German.

Re: how can I launching external programs?

Posted: Wed Nov 11, 2009 6:54 am
by methusala
The svg file format is an xml script. Just replace the words 'hello out there' with whatever words you want to display, and open it with any browser except internet explorer.

http://www.w3.org/TR/SVG11/text.html

Lisp related books in German:

http://books.google.com/books?ei=QMX6So ... arch+Books