@@ -5711,8 +5711,8 @@ function jsPDF(options) {
5711
5711
this . x = pageX ;
5712
5712
this . y = pageY ;
5713
5713
this . matrix = pageMatrix ;
5714
- this . width = getPageWidth ( currentPage ) ;
5715
- this . height = getPageHeight ( currentPage ) ;
5714
+ this . width = getUnscaledPageWidth ( currentPage ) ;
5715
+ this . height = getUnscaledPageHeight ( currentPage ) ;
5716
5716
this . outputDestination = outputDestination ;
5717
5717
5718
5718
this . id = "" ; // set by endFormObject()
@@ -5727,8 +5727,8 @@ function jsPDF(options) {
5727
5727
pageX = this . x ;
5728
5728
pageY = this . y ;
5729
5729
pageMatrix = this . matrix ;
5730
- setPageWidth ( currentPage , this . width ) ;
5731
- setPageHeight ( currentPage , this . height ) ;
5730
+ setPageWidthWithoutScaling ( currentPage , this . width ) ;
5731
+ setPageHeightWithoutScaling ( currentPage , this . height ) ;
5732
5732
outputDestination = this . outputDestination ;
5733
5733
} ;
5734
5734
@@ -5953,32 +5953,46 @@ function jsPDF(options) {
5953
5953
}
5954
5954
}
5955
5955
5956
- var getPageWidth = ( API . getPageWidth = function ( pageNumber ) {
5957
- pageNumber = pageNumber || currentPage ;
5956
+ function getUnscaledPageWidth ( pageNumber ) {
5957
+ return (
5958
+ pagesContext [ pageNumber ] . mediaBox . topRightX -
5959
+ pagesContext [ pageNumber ] . mediaBox . bottomLeftX
5960
+ ) ;
5961
+ }
5962
+
5963
+ function setPageWidthWithoutScaling ( pageNumber , value ) {
5964
+ pagesContext [ pageNumber ] . mediaBox . topRightX =
5965
+ value + pagesContext [ pageNumber ] . mediaBox . bottomLeftX ;
5966
+ }
5967
+
5968
+ function getUnscaledPageHeight ( pageNumber ) {
5958
5969
return (
5959
- ( pagesContext [ pageNumber ] . mediaBox . topRightX -
5960
- pagesContext [ pageNumber ] . mediaBox . bottomLeftX ) /
5961
- scaleFactor
5970
+ pagesContext [ pageNumber ] . mediaBox . topRightY -
5971
+ pagesContext [ pageNumber ] . mediaBox . bottomLeftY
5962
5972
) ;
5973
+ }
5974
+
5975
+ function setPageHeightWithoutScaling ( pageNumber , value ) {
5976
+ pagesContext [ pageNumber ] . mediaBox . topRightY =
5977
+ value + pagesContext [ pageNumber ] . mediaBox . bottomLeftY ;
5978
+ }
5979
+
5980
+ var getPageWidth = ( API . getPageWidth = function ( pageNumber ) {
5981
+ pageNumber = pageNumber || currentPage ;
5982
+ return getUnscaledPageWidth ( pageNumber ) / scaleFactor ;
5963
5983
} ) ;
5964
5984
5965
5985
var setPageWidth = ( API . setPageWidth = function ( pageNumber , value ) {
5966
- pagesContext [ pageNumber ] . mediaBox . topRightX =
5967
- value * scaleFactor + pagesContext [ pageNumber ] . mediaBox . bottomLeftX ;
5986
+ setPageWidthWithoutScaling ( pageNumber , value * scaleFactor ) ;
5968
5987
} ) ;
5969
5988
5970
5989
var getPageHeight = ( API . getPageHeight = function ( pageNumber ) {
5971
5990
pageNumber = pageNumber || currentPage ;
5972
- return (
5973
- ( pagesContext [ pageNumber ] . mediaBox . topRightY -
5974
- pagesContext [ pageNumber ] . mediaBox . bottomLeftY ) /
5975
- scaleFactor
5976
- ) ;
5991
+ return getUnscaledPageHeight ( pageNumber ) / scaleFactor ;
5977
5992
} ) ;
5978
5993
5979
5994
var setPageHeight = ( API . setPageHeight = function ( pageNumber , value ) {
5980
- pagesContext [ pageNumber ] . mediaBox . topRightY =
5981
- value * scaleFactor + pagesContext [ pageNumber ] . mediaBox . bottomLeftY ;
5995
+ setPageHeightWithoutScaling ( pageNumber , value * scaleFactor ) ;
5982
5996
} ) ;
5983
5997
5984
5998
/**
0 commit comments