I would like to create a dynamic item page with a pdf file displayed in it.
As if I put a PDF Viewer widget in the page, only the widget itself apparently can’t be connected to DB. (yet?)
Thanks!
I would like to create a dynamic item page with a pdf file displayed in it.
As if I put a PDF Viewer widget in the page, only the widget itself apparently can’t be connected to DB. (yet?)
Thanks!
I agree, I faced the same problem and I would like to solve it ! thanks
Hi,
Here is a solution that worked for me:
const convertRegex = new RegExp(/wix:document://v1/([^/]+)/(.)$/);*
const item = dataset.getCurrentItem();
const matches = item.doc.match(convertRegex);
const documentUrl = https://docs.wixstatic.com/ugd/${matches[1]}
;
$w(‘#html1’).src = ${documentUrl}
;
Good Luck
Eyal;
HI Eyal, thanks to help me. I’m a beginner on wixcode an I dont understand all of your solution, sorry, what is " onCurrentIndexChanged" ?
Please Eyal can you be more specific? Maybe explaining step by step all the passages…
I understand now the code, onCurrentIndexChanged can be found on the property of the dataset, but I have an error in the code on the line : ** ** const item = dataset.getCurrentItem();
the error is : “dataset is not defined”. I replace the name of the ID dataset but it doesn’t work. What is “dataset.” in the code, please, thanks
@patrice.piette
Same error.
Yes, please answer. Is there a solution now, 2 years later? Trying to do the same thing.
You can use this app to display PDF dynamically from the Wix CMS: PDF: View with 3D Flip Effects | Wix App Market | Wix.com
How to use the widget’s API: Working on Velo with PDF: View with 3D Flip Effects app | Certified Code Help Center