0

I want to show a pdf using google viewer like this:

https://drive.google.com/viewerng/viewer?embedded=true&url=http://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf

But my page should be opened with parameters like this:

https://mywebsite.com/pdfgenerator.xhtml?parameter1=true&parameter2=false

(On this page a pdf is generated, and that is not a valid website)

That means that I should pass parameters within the url parameter of the first page, but then they get interpreted as the parameters for the first page.

https://drive.google.com/viewerng/viewer?embedded=true&url=https://mywebsite.com/pdfgenerator.xhtml?parameter1=true&parameter2=false

How do I solve this problem? How do I pass a parameter within a parameter? I can't find any information about it.

Thank you for your help.

1 Answer 1

1

It's solved: If you encode it using encodeURIComponent and then pass it as the parameter it works. If you need to do it quickly you can use this TryIt from W3Schools. Adjust the address, click run and click the button, then copy the link.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.