Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount: function componentDidMount() {
var url = this.props.file.url || '';
var container = document.getElementById('container');
var pdfLinkService = new _pdf_viewer.PDFJS.PDFLinkService();
var pdfViewer = new _pdf_viewer.PDFJS.PDFViewer({
container: container,
linkService: pdfLinkService
});
pdfLinkService.setViewer(pdfViewer);
container.addEventListener('pagesinit', function () {
// We can use pdfViewer now, e.g. let's change default scale.
pdfViewer.currentScaleValue = 'page-width';
});
// Loading document.
_pdf_viewer.PDFJS.getDocument(url).then(function (pdfDocument) {
// Document loaded, specifying document for the viewer and
// the (optional) linkService.
exports.RenderFilePDF = undefined;
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _radium = require('radium');
var _radium2 = _interopRequireDefault(_radium);
var _pdf_viewer = require('pdfjs-dist/web/pdf_viewer');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_pdf_viewer.PDFJS.workerSrc = './pdf.worker.min.js';
_pdf_viewer.PDFJS.disableRange = true;
var styles = void 0;
var RenderFilePDF = exports.RenderFilePDF = _react2.default.createClass({
displayName: 'RenderFilePDF',
propTypes: {
file: _react.PropTypes.object
},
getInitialState: function getInitialState() {
return {
pdf: undefined
};
},
componentDidMount: function componentDidMount() {
var url = this.props.file.url || '';
});
exports.RenderFilePDF = undefined;
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _radium = require('radium');
var _radium2 = _interopRequireDefault(_radium);
var _pdf_viewer = require('pdfjs-dist/web/pdf_viewer');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_pdf_viewer.PDFJS.workerSrc = './pdf.worker.min.js';
_pdf_viewer.PDFJS.disableRange = true;
var styles = void 0;
var RenderFilePDF = exports.RenderFilePDF = _react2.default.createClass({
displayName: 'RenderFilePDF',
propTypes: {
file: _react.PropTypes.object
},
getInitialState: function getInitialState() {
return {
pdf: undefined
};
},
componentDidMount: function componentDidMount() {