fix: using google docs viewer to render pdf

This commit is contained in:
Jannat Patel
2024-10-08 12:00:51 +05:30
parent 438e9e1c47
commit 2e4cf02737
4 changed files with 8 additions and 5 deletions

View File

@@ -160,7 +160,7 @@ const getRowRoute = (row) => {
}
} else {
return {
name: 'Quiz',
name: 'QuizPage',
params: {
quizID: row.assessment_name,
},

View File

@@ -37,7 +37,7 @@
<iframe
:src="getPDFSource(block)"
width="100%"
height="400"
height="700px"
frameborder="0"
allowfullscreen
></iframe>

View File

@@ -56,9 +56,11 @@ export class Upload {
app.mount(this.wrapper)
return
} else if (file.file_type == 'PDF') {
this.wrapper.innerHTML = `<iframe src="${encodeURI(
this.wrapper.innerHTML = `<iframe src="https://docs.google.com/viewer?url=${
window.location.origin
}${encodeURI(
file.file_url
)}#toolbar=0" width='100%' height='700px' class="mb-4"></iframe>`
)}&embedded=true" width='100%' height='700px' class="mb-4" type="application/pdf"></iframe>`
return
} else {
this.wrapper.innerHTML = `<img class="mb-4" src=${encodeURI(