-
Notifications
You must be signed in to change notification settings - Fork 88
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
Download Image #50
Comments
@cianiandreadev Hi, you can try the same issue: #14 |
Thank you for your support and quick answer!! I will try as you suggested 🙂 |
If anyone else wants to implement a QR Code download function I have it working smoothly with following solution:
|
This is the code I used to download the QR.
|
hello, I found one issue in this . if we download qrcode using this logic then that downloaded qrcode's background is black so that it is overlapping and i'm not able to scan the code .. so can anyone please help me with how can i change the bgcolor of generated canvas ?? Thanks in Advance |
@vishakha99-gif Hey! Just try giving some margin to qrcode. <template>
<div
ref="qrcodeContainer">
<qrcode-vue
ref="qrcode"
:value="value"
:level="level"
:margin="4"
:size="300" />
</div>
<button @click="downloadQrCode">Download</button>
</template>
<script setup lang="ts">
import { ref } from "vue";
import QrcodeVue, { Level } from "qrcode.vue";
defineProps<{
value: string;
}>();
const level = ref<Level>("M");
const qrcodeContainer = ref();
function downloadQrCode() {
const canvas = qrcodeContainer.value.querySelector("canvas");
const link = document.createElement("a");
link.download = "qr-code.png";
link.href = canvas.toDataURL("image/png");
link.click();
}
</script> |
thank you very much. 🥰 |
Hi 👋,
I am using the version 1.7 for Vue 2.
I would like to provide the page with a button that allows to download the generated QR.
Ideally (since the page contains multiple QR code) would be awesome if the same button allows to download more then one at the same time.
How would that be possible? (If it is possible?)
Thanks in advance for your help and thanks for your great work!!
The text was updated successfully, but these errors were encountered: