Is there any way to show the div into pdf only ?
Is there any way to show the div into the pdf only not into the actual document Please suggest
You could use a component for that with props lets say is-for-pdf for example.
If is-for-pdf is true show that div.
So the template would look like this:
<template>
<div>
<your-pdf-component />
<vue-html2pdf>
<your-pdf-component :is-for-pdf="true" slot="pdf-content">
</vue-html2pdf>
</div>
</template
Also please create your issues in the link below next time, This is the demo repository of the package, thanks. https://github.com/kempsteven/vue-html2pdf/issues
@kempsteven Thanks for the revert
I have tried for the same, :is-for-pdf="true" but it is also showing into the document
I wanted the component to hide from the actual document and only show into the pdf
Ummm, inside <your-pdf-component>, you have to utilize that is-for-pdf props.
So inside your component it should look like this:
<template>
<div>
<div class="only-show-in-pdf" v-if="isForPpdf">
Show this on pdf only
</div>
<div>Show everytime</div>
</div>
</template
exports default {
props: {
isForPpdf: {
type: Boolean,
default: false
}
}
}
If you are still having problems with it I suggest you read into the vue.js documentation since this is a vue.js question, but feel free to ask more questions to me.