@@ -608,8 +608,8 @@ class PDFDocumentProxy {
608
608
/**
609
609
* @param {{num: number, gen: number} } ref - The page reference. Must have
610
610
* the `num` and `gen` properties.
611
- * @returns {Promise } A promise that is resolved with the page index that is
612
- * associated with the reference.
611
+ * @returns {Promise } A promise that is resolved with the page index (starting
612
+ * from zero) that is associated with the reference.
613
613
*/
614
614
getPageIndex ( ref ) {
615
615
return this . _transport . getPageIndex ( ref ) ;
@@ -909,7 +909,7 @@ class PDFDocumentProxy {
909
909
*/
910
910
class PDFPageProxy {
911
911
constructor ( pageIndex , pageInfo , transport , pdfBug = false ) {
912
- this . pageIndex = pageIndex ;
912
+ this . _pageIndex = pageIndex ;
913
913
this . _pageInfo = pageInfo ;
914
914
this . _transport = transport ;
915
915
this . _stats = pdfBug ? new StatTimer ( ) : null ;
@@ -927,7 +927,7 @@ class PDFPageProxy {
927
927
* @type {number } Page number of the page. First page is 1.
928
928
*/
929
929
get pageNumber ( ) {
930
- return this . pageIndex + 1 ;
930
+ return this . _pageIndex + 1 ;
931
931
}
932
932
933
933
/**
@@ -999,7 +999,7 @@ class PDFPageProxy {
999
999
getAnnotations ( { intent = null } = { } ) {
1000
1000
if ( ! this . annotationsPromise || this . annotationsIntent !== intent ) {
1001
1001
this . annotationsPromise = this . _transport . getAnnotations (
1002
- this . pageIndex ,
1002
+ this . _pageIndex ,
1003
1003
intent
1004
1004
) ;
1005
1005
this . annotationsIntent = intent ;
@@ -1063,7 +1063,7 @@ class PDFPageProxy {
1063
1063
this . _stats . time ( "Page Request" ) ;
1064
1064
}
1065
1065
this . _pumpOperatorList ( {
1066
- pageIndex : this . pageNumber - 1 ,
1066
+ pageIndex : this . _pageIndex ,
1067
1067
intent : renderingIntent ,
1068
1068
renderInteractiveForms : renderInteractiveForms === true ,
1069
1069
} ) ;
@@ -1111,7 +1111,7 @@ class PDFPageProxy {
1111
1111
objs : this . objs ,
1112
1112
commonObjs : this . commonObjs ,
1113
1113
operatorList : intentState . operatorList ,
1114
- pageNumber : this . pageNumber ,
1114
+ pageIndex : this . _pageIndex ,
1115
1115
canvasFactory : canvasFactoryInstance ,
1116
1116
webGLContext,
1117
1117
useRequestAnimationFrame : renderingIntent !== "print" ,
@@ -1180,7 +1180,7 @@ class PDFPageProxy {
1180
1180
this . _stats . time ( "Page Request" ) ;
1181
1181
}
1182
1182
this . _pumpOperatorList ( {
1183
- pageIndex : this . pageIndex ,
1183
+ pageIndex : this . _pageIndex ,
1184
1184
intent : renderingIntent ,
1185
1185
} ) ;
1186
1186
}
@@ -1200,7 +1200,7 @@ class PDFPageProxy {
1200
1200
return this . _transport . messageHandler . sendWithStream (
1201
1201
"GetTextContent" ,
1202
1202
{
1203
- pageIndex : this . pageNumber - 1 ,
1203
+ pageIndex : this . _pageIndex ,
1204
1204
normalizeWhitespace : normalizeWhitespace === true ,
1205
1205
combineTextItems : disableCombineTextItems !== true ,
1206
1206
} ,
@@ -1249,7 +1249,7 @@ class PDFPageProxy {
1249
1249
*/
1250
1250
_destroy ( ) {
1251
1251
this . destroyed = true ;
1252
- this . _transport . pageCache [ this . pageIndex ] = null ;
1252
+ this . _transport . pageCache [ this . _pageIndex ] = null ;
1253
1253
1254
1254
const waitOn = [ ] ;
1255
1255
Object . keys ( this . intentStates ) . forEach ( intent => {
@@ -2734,7 +2734,7 @@ const InternalRenderTask = (function InternalRenderTaskClosure() {
2734
2734
objs,
2735
2735
commonObjs,
2736
2736
operatorList,
2737
- pageNumber ,
2737
+ pageIndex ,
2738
2738
canvasFactory,
2739
2739
webGLContext,
2740
2740
useRequestAnimationFrame = false ,
@@ -2746,7 +2746,7 @@ const InternalRenderTask = (function InternalRenderTaskClosure() {
2746
2746
this . commonObjs = commonObjs ;
2747
2747
this . operatorListIdx = null ;
2748
2748
this . operatorList = operatorList ;
2749
- this . pageNumber = pageNumber ;
2749
+ this . _pageIndex = pageIndex ;
2750
2750
this . canvasFactory = canvasFactory ;
2751
2751
this . webGLContext = webGLContext ;
2752
2752
this . _pdfBug = pdfBug ;
@@ -2786,7 +2786,7 @@ const InternalRenderTask = (function InternalRenderTaskClosure() {
2786
2786
globalThis . StepperManager &&
2787
2787
globalThis . StepperManager . enabled
2788
2788
) {
2789
- this . stepper = globalThis . StepperManager . create ( this . pageNumber - 1 ) ;
2789
+ this . stepper = globalThis . StepperManager . create ( this . _pageIndex ) ;
2790
2790
this . stepper . init ( this . operatorList ) ;
2791
2791
this . stepper . nextBreakPoint = this . stepper . getNextBreakPoint ( ) ;
2792
2792
}
@@ -2831,7 +2831,7 @@ const InternalRenderTask = (function InternalRenderTaskClosure() {
2831
2831
this . callback (
2832
2832
error ||
2833
2833
new RenderingCancelledException (
2834
- `Rendering cancelled, page ${ this . pageNumber } ` ,
2834
+ `Rendering cancelled, page ${ this . _pageIndex + 1 } ` ,
2835
2835
"canvas"
2836
2836
)
2837
2837
) ;
0 commit comments