File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 9
9
{% block extra_head %}
10
10
< link rel ="
stylesheet "
href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/pretty-checkbox.min.css "
11
11
integrity ="sha384-ICB8i/maQ/5+tGLDUEcswB7Ch+OO9Oj8Z4Ov/Gs0gxqfTgLLkD3F43MhcEJ2x6/D " crossorigin ="anonymous ">
12
+
13
+
14
+ <!-- prevent weired character stuff escaping the pdf box -->
15
+ < style >
16
+ .textLayer > span {
17
+ color : transparent;
18
+ position : absolute;
19
+ white-space : pre;
20
+ cursor : text;
21
+ transform-origin : 0% 0% ;
22
+ }
23
+ </ style >
24
+
12
25
{% endblock %}
13
26
14
27
{% block content %}
@@ -196,15 +209,9 @@ <h5 class="card-title">{% trans 'External recipe' %}</h5>
196
209
197
210
var container = document . getElementById ( "viewerContainer" ) ;
198
211
199
- // (Optionally) enable hyperlinks within PDF files.
200
- var pdfLinkService = new pdfjsViewer . PDFLinkService ( ) ;
201
-
202
-
203
212
var pdfViewer = new pdfjsViewer . PDFViewer ( {
204
213
container : container ,
205
- linkService : pdfLinkService ,
206
214
} ) ;
207
- pdfLinkService . setViewer ( pdfViewer ) ;
208
215
209
216
document . addEventListener ( "pagesinit" , function ( ) {
210
217
// We can use pdfViewer now, e.g. let's change default scale.
@@ -215,12 +222,12 @@ <h5 class="card-title">{% trans 'External recipe' %}</h5>
215
222
var loadingTask = pdfjsLib . getDocument ( {
216
223
data : base64Pdf
217
224
} ) ;
225
+
218
226
loadingTask . promise . then ( function ( pdfDocument ) {
219
227
// Document loaded, specifying document for the viewer and
220
228
// the (optional) linkService.
221
229
pdfViewer . setDocument ( pdfDocument ) ;
222
230
223
- pdfLinkService . setDocument ( pdfDocument , null ) ;
224
231
} ) ;
225
232
}
226
233
You can’t perform that action at this time.
0 commit comments