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 ' ;
33
44if ( pdfJS != null && pdfWorker != null ) {
55 pdfJS . GlobalWorkerOptions . workerSrc = pdfWorker ;
@@ -130,7 +130,7 @@ export async function print(dotNetHelper, elementId, url) {
130130
131131 for ( const pageNumber of pageRange ) {
132132 const page = await pdfDoc . getPage ( pageNumber ) ;
133-
133+
134134 const viewport = page . getViewport ( { scale : 1.5 } ) ;
135135 const canvas = document . createElement ( "canvas" ) ;
136136 canvas . height = viewport . height ;
@@ -147,7 +147,7 @@ export async function print(dotNetHelper, elementId, url) {
147147 viewport : viewport
148148 } ;
149149 await page . render ( renderContext ) . promise ;
150-
150+
151151 const iframeDoc = iframeEl . contentWindow . document ;
152152 iframeDoc . body . appendChild ( canvas ) ;
153153 }
@@ -156,7 +156,7 @@ export async function print(dotNetHelper, elementId, url) {
156156 iframeEl . contentWindow . print ( ) ;
157157 iframeEl . remove ( ) ;
158158 } ,
159- 1000 ) ;
159+ 1000 ) ;
160160}
161161
162162export function rotate ( dotNetHelper , elementId , rotation ) {
@@ -246,13 +246,13 @@ function renderPage(pdf, num) {
246246
247247 // Wait for rendering to finish
248248 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+ } )
256256 . catch ( ( error ) => {
257257 // TODO: track exception
258258 } ) ;
0 commit comments