TheJacksonLaboratory / isopretGO

Isoform function prediction and interpretation
https://thejacksonlaboratory.github.io/isopretGO/
GNU General Public License v3.0
6 stars 2 forks source link

Error when exporting PDFs #148

Closed hansenp closed 10 months ago

hansenp commented 1 year ago

When I try to export a PDF from the isoform visualization screen (on M2 Macintosh), I get the following error:

image

I installed rsvg-convert (librsvg), but that didn't solve the problem. I then completely reinstalled isopret, i.e. cloned the repository again and recreated the dmg file with rsvg-convert available in the path. But this didn't solve the problem either.

pnrobinson commented 10 months ago

The program does this

Runtime rt = Runtime.getRuntime();
        String[] commands = {"rsvg-convert", "-f" , "pdf", "-o",
                pdfFile.getAbsolutePath(), temp.getAbsolutePath() };
        Process proc = null;
        try {
            proc = rt.exec(commands);

that is, it should work if rsvg-convert is on the system path. (temp is a temporary fiule with the SVG information). Did you still get the same error after installing rsvg-convert? Does rsvg-convert work manually?

pnrobinson commented 10 months ago

I just tried this again. On Mac (M1), I installed the following

brew install librsvg

This put rsvg-converton the system PATH and the isopretGO GUI worked. I am guessing that the dmg file for some reason did not put the app in the PATH. Could you please try this again and see if it works on your side? @hansenp

hansenp commented 10 months ago

I wrote above:

I installed rsvg-convert (librsvg), but that didn't solve the problem. I then completely reinstalled isopret, i.e. cloned the repository again and recreated the dmg file with rsvg-convert available in the path. But this didn't solve the problem either.

So yes rsvg-convert is in my $PATH. But I still get the error.

pnrobinson commented 10 months ago

Do you get an error message or does it just fail?

hansenp commented 10 months ago

I get the following error:

image

I copied this from my terminal:

$ rsvg-convert --help
Convert SVG files to other image formats

Usage: rsvg-convert [OPTIONS] [FILE]...

Arguments:
  [FILE]...  The input file(s) to convert

Options:
  -?, --help                         Display the help
  -v, --version                      Display the version information
  -d, --dpi-x <number>               Pixels per inch [default: 96]
  -p, --dpi-y <number>               Pixels per inch [default: 96]
  -x, --x-zoom <number>              Horizontal zoom factor
  -y, --y-zoom <number>              Vertical zoom factor
  -z, --zoom <number>                Zoom factor
  -w, --width <length>               Width [defaults to the width of the SVG]
  -h, --height <length>              Height [defaults to the height of the SVG]
      --top <length>                 Distance between top edge of page and the image [defaults to 0]
      --left <length>                Distance between left edge of page and the image [defaults to 0]
      --page-width <length>          Width of output media [defaults to the width of the SVG]
      --page-height <length>         Height of output media [defaults to the height of the SVG]
  -f, --format <format>              Output format [default: png] [possible values: png, pdf, ps, eps, svg]
  -o, --output <output>              Output filename [defaults to stdout]
  -i, --export-id <object id>        SVG id of object to export [default is to export all objects]
  -l, --accept-language <languages>  Languages to accept, for example "es-MX,de,en" [default uses language from the environment]
  -a, --keep-aspect-ratio            Preserve the aspect ratio
  -b, --background-color <color>     Set the background color using a CSS color spec [default: none]
  -s, --stylesheet <filename.css>    Filename of CSS stylesheet to apply
  -u, --unlimited                    Allow huge SVG files
      --keep-image-data              Keep image data
      --no-keep-image-data           Do not keep image data
      --completion <completion>      Output shell completion for the given shell [possible values: bash, elvish, fish, powershell, zsh]
hansenp commented 10 months ago

Wit the latest version of isopretGUI, which I built with mvn package, the error no longer occurs.