1
- import * as pdfJS from './pdfjs-4.0.379.min.mjs ' ;
2
- import * as pdfWorker from './pdfjs-4.0.379.worker.min.mjs ' ;
1
+ import * as pdfJS from './pdfjs-4.0.379.min.js ' ;
2
+ import * as pdfWorker from './pdfjs-4.0.379.worker.min.js ' ;
3
3
4
4
if ( pdfJS != null && pdfWorker != null ) {
5
5
pdfJS . GlobalWorkerOptions . workerSrc = pdfWorker ;
@@ -130,7 +130,7 @@ export async function print(dotNetHelper, elementId, url) {
130
130
131
131
for ( const pageNumber of pageRange ) {
132
132
const page = await pdfDoc . getPage ( pageNumber ) ;
133
-
133
+
134
134
const viewport = page . getViewport ( { scale : 1.5 } ) ;
135
135
const canvas = document . createElement ( "canvas" ) ;
136
136
canvas . height = viewport . height ;
@@ -147,7 +147,7 @@ export async function print(dotNetHelper, elementId, url) {
147
147
viewport : viewport
148
148
} ;
149
149
await page . render ( renderContext ) . promise ;
150
-
150
+
151
151
const iframeDoc = iframeEl . contentWindow . document ;
152
152
iframeDoc . body . appendChild ( canvas ) ;
153
153
}
@@ -156,7 +156,7 @@ export async function print(dotNetHelper, elementId, url) {
156
156
iframeEl . contentWindow . print ( ) ;
157
157
iframeEl . remove ( ) ;
158
158
} ,
159
- 1000 ) ;
159
+ 1000 ) ;
160
160
}
161
161
162
162
export function rotate ( dotNetHelper , elementId , rotation ) {
@@ -246,13 +246,13 @@ function renderPage(pdf, num) {
246
246
247
247
// Wait for rendering to finish
248
248
renderTask . promise . then ( ( ) => {
249
- pdf . pageRendering = false ;
250
- if ( pdf . pageNumPending !== null ) {
251
- // New page rendering is pending
252
- renderPage ( pdf , pdf . pageNumPending ) ;
253
- pdf . pageNumPending = null ;
254
- }
255
- } )
249
+ pdf . pageRendering = false ;
250
+ if ( pdf . pageNumPending !== null ) {
251
+ // New page rendering is pending
252
+ renderPage ( pdf , pdf . pageNumPending ) ;
253
+ pdf . pageNumPending = null ;
254
+ }
255
+ } )
256
256
. catch ( ( error ) => {
257
257
// TODO: track exception
258
258
} ) ;
0 commit comments