Skip to content

Instantly share code, notes, and snippets.

@sloanesturz
Created December 2, 2015 05:57
Show Gist options
  • Save sloanesturz/a7450f67067db01504a7 to your computer and use it in GitHub Desktop.
Save sloanesturz/a7450f67067db01504a7 to your computer and use it in GitHub Desktop.
pdf react
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Basic Example with JSX</title>
<link rel="stylesheet" href="engauge.css" />
<script src="//www.parsecdn.com/js/parse-1.6.7.min.js"></script>
</head>
<body>
<!-- TODO: need to move this async -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.2/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.min.js"></script>
<div id="container" />
<script type="text/babel">
var Slides = React.createClass({
render: function() {
var url = "slides.pdf#page=" + this.props.pageno;
return (
<object data={url} type="application/pdf" height={500} width={600}>
// <embed src={url} type="application/pdf" />
</object>
);
},
});
ReactDOM.render(
<Slides pageno={3} />,
document.getElementById('container')
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment