Giter Site home page Giter Site logo

Comments (17)

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024 1

@mgieseki I see, thanks. I've just tried converting EPS to DVI using

# create test.ps from test.dvi
dvips test
# convert test.ps to test.svg
dvisvgm --eps test.ps

and it worked. Does this mean that my installation of dvisvgm is fully working now?


For those future users who will come across this discussion and who don't want to install Homebrew, there is an alternative solution: just install the following package that already includes mutool: Ghostscript-10.01.1-Extras.pkg.

from dvisvgm.

mgieseki avatar mgieseki commented on June 15, 2024

Unfortunately, I can't really help here because I don't have access to a Mac. It seems, dvisvgm can't find or doesn't get access to the Ghostscript library any longer. Maybe it's now located in a different folder or there are some security measures in place that prevent dvisvgm from accessing the library. I suggest to contact the MacTeX team to have a look at this.

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

@mgieseki Thanks. The Ghostscript library is present and is at the same place at before: /usr/local/share/ghostscript/10.00.0/lib/libgs.dylib.10.00. I tried passing the lib directly to dvisvgm but nothing has changed:

$ dvisvgm --libgs=/usr/local/share/ghostscript/10.00.0/lib/libgs.dylib.10.00 --pdf test.pdf
ERROR: can't retrieve number of pages from file test.pdf

The output of dvisvgm -h is as follows:

$ dvisvgm -h
dvisvgm 3.0.3

This program converts DVI files, as created by TeX/LaTeX, as well as
EPS and PDF files to the XML-based scalable vector graphics format SVG.

Usage: dvisvgm [options] dvifile
       dvisvgm --eps [options] epsfile
       dvisvgm --pdf [options] pdffile

Input options:
  -p, --page=ranges             choose page(s) to convert [1]
  -m, --fontmap=filenames       evaluate (additional) font map files
  -E, --eps                     convert EPS file to SVG
  -P, --pdf                     convert PDF file to SVG
      --stdin                   read input file from stdin

SVG output options:
  -b, --bbox=size               set size of bounding box [min]
  -B, --bitmap-format=fmt       set format used to embed PS/EPS bitmaps [jpeg]
  -j, --clipjoin                compute intersection of clipping paths
      --colornames              prefer color names to RGB values if possible
      --comments                add comments with additional information
      --embed-bitmaps           prevent references to external bitmap files
  -f, --font-format=format      set file format of embedded fonts [svg]
      --grad-overlap            create overlapping color gradient segments
      --grad-segments=number    number of color gradient segments per row [20]
      --grad-simplify=delta     reduce level of detail for small segments [0.05]
  -L, --linkmark=style          select how to mark hyperlinked areas [box]
  -O, --optimize[=modules]      perform several SVG optimizations [all]
  -o, --output=pattern          set name pattern of output files
  -d, --precision=number        set number of decimal points (0-6) [0]
  -R, --relative                create relative path commands
  -s, --stdout                  write SVG output to stdout
      --tmpdir[=path]           set/print the directory for temporary files
  -n, --no-fonts[=variant]      draw glyphs by using path elements [0]
      --no-merge                don't merge adjacent text elements
      --no-styles               don't use CSS styles to reference fonts
  -z, --zip[=level]             create compressed .svgz file [9]

SVG transformations:
  -r, --rotate=angle            rotate page content clockwise [0]
  -c, --scale=sx[,sy]           scale page content
  -t, --translate=tx[,ty]       shift page content
  -T, --transform=commands      transform page content
  -Z, --zoom=factor             zoom page content [1]

Processing options:
  -C, --cache[=dir]             set/print path of cache directory
  -e, --exact-bbox              compute exact glyph bounding boxes
      --keep                    keep temporary files
      --libgs=filename          set name of Ghostscript shared library
  -M, --mag=factor              magnification of Metafont output [4]
      --no-mktexmf              don't try to create missing fonts
  -S, --no-specials[=prefixes]  don't process [selected] specials
  -H, --page-hashes[=params]    activate usage of page hashes [xxh64]
  -a, --trace-all[=retrace]     trace all glyphs of bitmap fonts [no]

Message options:
      --color                   colorize messages
  -h, --help[=mode]             print this summary of options and exit [0]
  -l, --list-specials           print supported special sets and exit
      --progress[=delay]        enable progress indicator [0.5]
  -v, --verbosity=level         set verbosity level (0-7) [7]
  -V, --version[=extended]      print version and exit [no]

Copyright (C) 2005-2023 Martin Gieseking <[email protected]>

I also tried re-installing Ghostscript from here: https://www.tug.org/mactex/morepackages.html but that didn't help either.

I wonder whether dvisvgm has other dependencies that Ghostscript...

from dvisvgm.

mgieseki avatar mgieseki commented on June 15, 2024

What's the output of dvisvgm -V1? Is Ghostscript listed there? If not, dvisvgm can't find or access the Ghostscript library for some reason. Since the upgrade to Ventura broke the functionality and even --libgs doesn't work now, I presume that macOS prevents using the library. This really needs to be investigated by a Mac developer.

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

Indeed, dvisvgm -V1 doesn't list Ghostscript:

$ dvisvgm -V1
dvisvgm 3.0.3 (x86_64-apple-darwin18.7.0)
-----------------------------------------
brotli:   1.0.9
clipper:  6.2.1
freetype: 2.13.0
kpathsea: 6.3.5
potrace:  1.16
xxhash:   0.8.1
zlib:     1.2.13

I guess I should report a bug to the MacTeX team then... In the mean time I'll try to build dvisvgm from source.
Thanks!

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

I tried using the dvisvgm binary from the backup of my computer before the upgrade (actually it was not un upgrade but an installation from scratch of Ventura), and it turns out that dvisvgm -V1 gives the same results:

$ dvisvgm -V1
dvisvgm 3.0.3 (x86_64-apple-darwin18.7.0)
-----------------------------------------
brotli:   1.0.9
clipper:  6.2.1
freetype: 2.13.0
kpathsea: 6.3.5
potrace:  1.16
xxhash:   0.8.1
zlib:     1.2.13

Yet this same binary was working before.

In my backup I also have TeXLive 2019, and its dvisvgm -V1 gives

$ dvisvgm -V1
dvisvgm 2.6.3
-------------
brotli:    1.0.7
clipper:   6.2.1
fontforge: 20160721
freetype:  2.9.1
kpathsea:  6.3.1
potrace:   1.15
xxhash:    0.6.5
zlib:      1.2.11

These lead me to believe that, the fact that dvisvgm -V1 doesn't show Ghostscript is an expected behaviour, and thus the issue seem to lie elsewhere.

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

Also, when running the 2019 dvisvgm, I got a different error message:

$ dvisvgm_2.6.3 --pdf test.pdf 
ERROR: Ghostscript is required to process PDF files

which seems to indicate that the 2023 version does have access to Ghostscript.

from dvisvgm.

mgieseki avatar mgieseki commented on June 15, 2024

which seems to indicate that the 2023 version does have access to Ghostscript.

No, there were many changes in dvisvgm 3 regarding the processing of PDF files. Hence, the error messages might differ as well. If dvisvgm -V1 doesn't list Ghostscript, dvisvgm definitely has no access to the Ghostscript library.

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

@mgieseki I see, thanks. Trying to install Ghostscript via Homebrew. The latest version is 10.01.1 and is not supported by dvisvgm:

$ dvisvgm --pdf test.pdf
ERROR: To process PDF files, either Ghostscript < 10.1 or mutool is required.
The installed Ghostscript version 10.1.1 isn't supported.

(Not sure why it was dented as 10.1.1 while it's only 10.01.1).

Trying to downgrade to 10.00.0 now...

from dvisvgm.

muzimuzhi avatar muzimuzhi commented on June 15, 2024

(Not sure why it was dented as 10.1.1 while it's only 10.01.1).

see #226

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

@muzimuzhi Thanks a lot! I've installed mutool and now every thing works like a charm!!! Even dvisvgm --pdf works without any warning (which is something I don't really understand, because according to #226, mutool should involve only DVI -> SVG).

from dvisvgm.

mgieseki avatar mgieseki commented on June 15, 2024

(which is something I don't really understand, because according to #226, mutool should involve only DVI -> SVG)

The mutool-based PDF handler was introduced with dvisvgm 3.0 because GS replaced its PDF interpreter with a new one that can't be used as the previous one. You can find some information about this in the manual page. PDF files can be referenced from within DVI files so that mutool is used there as well but not exclusively. It's main purpose is to process PDF files.

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

@mgieseki Thanks for the clarification. I guess that means Ghostscript is no longer needed as a dependency, starting from dvisvgm 3.0?

from dvisvgm.

mgieseki avatar mgieseki commented on June 15, 2024

Ghostscript is still required for processing PostScript code, e.g. if you want to convert EPS files or DVI files that contain PS fragments as created by PSTricks for example. This functionality is not available if you build or run dvisvgm without access to the Ghostscript library.

from dvisvgm.

mgieseki avatar mgieseki commented on June 15, 2024

Yes, it seems it's fully working now. In this case, Ghostscript should also be shown in the output of dvisvgm -V1.

from dvisvgm.

netw0rkf10w avatar netw0rkf10w commented on June 15, 2024

Oh, indeed:

$ dvisvgm -V1
dvisvgm 3.0.3 (x86_64-apple-darwin18.7.0)
-----------------------------------------
brotli:      1.0.9
clipper:     6.2.1
freetype:    2.13.0
Ghostscript: 10.1.1
kpathsea:    6.3.5
mutool:      1.22.0
potrace:     1.16
xxhash:      0.8.1
zlib:        1.2.13

I'm not really sure what happened, but I'm glad it's working :D

from dvisvgm.

mgieseki avatar mgieseki commented on June 15, 2024

Great, glad to hear you finally got it working again.

from dvisvgm.

Related Issues (20)

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.