feat(PDF):Add PDF viewer (#2730)
Display DICOM encapsulated PDF documents in a PDF viewer. Addressed the remaining PR comments, and am merging this.
This commit is contained in:
1 parent
f3822f98a3
commit
82df3eac03
23 files changed
+376
-71
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
function OHIFCornerstonePdfViewport({
|
||||
displaySet,
|
||||
}) {
|
||||
const [url, setUrl] = useState(null);
|
||||
const { pdfUrl } = displaySet;
|
||||
useEffect(async () => {
|
||||
setUrl(await pdfUrl);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="bg-primary-black w-full h-full">
|
||||
<object data={url} type="application/pdf" className="w-full h-full">
|
||||
<div>No online PDF viewer installed</div>
|
||||
</object>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
OHIFCornerstonePdfViewport.propTypes = {
|
||||
displaySet: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default OHIFCornerstonePdfViewport;
|
||||
Reference in new issue
Block a user