mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 22:47:25 +01:00
no need for pdf-js
This commit is contained in:
@@ -4,7 +4,7 @@ export default function(props) {
|
||||
return (
|
||||
<label>
|
||||
{props.text}:
|
||||
<input onChange={props.onChange.bind(null, props.name)} type="text" />
|
||||
<input onchange={props.onchange.bind(null, props.name)} type="text" />
|
||||
</label>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,28 +1,11 @@
|
||||
import { Component, h } from 'preact';
|
||||
import PDF from 'react-pdf';
|
||||
|
||||
class Preview extends Component {
|
||||
render(props) {
|
||||
if (!props.pdfUrl) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return (
|
||||
<PDF
|
||||
file={props.pdfUrl}
|
||||
onDocumentComplete={this._onDocumentComplete.bind(this)}
|
||||
onPageComplete={this._onPageComplete.bind(this)}
|
||||
/>
|
||||
);
|
||||
export default props => {
|
||||
if (!props.pdfUrl) {
|
||||
return '';
|
||||
}
|
||||
|
||||
_onDocumentComplete(pages) {
|
||||
this.setState({pages: pages});
|
||||
}
|
||||
|
||||
_onPageComplete(page) {
|
||||
this.setState({page});
|
||||
}
|
||||
}
|
||||
|
||||
export default Preview;
|
||||
return (
|
||||
<embed src={props.pdfUrl} width="100%" height="100%"/>
|
||||
);
|
||||
};
|
||||
|
||||
10
webapp/views/components/TextAreaInput.js
Normal file
10
webapp/views/components/TextAreaInput.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { h } from 'preact';
|
||||
|
||||
export default function(props) {
|
||||
return (
|
||||
<label>
|
||||
{props.text}:
|
||||
<textarea onchange={props.onchange.bind(null, props.name)} />
|
||||
</label>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user