Home > Explanations, Tips > Fixing textext on Inkscape 0.48

Fixing textext on Inkscape 0.48

November 13, 2010 Leave a comment Go to comments

I encounter one problem today. My textext didn’t work on Inkscape 0.48, I get the error

textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead import os, sys, tempfile, traceback, glob, re, md5, copy
Traceback (most recent call last): File "textext.py", line 306, in <module>
raise RuntimeError("Neither pygtk nor Tkinter is available!")
RuntimeError: Neither pygtk nor Tkinter is available!

The error is due to a module depreciated on the python version used on Inkscape, and that Textext uses. However, it was pretty easy to solve.

  • First you need to download the python packages that are missing, thanks to David Gleich whom packed everything together, avoiding us the trouble of download them and put the pieces together.
  • Unzip them C:\Program Files\Inkscape\python\Lib\site-packages

Then you need to update your textext files,  thanks to Pascal Schulthess for the solution.

  • Go to C:\Program Files\Inkscape\share\extensions, and open textext.py file
  • Now replace
    import inkex
    import os, sys, tempfile, traceback, glob, re, md5, copy
    from lxml import etree
    

    and replace it for

    import inkex
    import os, sys, tempfile, traceback, glob, re, copy
    import hashlib
    from lxml import etree
    
  • And replace this
        def __init__(self, document):
            PdfConverterBase.__init__(self, document)
            self.hash = None
    
        def convert(self, *a, **kw):
            # compute hash for generating unique ids for sub-elements
            self.hash = md5.new('%s%s' % (a, kw)).hexdigest()[:8]
            return PdfConverterBase.convert(self, *a, **kw)
    
        def pdf_to_svg(self):
            exec_command(['pdf2svg', self.tmp('pdf'), self.tmp('svg'), '1'])
    

    for

        def __init__(self, document):
            PdfConverterBase.__init__(self, document)
            self.hash = None
            USE_GTK = False
    
        def convert(self, *a, **kw):
            # compute hash for generating unique ids for sub-elements
            m = hashlib.md5()
            m.update('%s%s' % (a, kw))
            self.hash = m.hexdigest()[:8]
            return PdfConverterBase.convert(self, *a, **kw)
    
        def pdf_to_svg(self):
            exec_command(['pdf2svg', self.tmp('pdf'), self.tmp('svg'), '1'])
    

Restart Inkscape and that would do the work. :mrgreen:

  1. Tester
    February 2, 2011 at 2:31 am

    Hi,

    I have tried your solution and it minimized the errors. Nevertheless it says now:

    File “textext.py”, line 870

    def __init__(self, document):

    ^

    IndentationError: unindent does not match any outer indentation level

    Do you have any suggestions on what might be wrong? The line 870 is line 868 in your code.

    Greetings

  2. Max
    February 4, 2011 at 9:41 am

    Python is very picky about indenting. make sure that in each codeblock you have the same indentation. Use spaces as opposed to tabs. Compare ou inserted code to the other functions and adjust the indentation accordingly.

  3. Sylvia
    February 20, 2011 at 12:19 pm

    So, having followed these instructions I can get rid of the first complaint re: hashlib. But I’m still getting:

    File “textext.py”, line 307, in

    raise RuntimeError(“Neither pygtk nor Tkinter is available!”)

    RuntimeError: Neither pygtk nor Tkinter is available!

    Any advice?

    • February 22, 2011 at 10:43 am

      Probably it is because the python in Inkscape is not updated, try to to replace the files with the download files I explain in the post.

      • bt
        October 14, 2013 at 7:27 pm

        On my computer the replacement of files needed administrator rights. The way I could replace the files was the following. First I extracted the files into a temporary folder, and then copied the extracted files into the necessary folder named in the original post. Before completing the action Windows Explorer notified me that administrator rights are needed, and I had to click proceed. (The self-extraction straight away in the necessary folder did not work, the old files probably weren’t replaced by the new ones, and I didn’t get a notification, and I kept receiving the error from Inkscape.)

      • napon
        August 14, 2015 at 8:49 pm

        hallo , i have already replaced the files, but this error persists. for my PC i have installed python 3.4 before, does it matter?

    • TexText user
      February 1, 2016 at 11:33 pm

      Hi! For those who might interest, I had the same problem after following all the procedure, I still got the error:

      File “textext.py”, line 307, in
      raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
      RuntimeError: Neither pygtk nor Tkinter is available!

      I was using the latest 0.91 version of Inkscape, when I replaced it with the older 0.48 version, the problem was solved and the TexText extension worked just fine 🙂

      • Flavien
        March 1, 2016 at 12:24 am

        Hi I had the same issue. For me it was, once again, a 32bit/64bit incompatibility!

        I uninstalled Inkscape(0.91) 64 Bit and reinstalled Inkscape(0.91) 32 Bit and it worked fine. I Believe this is because 32bit python _glib.pyd refers to 64bit libglib.dll in Inkscape installation directory.

        In a general manner, try to comment the lines in textext.py :

        # try: # Comment this line
        import pygtk
        pygtk.require(‘2.0’)
        import gtk
        USE_GTK = True
        # except ImportError: # Comment this line
        # pass # Comment this line

        So that you will have a clearer meaning of what’s the error.

        Hope it helps!

  4. Sylvia
    February 23, 2011 at 7:27 am

    Cheers, it’s fixed now. I forgot to put the files where I needed them…

  5. Sungkwang
    March 22, 2011 at 12:44 pm

    Thank you for good information. TexText works now.

  6. asmwarrior
    April 9, 2011 at 11:56 am

    thanks, now latex works fine under inkscape 0.48 (I use portable inkscape from http://portableapps.com/)

    Before doing the modification, these packages should be install on the system:
    1,install Miktex, then the pdflatex.exe should be in the PATH
    2,install gs902w32.exe, download from http://code.google.com/p/ghostscript/, gswin32.exe should in PATH
    3,install pstoeditsetup350.exe, and pstoedit.exe should in PATH
    4,install textext-0.4.4.exe
    5,do the modifications as you mentioned.

    Then, every thing works fine. thanks.

  7. Michele
    April 13, 2011 at 9:37 pm

    I did all the procedure you described but i have this error:
    textext.py:227: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)’ failed
    txt.get_buffer().set_text(err_msg)

    Do you know how can i solve it?

    Many thanks in advance

    Michele

  8. Imane
    April 15, 2011 at 2:37 am

    Many Many thanks! that help me a lot!

  9. LEON
    April 30, 2011 at 7:09 pm

    It is very interesting. But I still don’t fix this problem. Could you describe your install in details. I installed Python 2.5.4, pstoedit and textext extension. Then I did what you said in your post. But the problem still exists!

    • May 2, 2011 at 10:53 am

      Did you use the packages in the links?
      If you use those, there is no need to install other things. Everything comes in those packages.
      If you did, the other thing that comes to my mind is that previous installation are giving problem. Try to check which python inkscape is looking for.

  10. Prasad
    August 15, 2011 at 12:44 am

    Hai i have followed the procedure but i am getting the following error

    Traceback (most recent call last):
    File “textext.py”, line 211, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
    File “textext.py”, line 370, in
    converter_cls, old_node))
    File “textext.py”, line 388, in do_convert
    new_node = converter.convert(text, preamble_file, scale_factor)
    File “textext.py”, line 756, in convert
    new_node = self.svg_to_group()
    File “textext.py”, line 778, in svg_to_group
    tree = etree.parse(self.tmp(‘svg’))
    File “lxml.etree.pyx”, line 2692, in lxml.etree.parse (src/lxml/lxml.etree.c:49594)
    File “parser.pxi”, line 1500, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71364)
    File “parser.pxi”, line 1529, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:71647)
    File “parser.pxi”, line 1429, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:70742)
    File “parser.pxi”, line 975, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:67740)
    File “parser.pxi”, line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63824)
    File “parser.pxi”, line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64745)
    File “parser.pxi”, line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64088)
    XMLSyntaxError: Document is empty, line 1, column 1

    could you please help in this matter

    • phero
      October 6, 2011 at 4:29 pm

      Hi, I had a similar problem, and it turned out that my 32-bit pstoedit refused to work with 64-bit version of ghostscript. Installing 64-bit version of pstoedit fixed the problem for me, maybe you should check if your tools are all 32-bit / 64-bit.

      • Prasad
        October 10, 2011 at 6:14 pm

        Thank you for the reply. It worked for me

      • Christoph
        November 17, 2011 at 9:51 pm

        I can confirm that this fixes the error mentioned.

  11. Ye Yuan
    August 30, 2011 at 9:46 pm

    Hi,

    I follow exactly as it said. And I was extremely careful about the indent and space.
    But I still got this error,

    File “textext.py”, line 872

    USE_GTK = False

    ^

    IndentationError: unexpected indent

    Could you please help in this manner

    • August 30, 2011 at 9:49 pm

      Did you check this?

    • Julian
      November 22, 2013 at 4:52 am

      You have to indent the commands with SPACES not with TAB, be careful

  12. Payton
    September 20, 2011 at 12:29 am

    Awesome post. Solved my problem in 5 minutes. Gracias

    • November 18, 2011 at 5:12 pm

      De nada…
      I’m glad it helps… :mrgreen:

  13. Myungsunn Ryu
    October 3, 2011 at 7:49 pm

    Thanks to all the great posts I got to the point of entering some TeX inputs.
    But when I enser something like $a$ or anything normal TeX input and press “OK” I get this stream of error messages:

    Traceback (most recent call last):
    File “textext.py”, line 211, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
    File “textext.py”, line 370, in
    converter_cls, old_node))
    File “textext.py”, line 390, in do_convert
    converter.finish()
    File “textext.py”, line 680, in finish
    self.remove_temp_files()
    File “textext.py”, line 737, in remove_temp_files
    self.try_remove(self.tmp_path)
    File “textext.py”, line 744, in try_remove
    os.rmdir(filename)
    WindowsError: [Error 145] : ‘c:\\docume~1\\mingshey\\locals~1\\temp\\tmpw1uq17’

    • evidals
      July 30, 2016 at 1:57 am

      Hi! I´m in the same point and i´ve similar errors
      Traceback (most recent call last):
      File “textext.py”, line 211, in cb_ok
      self.callback(self.text, self.preamble_file, self.scale_factor)
      File “textext.py”, line 370, in
      converter_cls, old_node))
      File “textext.py”, line 388, in do_convert
      new_node = converter.convert(text, preamble_file, scale_factor)
      File “textext.py”, line 751, in convert
      self.tex_to_pdf(latex_text, preamble_file)
      File “textext.py”, line 730, in tex_to_pdf
      raise RuntimeError(“pdflatex didn’t produce output”)
      RuntimeError: pdflatex didn’t produce output

  14. Myungsunn Ryu
    October 3, 2011 at 9:08 pm

    When I rummage the directory ‘c:\\docume~1\\mingshey\\locals~1\\temp\\tmpw1uq17′ and open the texput.log file which reports the error:

    This is pdfTeX, Version 3.1415926-2.3-1.40.12 (Web2C 2011) (format=pdflatex 2011.10.3) 3 OCT 2011 21:04
    entering extended mode
    restricted \write18 enabled.
    %&-line parsing enabled.
    **c:\docume~1\mingshey\locals~1\temp\tmpawgi2e\tmp.tex -interaction=nonstopmode
    -halt-on-error

    ! Emergency stop.
    c:\docume
    ~1\mingshey\locals~1\temp\tmpawgi2e\tmp.tex -interaction=nonsto…
    End of file on the terminal!

    Here is how much of TeX’s memory you used:
    1 string out of 493633
    83 string characters out of 3145073
    49245 words of memory out of 3000000
    3405 multiletter control sequences out of 15000+200000
    3640 words of font info for 14 fonts, out of 3000000 for 9000
    831 hyphenation exceptions out of 8191
    0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,50000s
    ! ==> Fatal error occurred, no output PDF file produced!

  15. Myungsunn Ryu
    October 3, 2011 at 9:51 pm

    I overlooked the issue with TeX Live. I was working with TeXLive and now I see I have to download MikTeX.

    Thanks for all the help!

  16. duckfunny
    October 12, 2011 at 3:34 pm

    Hey,

    First of all thanks a lot. It solved a few errors, but now there are new ones:

    Traceback (most recent call last):

    File “textext.py”, line 937, in

    e.affect()

    File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect

    self.effect()

    File “textext.py”, line 349, in effect

    % ‘;\n’.join(converter_errors))

    RuntimeError: No Latex -> SVG converter available:

    Pdf2Svg: Command pdf2svg failed: [Error 2] Das System kann die angegebene Datei nicht finden;

    PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] Das System kann die angegebene Datei nicht finden;

    SkConvert: Command pstoedit failed: [Error 2] Das System kann die angegebene Datei nicht finden

    Sorry for the german parts. There is just standing, that the system cannot find the files. I tried to fix this problem without success. Maybe somebody can help me.

    Greetz, duckfunny

    • Tariq
      November 22, 2011 at 7:34 am

      Hello Duck funny. I am exactly getting the same errors as yours:

      Traceback (most recent call last):

      File “textext.py”, line 936, in

      e.affect()

      File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect

      self.effect()

      File “textext.py”, line 349, in effect

      % ‘;\n’.join(converter_errors))

      RuntimeError: No Latex -> SVG converter available:

      Pdf2Svg: Command pdf2svg failed: [Error 2] The system cannot find the file specified;

      PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;

      SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified

      Kindly help me with the solution.

      • Caitlin
        December 8, 2011 at 3:29 am

        I fixed this by added the pstoedit path to the path system variable.

  17. duckfunny
    October 12, 2011 at 5:52 pm

    Ok, now the latex-formula is working somehow, there are still errors but i get my latextext. I followed this [url=http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape]this[\url] to fix the problem above. But now there is the next problem. After the dialog box for textext following error happens:

    textext.py:177: GtkWarning: Attempting to store changes into `C:\Programme\HOME\.recently-used.xbel’, but failed: Datei »C:\Programme\HOME\.recently-used.xbel.95WE3V« konnte nicht angelegt werden: Permission denied

    gtk.main()

    textext.py:177: GtkWarning: Attempting to set the permissions of `C:\Programme\HOME\.recently-used.xbel’, but failed: Permission denied

    gtk.main()

    Anyone an idea what to do?

    Greetz, duckfunny

    • October 12, 2011 at 6:05 pm

      Hi, that looks like you have some issues with your folder permissions. Try to see if the “Read Only” option is marked. Then, uncheck it.

  18. duckfunny
    October 12, 2011 at 6:25 pm

    Hey, thank you for your quick answer! Thats solved the errors by Latex-Formula. This works now fine. TexText says me now: “Error when examining the file C:\Programme\HOME with fstat(): No such file or directory”. When I ignore this message and use the textext dialog box to create latex signs it seems to be working but nothing appears. greetz

  19. Eph
    November 10, 2011 at 9:39 pm

    Thank you very much for this post, it solved my issues within minutes.

    Since the original author does not seem to maintain textext any more, would it be interesting to take textext and your fix to start a branch?

  20. Inkscape_texText_Linux
    November 17, 2011 at 6:40 am

    How to configure texText for inkscape 0.48 version on Linux PC?

    • November 18, 2011 at 5:16 pm

      Hi, I haven’t try to use this fix in a Linux box. But, the issues are related to python. So you may start looking in there.

      Try to replace the code, as explained. And then pray that your version of python works. I’m not sure if Inkscape uses the python installed in Linux or it uses its own, like Windows. You should try to change it so it includes the latest versions.

      Good luck in your endeavor.

  21. zymurge
    December 9, 2011 at 11:23 am

    This immediately fixed my problem, thank you so much!!

  22. .:Pi_Man:.
    December 16, 2011 at 9:17 pm

    Thanks for the instructions!

    It seems to have solved most of the problems only now I get an error from windows regarding pstoedit, “The application was unable to start correctly (0xc000007b)” consequently inkscape returns an IO error, presumably as it’s looking for something that pstoedit should have created.

    Traceback (most recent call last):

    File “eqtexsvg.py”, line 156, in

    e.affect()

    File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect

    self.effect()

    File “eqtexsvg.py”, line 150, in effect

    svg_open(self, svg_file)

    File “eqtexsvg.py”, line 81, in svg_open

    doc = inkex.etree.parse(filename)

    File “lxml.etree.pyx”, line 2692, in lxml.etree.parse (src/lxml/lxml.etree.c:49594)

    File “parser.pxi”, line 1500, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71364)

    File “parser.pxi”, line 1529, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:71647)

    File “parser.pxi”, line 1429, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:70742)

    File “parser.pxi”, line 975, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:67740)

    File “parser.pxi”, line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63824)

    File “parser.pxi”, line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64745)

    File “parser.pxi”, line 563, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64060)

    IOError: Error reading file ‘c:\users\jamesd~1\appdata\local\temp\inkscape-zs_jeu\eq.svg’: failed to load external entity “file:///c:/users/jamesd~1/appdata/local/temp/inkscape-zs_jeu/eq.svg”

    Any help would be much appreciated!

  23. Zedge
    December 21, 2011 at 4:21 am

    Hello,

    Thanks for explanation, but I have the same problem described here :

    Michele :
    I did all the procedure you described but i have this error:
    textext.py:227: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)’ failed
    txt.get_buffer().set_text(err_msg)
    Do you know how can i solve it?
    Many thanks in advance
    Michele

    Thanks for your help!

  24. Mohsen Heshmati
    December 26, 2011 at 12:48 am

    It worked perfectly for me. Although at first I encountered some errors, I removed all the modifications and modified the file again very carefully… Indentations and spaces are very sensitive in this sort of file I suppose. Therefore, edit the lines one by one in each section and when you’re copy pasting, have an extra eye for your selection. thank you author again!

  25. Jackal
    January 17, 2012 at 5:57 pm

    can you help me with error message after following your solutions:

    Traceback (most recent call last):
    File “textext.py”, line 212, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
    File “textext.py”, line 371, in
    converter_cls, old_node))
    File “textext.py”, line 389, in do_convert
    new_node = converter.convert(text, preamble_file, scale_factor)
    File “textext.py”, line 753, in convert
    self.pdf_to_svg()
    File “textext.py”, line 767, in pdf_to_svg
    raise NotImplementedError
    NotImplementedError

  26. gaortizg
    February 3, 2012 at 11:45 am

    Hello people from WordPress… Check this solution… It worked for me and now I have TeXtext running with Inkscape 0.48 without errors (In Linux of course….):

    http://gaortizg.wordpress.com/2012/01/29/how-to-write-with-latex-in-inkscape/

    See you later…..

  27. Lars Abrahamsson
    February 8, 2012 at 6:21 am

    Caitlin :
    I fixed this by added the pstoedit path to the path system variable.

    I have all these paths entered, but still get the same error message, but in english:

    Traceback (most recent call last):

    File “textext.py”, line 937, in

    e.affect()

    File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect

    self.effect()

    File “textext.py”, line 349, in effect

    % ‘;\n’.join(converter_errors))

    RuntimeError: No Latex -> SVG converter available:

    Pdf2Svg: Command pdf2svg failed: [Error 2] The system cannot find the file specified;

    PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;

    SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified

    • Lars Abrahamsson
      February 8, 2012 at 7:09 am

      Maybe I should also mention that

      1.
      I also added
      “C:\Program Files\gs\gs9.02\bin\”;”C:\Program Files\gs\gs9.02\lib”;
      into the PATH

      2.
      I also followed all the instructions on
      http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape
      Sometimes it is hard to know which versions of software to chose, e.g. with GraphicsMagick we have Q8 and Q16 and I do not really understand the difference.

      3.
      The errors remained.

      4.
      Then i typed in the entire path to PDF2SVG in the textext.PY file.

      Then my new error message at least change a bit. But I do not know if it is good or bad.

      Se below:

      Traceback (most recent call last):

      File “textext.py”, line 937, in

      e.affect()

      File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect

      self.effect()

      File “textext.py”, line 349, in effect

      % ‘;\n’.join(converter_errors))

      RuntimeError: No Latex -> SVG converter available:

      Pdf2Svg: Command C:\Program Files (x86)\pdf2svg\pdf2svg failed (code 0):

      PDFTron PDF2SVG V5.10.

      Copyright (c) 2002-2010 PDFTron Systems Inc., http://www.pdftron.com.

      You are running a DEMO version of PDF2SVG.

      The demo version has several limitations. Please consult the documentation for details.

      Usage: pdf2svg [] file…

      OPTIONS:

      –file… arg A list of folders and/or file names to process.

      -o [ –output ] arg The output folder used to store modified files.

      By default, the current working folder will be

      used to store converted files.

      –subfolders Process all subfolders.

      –prefix arg The prefix for the output image file. The output

      filename will be constructed by concatenating

      the prefix string, the page number,and the

      appropriate extension (e.g. myfile_01.svg,

      myfile_02.svg, etc).The prefix option should be

      used only for conversion of individual

      documents. By default, each input filename will

      be used as a prefix.

      –digits arg The number of digits used in the page counter

      portion of the output filename.

      -a [ –pages ] arg (=-) Specifies the list of pages to convert. By

      default, all pages are converted.

      –svgz Compress output SVG files using SVGZ. By

      default, generated SVG output is not compressed.

      -i [ –embedimages ] Embeds all images. By default, all images are

      saved as external files.

      –nofonts Disables conversion of font data to SVG. By

      default, all available fonts are converted to

      SVG.

      –nounicode Disables mapping of text to public Unicode

      region. Instead text will be converted using a

      custom encoding. By default, all text is mapped

      to Unicode.

      -b [ –box ] arg (=crop) Specifies the page box/region to use for

      clipping. Possible values are:

      media

      crop

      trim

      bleed

      art

      The default is page crop region.

      -c [ –crop ] arg User definable crop box to be used as a top

      level clip region in the output SVG. By default,

      the clip region is identical to currently

      selected page ‘box’.

      –noclip Disables page clipping. Any content outside of

      page boundaries will be visible. By default, all

      pages are clipped.

      –noannots Disables conversion of form fields and

      annotations.

      –noxmldoc Disables generation of the XML wrapper document.

      –thumbsize arg (=100) The dimension of thumbnail image in pixels. By

      default, PDF2SVG will generate 100×100

      thumbnails.

      –nothumbs Disables generation of thumbnail images.

      –asv_css_patch Some versions of the Adobe SVG viewer fail to

      read valid CSS font properties. As a result,

      this option was created as a workaround for this

      bug in the Adobe SVG Viewer. Please note that

      using this option may cause problems with other

      SVG viewers.

      –individual_char_placement Some viewers do not support the default text

      positioning correctly. This option works around

      this issue to place text correctly, but produces

      verbose output. This option will override

      –remove_char_placement.

      –remove_char_placement Disable the output of character positions. This

      will produce slightly smaller output files than

      the default setting, but many viewers do not

      support the output correctly.

      –noprompt Disables any user input. By default, the

      application will ask for a valid password if the

      password is incorrect.

      -p [ –pass ] arg The password for secured PDF files. Not required

      if the input document is not secured using the

      ‘open’ password.

      –extension arg (=.pdf) The default file extension used to process PDF

      documents. The default extension is “.pdf”.

      –verb arg (=1) Set the opt.m_verbosity level to ‘arg’ (0-2).

      -v [ –version ] Print the version information.

      -h [ –help ] Print a listing of available options.

      Examples:

      pdf2svg -o test_out/ex1 “PDFTron PDF2SVG User Manual.pdf”

      pdf2svg -o test_out/ex2 –svgz –nothumbs –noxmldoc -i .

      pdf2svg -o test_out/ex3 -p mypass secret.pdf

      pdf2svg -o test_out/ex4 –verb 3 –digits 6 -i –pages odd –svgz –noclip box .

      pdf2svg -o test_out/ex5 –verb 3 –embedimages –pages 1 –svgz –box media .

      ;

      PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;

      SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified

      • Lars Abrahamsson
        February 8, 2012 at 7:51 am

        I should also mention that reading

        https://bitbucket.org/pv/textext/issue/55/textext-using-inkscape048

        it seams like it is better to use 32 bit software even if having a 64 bit computer. I that true?

        However, I replaced my GS View and Ghostscript with their respective 32 bit versions, but it did not make any difference to the error messages.

        /Lars

    • April 29, 2012 at 4:03 pm

      Yes I also have the same problem with same error message. Somebody help….

  28. March 3, 2012 at 5:46 pm

    Superb! Work just a you said. Had the same problem with inkscape 0.48 on OS X 10.6.8, installed dependencies via macports but when trying to use textext had the problem you described here. Replaced everything, restarted, and it works!

  29. April 3, 2012 at 7:41 pm

    Thanks a lot, you saved my day!

  30. mkj
    April 9, 2012 at 10:35 pm

    Caitlin :
    I fixed this by added the pstoedit path to the path system variable.

    please can you specify the way to add the pstoedit path to the path system variable. what did you write in the path system variable
    thanks in advance

  31. April 29, 2012 at 4:06 pm

    Caitlin :
    I fixed this by added the pstoedit path to the path system variable.

    I have done the same. But I get the error message:
    Traceback (most recent call last):

    File “textext.py”, line 937, in

    e.affect()

    File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect

    self.effect()

    File “textext.py”, line 349, in effect

    % ‘;\n’.join(converter_errors))

    RuntimeError: No Latex -> SVG converter available:

    Pdf2Svg: Command pdf2svg failed: [Error 2] The system cannot find the file specified;

    PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;

    SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified

    Waiting for your reply…. Plz Plz help……

  32. Desperate person
    May 4, 2012 at 12:00 am

    Hello, dear human being looking at your computer.
    I come to you as a last resort.

    It’s been two days that I’ve been trying to install Textext 0.4.4 for Inkscape 0.48 (under Windows XP, using Miktek 2.9)

    I followed
    – these instructions https://laconsigna.wordpress.com/2010/11/13/fixing-textext-on-inkscape-0-48/
    – and these instructions http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape#Install_Textext
    – and these instructions http://people.orie.cornell.edu/jmd388/design/guides/textext.pdf
    – and I’ve looked through this board https://bitbucket.org/pv/textext/issues

    But I keep having the same error message when I try to write something in Textext:

    Traceback (most recent call last):
    File “textext.py”, line 211, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
    File “textext.py”, line 370, in
    converter_cls, old_node))
    File “textext.py”, line 388, in do_convert
    new_node = converter.convert(text, preamble_file, scale_factor)
    File “textext.py”, line 752, in convert
    self.pdf_to_svg()
    File “textext.py”, line 766, in pdf_to_svg
    raise NotImplementedError
    NotImplementedError

    Please, help me…

  33. BAZA
    June 8, 2012 at 7:49 pm

    I can’t download the missing python packages. Can you tell which ones to look for? Otherwise it’s very complicated to carry on. Thanks

    • Nixmich
      July 7, 2014 at 11:57 pm

      I know this is two years old, but in case anyone else is still facing problems downloading the packages: I wasn’t able to access the website with Firefox due to certificate issues, but using InternetExplorer did the trick!

  34. wookpm
    July 30, 2012 at 8:37 am

    Thanks for the solution. However, I got the same program as somebody else, which gave

    File “textext.py”, line 307, in

    raise RuntimeError(“Neither pygtk nor Tkinter is available!”)

    RuntimeError: Neither pygtk nor Tkinter is available!

    I have already copied everything downloaded into the Inkscape\python\Lib\site-packages, but still have problem. I am using inkscape 0.48

  35. scottyd
    August 6, 2012 at 10:16 pm

    Thank so much for the solution, adin and asmwarrior. This was driving me absolutely nuts!

    – Note for everyone else, I did nearly exactly as asmwarrior suggested, but for two adjustments.

    1. pstoedit version was 3.60
    2. I only made the first of the two edits to textext.py, as suggested by adin above.

    Cheers,
    D

    PS – my firewall alerts me to a possible security issue with the python downloads package. I bypassed the warnings…so far no computer malfunction…

  36. Mic
    August 8, 2012 at 3:47 am

    Same error as wookpm,

    Followed the instructions but I have the error:

    ” File “textext.py”, line 307, in

    raise RuntimeError(“Neither pygtk nor Tkinter is available!”)

    RuntimeError: Neither pygtk nor Tkinter is available!”

  37. andrea
    August 15, 2012 at 8:40 am

    Hi I am having the same problem as desperate person please help!!!

    thanks

    Desperate person :
    Hello, dear human being looking at your computer.
    I come to you as a last resort.
    It’s been two days that I’ve been trying to install Textext 0.4.4 for Inkscape 0.48 (under Windows XP, using Miktek 2.9)
    I followed
    – these instructions https://laconsigna.wordpress.com/2010/11/13/fixing-textext-on-inkscape-0-48/
    – and these instructions http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape#Install_Textext
    – and these instructions http://people.orie.cornell.edu/jmd388/design/guides/textext.pdf
    – and I’ve looked through this board https://bitbucket.org/pv/textext/issues
    But I keep having the same error message when I try to write something in Textext:
    Traceback (most recent call last):
    File “textext.py”, line 211, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
    File “textext.py”, line 370, in
    converter_cls, old_node))
    File “textext.py”, line 388, in do_convert
    new_node = converter.convert(text, preamble_file, scale_factor)
    File “textext.py”, line 752, in convert
    self.pdf_to_svg()
    File “textext.py”, line 766, in pdf_to_svg
    raise NotImplementedError
    NotImplementedError
    Please, help me…

  38. August 21, 2012 at 6:55 pm

    It seems this error is quite frequent:

    Traceback (most recent call last):

    File “textext.py”, line 937, in

    e.affect()

    File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect

    self.effect()

    File “textext.py”, line 349, in effect

    % ‘;\n’.join(converter_errors))

    RuntimeError: No Latex -> SVG converter available:

    Pdf2Svg: Command pdf2svg failed: [Error 2] Impossibile trovare il file specificato;

    PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] Impossibile trovare il file specificato;

    SkConvert: Command pstoedit failed: [Error 2] Impossibile trovare il file specificato

    Is there anyone that solved it?
    Thanks

    • August 21, 2012 at 7:17 pm

      farronait :
      It seems this error is quite frequent:
      Traceback (most recent call last):
      File “textext.py”, line 937, in
      e.affect()
      File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
      self.effect()
      File “textext.py”, line 349, in effect
      % ‘;\n’.join(converter_errors))
      RuntimeError: No Latex -> SVG converter available:
      Pdf2Svg: Command pdf2svg failed: [Error 2] Impossibile trovare il file specificato;
      PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] Impossibile trovare il file specificato;
      SkConvert: Command pstoedit failed: [Error 2] Impossibile trovare il file specificato
      Is there anyone that solved it?
      Thanks

      SOLVED: http://people.orie.cornell.edu/jmd388/design/guides/textext.pdf
      Follow this guide!

  39. Slaunger
    August 29, 2012 at 10:04 pm

    I am experiencing a weird problem. I have implemnted the changes to textext.py as devised above. I have had the file opened afterwards three times to check that i actually saved it the right place under

    C:\Program Files (x86)\Inkscape\share\extensions

    Yet, when I try to use the extension, I get this deprecation warning

    textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead

    import os, sys, tempfile, traceback, glob, re, md5, copy

    But my textext.py file looks like this on l 55-56

    import os, sys, tempfile, traceback, glob, re, copy
    import hashlib

    Not the same as reported by the script?!?

    Besides that i get no error messages now (I replaced the 64 bit pstoedit with the 32 bit version, as the first gave a run time error), I do not get anything rendered in LaTeX either.

    How can inkscape think it is working on a different .py file. I came to think of precompiled .pyd files but could not find any in the same folder. I did find a texttex.idx file (?), and tried renaming that to _textetx.idx just to see if that changed anything. But it didn’t.

    Please help.

  40. Slaunger
    August 29, 2012 at 10:20 pm

    Correction to the above post. It actually works (I just did not notice as the LaTeX rendered objects were stuck in a corner far away from the area on the drawing where i had zoomed in). I just get the weird and annoying deprecation error now every time i use the extension despite the fact that I do not appear to use md5 any longer in the script as explained above.

  41. Alexus
    October 19, 2012 at 5:07 am

    This has solved my problem. Thanks!!!

  42. Matthias
    December 10, 2012 at 4:47 am

    Thank you very much! It worked perfectly! Regards, Matthias

  43. December 19, 2012 at 5:33 am

    Thanks it worked in OS X 10.8.2 with inkscape 0.48. I, however, didn’t have to download any additional packages as these come included in the OS. I just modified the code.

  44. February 23, 2013 at 9:37 am

    Thank you for this solution! Now I can combine the power of Inkscape, LaTeX and KnotPlot (a truly wonderful application) to draw beautiful figures for my thesis! 🙂
    See also: http://www.inkscapeforum.com/viewtopic.php?f=5&t=4937

  45. r g
    March 17, 2013 at 5:13 am

    THANK YOU SO MUCH! Works on my system : Windows 8 64-bit.

  46. May 7, 2013 at 5:01 am

    Thanks a lot! It works!!! You saved my day!

  47. July 11, 2013 at 4:10 am

    Hi!
    I followed the instructions as you described and managed the problems. However, still when I click the TexText in the menu of extensions, there comes the window that says “Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.” However it does not show any specific error below. What could be the problem?
    thanks a lot

    • jupaconi
      August 12, 2014 at 5:44 am

      Hi, did you find a solution for that??
      I followed the instructions as well and it worked just one time, since then i have the same problem.

      thanks

  48. David Ward
    July 12, 2013 at 7:04 pm

    i’ve follwed your advise and got to the point where I try and add LaTeX code, but I then get the following pop-up box:

    Error occured while converting from Latex to SVG:

    Traceback (most recent call last):
    File “textext.py”, line 211, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
    File “textext.py”, line 370, in
    converter_cls, old_node))
    File “textext.py”, line 388, in do_convert
    new_node = converter.convert(text, preamble_file, scale_factor)
    File “textext.py”, line 756, in convert
    new_node = self.svg_to_group()
    File “textext.py”, line 778, in svg_to_group
    tree = etree.parse(self.tmp(‘svg’))
    File “lxml.etree.pyx”, line 2692, in lxml.etree.parse (src/lxml/lxml.etree.c:49594)
    File “parser.pxi”, line 1500, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71364)
    File “parser.pxi”, line 1529, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:71647)
    File “parser.pxi”, line 1429, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:70742)
    File “parser.pxi”, line 975, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:67740)
    File “parser.pxi”, line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63824)
    File “parser.pxi”, line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64745)
    File “parser.pxi”, line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64088)
    XMLSyntaxError: Document is empty, line 1, column 1

    Does anyone know how I can correct this problem (bearing in mind that I am a complete novice with these kinds of things, so you will need to keep things very simple!)

  49. September 27, 2013 at 8:10 am

    It worked, kind of, thanks a lot.

  50. Derek
    October 4, 2013 at 11:50 am

    I finally got it to work, though it wasn’t easy. After I had followed all the steps, it still wouldn’t work and I couldn’t figure out why. My problem? I simply forgot to encapsulate the LaTeX code within $$.

  51. Raul
    November 13, 2013 at 11:51 am

    I got File “textext.py”, line 307, in
    raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
    RuntimeError: Neither pygtk nor Tkinter is available!

    So I restarted Inkscape twice and it work it perfectly!

  52. Mat Hunt
    November 14, 2013 at 10:36 pm

    Hi,

    I downloaded the latest version of python and the textext and I followed the suggestions and I got the following error:

    Traceback (most recent call last):
    File “textext.py”, line 937, in
    e.affect()
    File “/usr/share/inkscape/extensions/inkex.py”, line 215, in affect
    self.effect()
    File “textext.py”, line 349, in effect
    % ‘;\n’.join(converter_errors))
    RuntimeError: No Latex -> SVG converter available:
    Pdf2Svg: Command pdf2svg failed: [Errno 2] No such file or directory;
    PstoeditPlotSvg: Command pstoedit -help failed: [Errno 2] No such file or directory;
    SkConvert: Command pstoedit failed: [Errno 2] No such file or directory

  53. David
    February 3, 2014 at 10:28 pm

    It is blogg posts such as this that makes the scientific community go around. I humbly thank you for your effort!

    Cheers from sweden!

  54. Bharath
    September 15, 2014 at 8:41 pm

    Thank you sir! it woks like a charm!…

  55. Jan
    October 3, 2014 at 1:42 am

    Great stuff! Thanks for that.

  56. D
    October 9, 2014 at 10:57 pm

    Installing was an awesome experience. Think I had every error you described here, too. Never thought, it would work in the end. But thanks to you guys I also found the solutions here. And as Derek, I forgot $..$,too. So thanks a lot to you all and don’t give up installing 😉

  57. LN
    October 19, 2014 at 6:54 am

    It is undoubtedly a keyword tool that take your business to another level. You is going to be surprised that lots of people don’t understand that they can track their pay per click marketing results so they did not track at all. Google, rolling around in its efforts to create searches easier and faster has come up while using plus1buton.

  58. December 28, 2014 at 12:28 pm

    It’s remarkable for me to have a web site, which is helpful for
    my experience. thanks admin

  59. Jo
    January 9, 2015 at 12:32 am

    Thank you for your really helpful blog and the posts. Here, I found all the information I need to solve the problem. Now, the “TexText”-extension work smoothly.
    A tribute to all of you.

  60. February 12, 2015 at 6:55 pm

    Hello, I intend to textext file, but the file is protected and can not save the modified content. How to do about that?

    • February 12, 2015 at 6:56 pm

      intend to modify textext file, sorry for the mistype..

  61. Chen
    March 19, 2015 at 9:51 am

    Seems like this solution doesn’t work anymore for Inkscape 0.91 for Windows. It keeps raising the pygtk not found error, even though I have pygtk in the library. Anyone having the same problem?

    • November 15, 2015 at 9:46 am

      I can confitm it also. I’ve installed all programs (gs, gv, imagemagic, etc.) and additional pygtk sruff from the post above and fixed all strings in the script, but it doesn’t work complaining about unavailable Tkinter or Pygtk package. It seems that Python in 0.91 can’t import or load it.

  62. June 9, 2015 at 11:57 pm

    I have same issue on Inkscape 0.91, Windows 7 x64 and looking for solution to run textext, any solution?

  63. Alex
    July 22, 2015 at 11:03 pm

    Hey Thanks for the fix.

    Working with 0.48 but does not with 0.91 😥

  64. vovo
    January 23, 2016 at 8:18 pm

    Does anyone know fix for 0.91?

  65. AG
    February 13, 2016 at 9:16 pm
  66. Flo
    April 12, 2016 at 7:16 pm

    Hi,
    I’ve been following the steps (great btw, thanks a lot), but now I am facing an issue that I couldn’t find anywhere on the comments :

    Everything works perectly fine, I just cannot write anything in the box whic appears. Any idea ?

  67. Jambulat
    July 4, 2016 at 10:08 pm

    I didn’t read all the comments but I still hadan issue after did all as stated in the first post.
    Error code as follows:

    Traceback (most recent call last):

    File “textext.py”, line 937, in

    e.affect()

    File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 268, in affect

    self.effect()

    File “textext.py”, line 349, in effect

    % ‘;\n’.join(converter_errors))

    RuntimeError: No Latex -> SVG converter available:

    Pdf2Svg: Command pdf2svg failed (code -2): Usage: pdf2svg []

    ;

    PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;

    SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified

    (I use pdf2svg)

    The fix is following: to change in textext.py 926 line ‘254’ to ‘-2’ as follows:

    def available(cls):
    “””Check whether pdf2svg is available, raise RuntimeError if not”””
    exec_command([‘pdf2svg’], ok_return_value=-2)
    available = classmethod(available)

  68. Jambulat
    July 4, 2016 at 10:16 pm

    I still have an error:

    Traceback (most recent call last):
    File “textext.py”, line 211, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
    File “textext.py”, line 370, in
    converter_cls, old_node))
    File “textext.py”, line 390, in do_convert
    converter.finish()
    File “textext.py”, line 680, in finish
    self.remove_temp_files()
    File “textext.py”, line 737, in remove_temp_files
    self.try_remove(self.tmp_path)
    File “textext.py”, line 744, in try_remove
    os.rmdir(filename)
    WindowsError: [Error 145] The directory is not empty: ‘c:\\users\\jambulat\\appdata\\local\\temp\\tmp3lrb00’

    Inkscape version 0.91 32bit

  69. Jambulat
    July 4, 2016 at 11:52 pm

    Now works. The last problem was in

    tempfile.mkdtemp()

    because my user directory name contains ‘.’, this rerurned wrong path. So I had to do the change:

    self.tmp_path = ‘C:\Users\Jam.bulat\AppData\Local\Temp’ #tempfile.mkdtemp()
    self.tmp_base = ”.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(8)) #’tmp’

    and

    changed

    def remove_temp_files(self):
    “””Remove temporary files”””
    base = os.path.join(self.tmp_path, self.tmp_base)
    for filename in glob.glob(base + ‘*’):
    self.try_remove(filename)
    self.try_remove(base)

    self.try_remove(base) instead of self.try_remove(self.tmp_path)

    Good Luck to All!

  70. Sebpo
    September 11, 2016 at 4:23 pm

    Thanks a lot for this useful description and the work figuring it out!

  71. September 15, 2016 at 5:02 pm

    Hi!, i have this problem as soon as i try to use the Tex Text extension and i don’t know what to do. This occurs after i replaced the lines in the textext.py file.

    textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead

    import os, sys, tempfile, traceback, glob, re, md5, copy

    Traceback (most recent call last):

    File “textext.py”, line 306, in

    raise RuntimeError(“Neither pygtk nor Tkinter is available!”)

    RuntimeError: Neither pygtk nor Tkinter is available!

  72. Gab
    March 3, 2017 at 8:56 pm

    For Inkscape 0.92, I applied the fix above and I kept having the tkinter missing issue. To solve it I installed on my computer python 2.7.13 (64-bits installer https://www.python.org/downloads/release/python-2713/) in a folder named ‘python’, and then copied-pasted the newly installed ‘python’ folder to replace the one inside the folder where Inkscape is installed. Now it works.

    • MedNait
      June 21, 2017 at 5:20 pm

      I tried doing this with Inkscape 0.92 x86, after having the same problem, but it didn’t work. Was it Inkscape 64bits version you installed?

  1. December 9, 2014 at 10:48 am

Leave a reply to Ye Yuan Cancel reply