embbed site not working in wix

$w( “#html1” ).src
is not working properly

if $w(" #html1 ").src is your entire code, so sure it’s not supposed to work.
If you have some more code, you should post it.

Thank you for your reply

$w( " #html1 " ).src =" https://f0b620de-e294-48ef-9add-56119ec2d44c.usrfiles.com/ugd/f0b620_3101506d88934f7386c6960da7746826.pdf?"

What doesn’t work? You are embedding a PDF document in an HtmlComponent. There is no code.

thank you yisrael

with this reference

i tried to implement but at this point not working
$w( " #html1 " ).src =" https://f0b620de-e294-48ef-9add-56119ec2d44c.usrfiles.com/ugd/f0b620_3101506d88934f7386c6960da7746826.pdf?"

I tried it myself, with the same pdf file link that you provided, and it works just fine.

You should contact the author of the tutorial that you linked to.

@yisrael-wix thanks

@sathish Thanks for watching my videos!

(Quick forum feedback)
When you use the forum for community help, try sharing your entire code, screenshots of what your elements look like and more context (explanation) of where you are adding your code, why you added it there or what you have tried, etc.

If you only post a partial piece of a code from your page along with a message that says “this does not work”, then people will have a trouble trying to guess everything else that you did not share.

As for the code snippet you shared: it is written correctly, the syntax is correct, therefore it should work by itself. (As Yisrael has already tried.)

As for the turorial you watched, it explains how to add dynamic embeds and the code snippet you shared is not dynamic because it does not contain any variables like the example code shared in the tutorial.

So either your steps are wrong, in which case I recommend you watch the tutorial again to start from the beginning and try again…

Or you are trying to change the code to work on a non-dynamic page, in which case to modify the code you have to practice a bit more to learn how to modify it correctly, or hire someone to teach you , or hire someone to do it for you.

Happy coding!

I tried this line and it worked on my premium site and failed on my free sites.

@jonatandor35 Yikes! So now embedding is a premium thing only? Well that’s gonna suck. I won’t be able to do many tutorials. (There is no way I am upgrading a hundred tutorial sites just to make dynamic examples)

@code-queen You can embed an image or txt file on free sites. But embedding a PDF file fails for some reason.
Maybe it’s a bug.

@jonatandor35 I’ll send this on to QA. It sounds as if it’s a bug or an infrastructure issue - there are subtle differences between Preview and Live, as well as between Free and Premium.

@code-queen No, as far as I know embedding is not only a Premium thing. Seems to me to be a bug and I’ve sent it to QA for evaluation.

I verified that in fact embedded PDFs in an HtmlComponent are Premium only. I’m doing some further checking.

I bothered some people and the issue is that a PDF may contain code/macros which can be unsafe.

A couple of workarounds:

  • PDF Viewer app (Which is not dynamic)

  • Using wix code to dynamically add the PDF link to a button. (downloading instead of embedding)

The other option is to write a script that that accepts the path to a PDF (message passed from the page to the embedded script) and then displays the PDF.