Message Boards Message Boards

How to create a vector conversion web application?

I am wondering if there is a way to create a web application that allows the user to attach a raster image file such as a jpg or jpeg and download a vector image with ImageGraphics. I have figured out everything except how to let the user download the output of ImageGraphics to their computer. I have searched "Download" in the documentation center and I wondering if there is a way to create a button that will download the output file if they click on the button, similar to the function ClickToCopy. I do know that I can create a separate cloud expression link and then that will have a download button for make my own copy but I am wondering if there is a way for something such as ClickToDownload without redirecting.

POSTED BY: Peter Burbery
6 Replies

I have made some changes but this code fails with the automatic download. Sometimes when I deploy the code to the cloud I have a white screen and there is no app.

CloudDeploy[
FormFunction[{"x" -> 
Interpreter[Restricted["UploadedFile", "Image"]]}, 
ImageGraphics@Import[#x] &, "PNG"], 
FileNameJoin[{$CloudRootDirectory, "vector image.svg"}], 
Permissions -> "Public"]
POSTED BY: Peter Burbery

Is there a way to make downloading the file optional?

POSTED BY: Peter Burbery
Posted 2 years ago

I tried this and it works.

POSTED BY: Rohit Namjoshi

I also tried CloudPut and Manipulate.

POSTED BY: Peter Burbery

I tried

CloudDeploy[
 FormFunction[{"image" -> "Image"}, 
  Export[File@"image.svg", ImageGraphics[#image], "SVG"] &]] 

but I can't get it to work.

POSTED BY: Peter Burbery

Does Export do what you need?

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract