GithubHelp home page GithubHelp logo

Comments (7)

davidjgraph avatar davidjgraph commented on July 18, 2024

Could the desktop version command line not be used, instead?

from draw-image-export2.

sl-slaing avatar sl-slaing commented on July 18, 2024

@davidjgraph

Could the desktop version command line not be used, instead?

I'm trying to display a SVG image within a webpage, so wouldn't be possible without another service running somewhere.

from draw-image-export2.

Adirelle avatar Adirelle commented on July 18, 2024

Could the desktop version command line not be used, instead?

Is this possible ? Is the CLI described somewhere ? I'm looking to programmatically convert .drawio files to .svg (or even .png) ones. However I have found little to no document about how to do this.

from draw-image-export2.

alderg avatar alderg commented on July 18, 2024

draw.io --help
Usage: draw [options] [input file/folder]

Options:
-V, --version output the version number
-c, --create creates a new empty file if no file is
passed
-k, --check does not overwrite existing files
-x, --export export the input file/folder based on the
given options
-r, --recursive for a folder input, recursively convert
all files in sub-folders also
-o, --output <output file/folder> specify the output file/folder. If
omitted, the input file name is used for
output with the specified format as
extension
-f, --format if output file name extension is
specified, this option is ignored (file
type is determined from output extension,
possible export formats are pdf, png, jpg,
svg, vsdx) (default: "pdf")
-q, --quality output image quality for JPEG (default:
90)
-t, --transparent set transparent background for PNG
-e, --embed-diagram includes a copy of the diagram (for PNG
format only)
-b, --border sets the border width around the diagram
(default: 0)
-s, --scale scales the diagram size
--width fits the generated image/pdf into the
specified width, preserves aspect ratio.
--height fits the generated image/pdf into the
specified height, preserves aspect ratio.
--crop crops PDF to diagram size
-a, --all-pages export all pages (for PDF format only)
-p, --page-index selects a specific page, if not specified
and the format is an image, the first page
is selected
-g, --page-range .. selects a page range (for PDF format only)
-h, --help display help for command

from draw-image-export2.

Adirelle avatar Adirelle commented on July 18, 2024

Thank you. Is there a way do it using node only instead of the full electron build ?

from draw-image-export2.

tomkludy avatar tomkludy commented on July 18, 2024

FYI - I have built a docker container that exposes drawio Desktop (including the SVG export capability) as a RESTful API:

https://hub.docker.com/r/tomkludy/drawio-renderer

Hopefully this can be of help to others; it is already functioning in my own build pipeline.

from draw-image-export2.

davidjgraph avatar davidjgraph commented on July 18, 2024

Thanks for the suggestion. Unfortunately, we're not going to implement this. The problem we've been seeing with feature that we implement but don't actively use is the code just rots and breaks. @tomkludy 's solution looks like a good workaround.

from draw-image-export2.

Related Issues (13)

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.