Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New output modes #92

Open
wants to merge 6 commits into
base: gh-pages
Choose a base branch
from
Open

Conversation

alfredott
Copy link

Hi !

This PR adds the possibility to switch between more than 2 output modes, and to use the image in the JS code.

It solves the following issues : #77, #68, #91, and any other issue that can be solved by getting the image from the JS code.

 
Technically :
First thing, I'm adding the "outputMode" setting (string), instead of "exportOnly" (boolean), because the latter only gave us 2 choices (download/print).
To do the same as before, we only have to do the following changes :

  • exportOnly: false --> outputMode: 'print'
  • exportOnly: true --> outputMode: 'download'

Second thing, I'm adding the 'event' option for the "outputMode" setting, so that we can get the image from anywhere in the JS code.

I also changed the Readme to be up to date with the new "outputMode" option.

I hope this PR can be accepted, feel free to tell me if you think I have to make some adjustments.

Bye !

I'm proposing to add the "outputMode" setting (string), instead of "exportOnly" (boolean), because the latter only gave us 2 choices (download/print).
To do the same as before, we only have to do the following changes :
- exportOnly: false --> outputMode: 'print'
- exportOnly: true --> outputMode: 'download'
Brings the possibility to get the image blob into the JS code.
You can then use it to do whatever you want (display it in the page, send it to a server, ...)
@alfredott
Copy link
Author

I've just updated some references to the old setting (exportOnly) I hadn't seen previously.

@alfredott alfredott mentioned this pull request Apr 15, 2019
@alfredott
Copy link
Author

Hello, have you been able to read my PR ?

@astridx astridx mentioned this pull request Nov 24, 2019
@micahwilhelm
Copy link

Hi @alfredott since the PR isn't happening would you be able to integrate your changes into the bundle.js of your fork, please?
I'm not sure to do it myself so I can use your cool new output modes!

@alfredott
Copy link
Author

alfredott commented Mar 26, 2021

Oops, I didn't get a notification for your answer @micahwilhelm
Hello !
I don't know if you're still interested in this feature (after 7 months, oof!), but I've just pushed the effects of my changes to bundle.js and bundle.js.map files. Actually, I just ran npm run build and added these changes into the PR.

I'm not quite sure I had the right rollup version to do so, but I guess it will be ok.

I was actually directly using the index.js file (2 years ago), so I hadn't thought of updating bundle.js* files. Thanks for the idea.

I hope it helps someone, bye !

@hct989 hct989 mentioned this pull request Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants