dompdf.js 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * dompdf.js 1.0.3 <https://dompdfjs.lisky.com.cn>
2
+ * dompdf.js 1.0.4 <https://dompdfjs.lisky.com.cn>
3
3
  * Copyright (c) 2025 lfc <https://dompdfjs.lisky.com.cn/>
4
4
  * Released under MIT License
5
5
  */
6
- (function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
6
+ (function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35730/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
7
7
  /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
9
9
 
@@ -9389,8 +9389,8 @@ var CanvasRenderer$1 = /** @class */ (function (_super) {
9389
9389
  // 添加到 PDF
9390
9390
  try {
9391
9391
  bounds = contentBox$1(container);
9392
- x = this.pxToPt(bounds.left);
9393
- y = this.pxToPt(bounds.top);
9392
+ x = this.pxToPt(bounds.left - this.options.x);
9393
+ y = this.pxToPt(bounds.top - this.options.y);
9394
9394
  width = this.pxToPt(bounds.width);
9395
9395
  height = this.pxToPt(bounds.height);
9396
9396
  // 将图片添加到 PDF
@@ -9412,8 +9412,8 @@ var CanvasRenderer$1 = /** @class */ (function (_super) {
9412
9412
  // 添加到 PDF
9413
9413
  try {
9414
9414
  bounds = contentBox$1(container);
9415
- x = this.pxToPt(bounds.left);
9416
- y = this.pxToPt(bounds.top);
9415
+ x = this.pxToPt(bounds.left - this.options.x);
9416
+ y = this.pxToPt(bounds.top - this.options.y);
9417
9417
  width = this.pxToPt(bounds.width);
9418
9418
  height = this.pxToPt(bounds.height);
9419
9419
  dataURL = container.canvas.toDataURL('image/png', 0.95);
@@ -9436,8 +9436,8 @@ var CanvasRenderer$1 = /** @class */ (function (_super) {
9436
9436
  // 添加到 PDF
9437
9437
  try {
9438
9438
  bounds = contentBox$1(container);
9439
- x = this.pxToPt(bounds.left);
9440
- y = this.pxToPt(bounds.top);
9439
+ x = this.pxToPt(bounds.left - this.options.x);
9440
+ y = this.pxToPt(bounds.top - this.options.y);
9441
9441
  width = this.pxToPt(bounds.width);
9442
9442
  height = this.pxToPt(bounds.height);
9443
9443
  canvas = document.createElement('canvas');
@@ -9869,8 +9869,8 @@ var CanvasRenderer$1 = /** @class */ (function (_super) {
9869
9869
  ]), path = _b[0], x = _b[1], y = _b[2], width = _b[3], height = _b[4];
9870
9870
  pattern = this.ctx.createPattern(this.resizeImage(image, width, height), 'repeat');
9871
9871
  this.renderRepeat(path, pattern, x, y);
9872
- xPt = this.pxToPt(x);
9873
- yPt = this.pxToPt(y);
9872
+ xPt = this.pxToPt(x - this.options.x);
9873
+ yPt = this.pxToPt(y - this.options.y);
9874
9874
  widthPt = this.pxToPt(width);
9875
9875
  heightPt = this.pxToPt(height);
9876
9876
  // console.log('绘制背景图片', xPt, yPt, image)