Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to Dynamic open a url pdf link by js code #1

Open
zj2050 opened this issue Apr 14, 2017 · 1 comment
Open

how to Dynamic open a url pdf link by js code #1

zj2050 opened this issue Apr 14, 2017 · 1 comment

Comments

@zj2050
Copy link

zj2050 commented Apr 14, 2017

hi,

would you pls give a doc for how to Dynamic open a url pdf link by javascript code

thanks

@jtsternberg
Copy link
Contributor

jtsternberg commented Jun 19, 2017

The output for the pdf viewer shortcode looks like this:

<style type="text/css">
#zpdf-1 {
	position: relative;
	padding-bottom: 56.25%;
	padding-top: 32px; /* height of the toolbar */
	height: 0;
}
#zpdf-1 iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
</style>
<div id="zpdf-1">
	<iframe class="noscrolling zpdf-iframe" width="100%" height="100%" scrolling="no" frameborder="0" name="pdfv" src="{{{PDF_URL}}}"></iframe>
</div>

So you can use javascript to output the same/similar markup and the pdf viewer will work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants