From 5325cf000bcce85bac730d6c8525b528d23d8be4 Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Wed, 6 Mar 2019 03:18:26 -0500
Subject: changed to use corsProxy and another small change

---
 src/client/views/nodes/PDFNode.tsx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'src/client/views/nodes/PDFNode.tsx')

diff --git a/src/client/views/nodes/PDFNode.tsx b/src/client/views/nodes/PDFNode.tsx
index 755994d6d..8f29e8b4d 100644
--- a/src/client/views/nodes/PDFNode.tsx
+++ b/src/client/views/nodes/PDFNode.tsx
@@ -417,7 +417,7 @@ export class PDFNode extends React.Component<FieldViewProps> {
                 <button ref={this._colorTool} onPointerDown={this.onColorChange}>{"Green"}</button>
                 <button ref={this._colorTool} onPointerDown={this.onColorChange}>{"Black"}</button>
 
-                <Document file={"https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf"}>
+                <Document file={window.origin + "/corsProxy/https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf"}>
                     <Page
                         pageNumber={this.page}
                         onLoadSuccess={
@@ -427,9 +427,8 @@ export class PDFNode extends React.Component<FieldViewProps> {
                                         if (element.nodeName == "DIV") {
                                             element.childNodes[0].childNodes.forEach((e) => {
 
-                                                if (e.nodeName == "CANVAS") {
+                                                if (e instanceof HTMLCanvasElement) {
                                                     this._pdfCanvas = e;
-                                                    //@ts-ignore
                                                     this._pdfContext = e.getContext("2d")
 
                                                 }
-- 
cgit v1.2.3-70-g09d2

