pdf-master-landing 0.0.8 → 0.1.0

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 +1 @@
1
- 5b8083240414b940c62baaaf71a3e977
1
+ 22bcea899d920847e2e312ee887963a9
@@ -2206,6 +2206,7 @@ flutter_plugin_android_lifecycle
2206
2206
  image_picker_for_web
2207
2207
  image_picker_macos
2208
2208
  image_picker_platform_interface
2209
+ in_app_purchase
2209
2210
  in_app_purchase_android
2210
2211
  in_app_purchase_storekit
2211
2212
  path_provider_android
@@ -3264,6 +3265,38 @@ desktop_drop
3264
3265
  See the License for the specific language governing permissions and
3265
3266
  limitations under the License.
3266
3267
 
3268
+ --------------------------------------------------------------------------------
3269
+ device_info_plus
3270
+ device_info_plus_platform_interface
3271
+
3272
+ Copyright 2017 The Chromium Authors. All rights reserved.
3273
+
3274
+ Redistribution and use in source and binary forms, with or without
3275
+ modification, are permitted provided that the following conditions are
3276
+ met:
3277
+
3278
+ * Redistributions of source code must retain the above copyright
3279
+ notice, this list of conditions and the following disclaimer.
3280
+ * Redistributions in binary form must reproduce the above
3281
+ copyright notice, this list of conditions and the following disclaimer
3282
+ in the documentation and/or other materials provided with the
3283
+ distribution.
3284
+ * Neither the name of Google Inc. nor the names of its
3285
+ contributors may be used to endorse or promote products derived from
3286
+ this software without specific prior written permission.
3287
+
3288
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3289
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3290
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3291
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3292
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3293
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3294
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3295
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3296
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3297
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3298
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3299
+
3267
3300
  --------------------------------------------------------------------------------
3268
3301
  devtools
3269
3302
 
@@ -6483,7 +6516,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6483
6516
  flutter_lints
6484
6517
  image_picker_linux
6485
6518
  image_picker_windows
6486
- in_app_purchase
6487
6519
  in_app_purchase_platform_interface
6488
6520
  path_provider
6489
6521
  path_provider_linux
@@ -22158,32 +22190,6 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22158
22190
  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22159
22191
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22160
22192
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22161
- --------------------------------------------------------------------------------
22162
- in_app_review
22163
- in_app_review_platform_interface
22164
-
22165
- MIT License
22166
-
22167
- Copyright (c) 2020 Britannio Jarrett
22168
-
22169
- Permission is hereby granted, free of charge, to any person obtaining a copy
22170
- of this software and associated documentation files (the "Software"), to deal
22171
- in the Software without restriction, including without limitation the rights
22172
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22173
- copies of the Software, and to permit persons to whom the Software is
22174
- furnished to do so, subject to the following conditions:
22175
-
22176
- The above copyright notice and this permission notice shall be included in all
22177
- copies or substantial portions of the Software.
22178
-
22179
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22180
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22181
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22182
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22183
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22184
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22185
- SOFTWARE.
22186
-
22187
22193
  --------------------------------------------------------------------------------
22188
22194
  include
22189
22195
 
@@ -22374,6 +22380,32 @@ io
22374
22380
  Copyright 2021, the Dart project authors. Please see the AUTHORS file
22375
22381
  for details. All rights reserved. Use of this source code is governed by a
22376
22382
  BSD-style license that can be found in the LICENSE file.
22383
+ --------------------------------------------------------------------------------
22384
+ irondash_engine_context
22385
+ irondash_message_channel
22386
+ pixel_snap
22387
+
22388
+ Copyright (c) 2022 Matej Knopp and the contributors
22389
+
22390
+ MIT LICENSE
22391
+
22392
+ Permission is hereby granted, free of charge, to any person obtaining a copy
22393
+ of this software and associated documentation files (the "Software"), to deal
22394
+ in the Software without restriction, including without limitation the rights
22395
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
22396
+ of the Software, and to permit persons to whom the Software is furnished to do
22397
+ so, subject to the following conditions:
22398
+
22399
+ The above copyright notice and this permission notice shall be included in all
22400
+ copies or substantial portions of the Software.
22401
+
22402
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22403
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22404
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
22405
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22406
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
22407
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22408
+
22377
22409
  --------------------------------------------------------------------------------
22378
22410
  jni
22379
22411
  leak_tracker
@@ -25869,34 +25901,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25869
25901
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25870
25902
 
25871
25903
  --------------------------------------------------------------------------------
25872
- open_filex
25904
+ open_file
25905
+ open_file_android
25906
+ open_file_ios
25907
+ open_file_linux
25908
+ open_file_mac
25909
+ open_file_platform_interface
25910
+ open_file_web
25911
+ open_file_windows
25873
25912
 
25874
- Copyright 2018 crazecoder. All rights reserved.
25875
-
25876
- Redistribution and use in source and binary forms, with or without
25877
- modification, are permitted provided that the following conditions are
25878
- met:
25879
-
25880
- * Redistributions of source code must retain the above copyright
25881
- notice, this list of conditions and the following disclaimer.
25882
- * Redistributions in binary form must reproduce the above
25883
- copyright notice, this list of conditions and the following
25884
- disclaimer in the documentation and/or other materials provided
25885
- with the distribution.
25886
- * Neither the name of Google Inc. nor the names of its
25887
- contributors may be used to endorse or promote products derived
25888
- from this software without specific prior written permission.
25889
-
25890
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25891
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25892
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25893
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25894
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25895
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25896
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25897
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25898
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25899
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25913
+ Copyright 2018 crazecoder. All rights reserved.
25914
+
25915
+ Redistribution and use in source and binary forms, with or without
25916
+ modification, are permitted provided that the following conditions are
25917
+ met:
25918
+
25919
+ * Redistributions of source code must retain the above copyright
25920
+ notice, this list of conditions and the following disclaimer.
25921
+ * Redistributions in binary form must reproduce the above
25922
+ copyright notice, this list of conditions and the following
25923
+ disclaimer in the documentation and/or other materials provided
25924
+ with the distribution.
25925
+ * Neither the name of Google Inc. nor the names of its
25926
+ contributors may be used to endorse or promote products derived
25927
+ from this software without specific prior written permission.
25928
+
25929
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25930
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25931
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25932
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25933
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25934
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25935
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25936
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25937
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25938
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25900
25939
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25901
25940
  --------------------------------------------------------------------------------
25902
25941
  pausable_timer
@@ -26441,6 +26480,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26441
26480
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26442
26481
  THE SOFTWARE.
26443
26482
 
26483
+ --------------------------------------------------------------------------------
26484
+ photo_view
26485
+
26486
+ Copyright 2024 Renan C. Araújo
26487
+
26488
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
26489
+
26490
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
26491
+
26492
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26493
+
26444
26494
  --------------------------------------------------------------------------------
26445
26495
  posix
26446
26496
 
@@ -29292,6 +29342,31 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29292
29342
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29293
29343
  SOFTWARE.
29294
29344
 
29345
+ --------------------------------------------------------------------------------
29346
+ super_clipboard
29347
+ super_native_extensions
29348
+
29349
+ Copyright (c) 2022 Superlist, Matej Knopp and the contributors
29350
+
29351
+ MIT LICENSE
29352
+
29353
+ Permission is hereby granted, free of charge, to any person obtaining a copy
29354
+ of this software and associated documentation files (the "Software"), to deal
29355
+ in the Software without restriction, including without limitation the rights
29356
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
29357
+ of the Software, and to permit persons to whom the Software is furnished to do
29358
+ so, subject to the following conditions:
29359
+
29360
+ The above copyright notice and this permission notice shall be included in all
29361
+ copies or substantial portions of the Software.
29362
+
29363
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29364
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
29365
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
29366
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
29367
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
29368
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29369
+
29295
29370
  --------------------------------------------------------------------------------
29296
29371
  swiftshader
29297
29372
 
@@ -32659,6 +32734,37 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32659
32734
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32660
32735
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32661
32736
 
32737
+ --------------------------------------------------------------------------------
32738
+ win32_registry
32739
+
32740
+ BSD 3-Clause License
32741
+
32742
+ Copyright (c) 2023, Halil Durmus
32743
+
32744
+ Redistribution and use in source and binary forms, with or without
32745
+ modification, are permitted provided that the following conditions are met:
32746
+
32747
+ 1. Redistributions of source code must retain the above copyright notice, this
32748
+ list of conditions and the following disclaimer.
32749
+
32750
+ 2. Redistributions in binary form must reproduce the above copyright notice,
32751
+ this list of conditions and the following disclaimer in the documentation
32752
+ and/or other materials provided with the distribution.
32753
+
32754
+ 3. Neither the name of the copyright holder nor the names of its
32755
+ contributors may be used to endorse or promote products derived from
32756
+ this software without specific prior written permission.
32757
+
32758
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32759
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32760
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32761
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
32762
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32763
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32764
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32765
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32766
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32767
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32662
32768
  --------------------------------------------------------------------------------
32663
32769
  window_manager
32664
32770
 
@@ -1869,36 +1869,11 @@ async function loadImages(params) {
1869
1869
  await _ensurePageAvailable(params.docHandle, params.pageIndex);
1870
1870
  const { pageIndex, docHandle } = params;
1871
1871
  const pageHandle = Pdfium.wasmExports.FPDF_LoadPage(docHandle, pageIndex);
1872
- // bounds: float[4] (left, bottom, right, top); metadata: 7 × 4B
1873
1872
  const boundsBuf = Pdfium.wasmExports.malloc(4 * 4);
1874
1873
  const metaBuf = Pdfium.wasmExports.malloc(7 * 4);
1875
1874
  const images = [];
1876
1875
  try {
1877
- const count = Pdfium.wasmExports.FPDFPage_CountObjects(pageHandle);
1878
- for (let i = 0; i < count; i++) {
1879
- const obj = Pdfium.wasmExports.FPDFPage_GetObject(pageHandle, i);
1880
- // FPDF_PAGEOBJ_IMAGE = 3
1881
- if (Pdfium.wasmExports.FPDFPageObj_GetType(obj) !== 3) continue;
1882
- const okBounds = Pdfium.wasmExports.FPDFPageObj_GetBounds(
1883
- obj,
1884
- boundsBuf,
1885
- boundsBuf + 4,
1886
- boundsBuf + 8,
1887
- boundsBuf + 12,
1888
- );
1889
- if (!okBounds) continue;
1890
- const okMeta = Pdfium.wasmExports.FPDFImageObj_GetImageMetadata(obj, pageHandle, metaBuf);
1891
- if (!okMeta) continue;
1892
- const [left, bottom, right, top] = new Float32Array(Pdfium.memory.buffer, boundsBuf, 4);
1893
- // metadata 前两个 u32 是 width / height(像素)。
1894
- const meta = new Uint32Array(Pdfium.memory.buffer, metaBuf, 2);
1895
- images.push({
1896
- // 与 _loadAnnotLinks 同坐标系:top > bottom。
1897
- rect: [left, top > bottom ? top : bottom, right, top > bottom ? bottom : top],
1898
- pixelWidth: meta[0],
1899
- pixelHeight: meta[1],
1900
- });
1901
- }
1876
+ _collectPageImages(pageHandle, pageHandle, images, [], _identityMatrix(), boundsBuf, metaBuf);
1902
1877
  } finally {
1903
1878
  Pdfium.wasmExports.free(boundsBuf);
1904
1879
  Pdfium.wasmExports.free(metaBuf);
@@ -1907,6 +1882,32 @@ async function loadImages(params) {
1907
1882
  return { images: images };
1908
1883
  }
1909
1884
 
1885
+ async function loadImageObject(params) {
1886
+ await _ensurePageAvailable(params.docHandle, params.pageIndex);
1887
+ const { pageIndex, docHandle, objectPath } = params;
1888
+ const pageHandle = Pdfium.wasmExports.FPDF_LoadPage(docHandle, pageIndex);
1889
+ try {
1890
+ const obj = _resolvePageObjectPath(pageHandle, objectPath || []);
1891
+ if (!obj || Pdfium.wasmExports.FPDFPageObj_GetType(obj) !== FPDF_PAGEOBJ_IMAGE) {
1892
+ return { imageData: new ArrayBuffer(0), width: 0, height: 0 };
1893
+ }
1894
+ const pixels = _readImagePixels(docHandle, pageHandle, obj);
1895
+ if (!pixels || !pixels.bytes || pixels.bytes.length === 0) {
1896
+ return { imageData: new ArrayBuffer(0), width: 0, height: 0 };
1897
+ }
1898
+ return {
1899
+ result: {
1900
+ imageData: pixels.bytes.buffer,
1901
+ width: pixels.width,
1902
+ height: pixels.height,
1903
+ },
1904
+ transfer: [pixels.bytes.buffer],
1905
+ };
1906
+ } finally {
1907
+ Pdfium.wasmExports.FPDF_ClosePage(pageHandle);
1908
+ }
1909
+ }
1910
+
1910
1911
  const FPDF_ANNOT_SQUARE = 5;
1911
1912
  const FPDF_ANNOT_LINK = 2;
1912
1913
  const FPDF_ANNOT_FREETEXT = 3;
@@ -1925,6 +1926,125 @@ const FPDF_PAGEOBJ_IMAGE = 3;
1925
1926
  const FPDF_PAGEOBJ_FORM = 5;
1926
1927
  const FPDF_FILLMODE_NONE = 0;
1927
1928
 
1929
+ function _collectPageImages(pageHandle, container, images, parentPath, parentMatrix, boundsBuf, metaBuf) {
1930
+ const count = parentPath.length === 0
1931
+ ? Pdfium.wasmExports.FPDFPage_CountObjects(container)
1932
+ : _formObjectCount(container);
1933
+ for (let i = 0; i < count; i++) {
1934
+ const obj = parentPath.length === 0
1935
+ ? Pdfium.wasmExports.FPDFPage_GetObject(container, i)
1936
+ : Pdfium.wasmExports.FPDFFormObj_GetObject(container, i);
1937
+ if (!obj) continue;
1938
+ const type = Pdfium.wasmExports.FPDFPageObj_GetType(obj);
1939
+ const objectPath = parentPath.concat([i]);
1940
+ if (type === FPDF_PAGEOBJ_IMAGE) {
1941
+ const image = _readImageObject(pageHandle, obj, objectPath, parentMatrix, boundsBuf, metaBuf);
1942
+ if (image) images.push(image);
1943
+ continue;
1944
+ }
1945
+ if (type !== FPDF_PAGEOBJ_FORM) continue;
1946
+ const childCount = _formObjectCount(obj);
1947
+ if (childCount <= 0) continue;
1948
+ const formMatrix = _readImageMatrix(obj);
1949
+ if (!formMatrix) continue;
1950
+ _collectPageImages(
1951
+ pageHandle,
1952
+ obj,
1953
+ images,
1954
+ objectPath,
1955
+ _multiplyMatrix(parentMatrix, formMatrix),
1956
+ boundsBuf,
1957
+ metaBuf,
1958
+ );
1959
+ }
1960
+ }
1961
+
1962
+ function _readImageObject(pageHandle, obj, objectPath, parentMatrix, boundsBuf, metaBuf) {
1963
+ const okBounds = Pdfium.wasmExports.FPDFPageObj_GetBounds(
1964
+ obj,
1965
+ boundsBuf,
1966
+ boundsBuf + 4,
1967
+ boundsBuf + 8,
1968
+ boundsBuf + 12,
1969
+ );
1970
+ if (!okBounds) return null;
1971
+ const okMeta = Pdfium.wasmExports.FPDFImageObj_GetImageMetadata(obj, pageHandle, metaBuf);
1972
+ if (!okMeta) return null;
1973
+ const [left, bottom, right, top] = new Float32Array(Pdfium.memory.buffer, boundsBuf, 4);
1974
+ const rect = _mapBounds(parentMatrix, left, Math.max(top, bottom), right, Math.min(top, bottom));
1975
+ if (rect[2] <= rect[0] || rect[1] <= rect[3]) return null;
1976
+ const meta = new Uint32Array(Pdfium.memory.buffer, metaBuf, 2);
1977
+ return {
1978
+ objectPath: objectPath,
1979
+ rect: rect,
1980
+ pixelWidth: meta[0],
1981
+ pixelHeight: meta[1],
1982
+ };
1983
+ }
1984
+
1985
+ function _resolvePageObjectPath(pageHandle, objectPath) {
1986
+ if (!objectPath || objectPath.length === 0) return 0;
1987
+ const firstIndex = objectPath[0];
1988
+ if (firstIndex < 0 || firstIndex >= Pdfium.wasmExports.FPDFPage_CountObjects(pageHandle)) return 0;
1989
+ let obj = Pdfium.wasmExports.FPDFPage_GetObject(pageHandle, firstIndex);
1990
+ for (let i = 1; i < objectPath.length; i++) {
1991
+ if (!obj || Pdfium.wasmExports.FPDFPageObj_GetType(obj) !== FPDF_PAGEOBJ_FORM) return 0;
1992
+ const index = objectPath[i];
1993
+ const count = _formObjectCount(obj);
1994
+ if (index < 0 || index >= count) return 0;
1995
+ obj = Pdfium.wasmExports.FPDFFormObj_GetObject(obj, index);
1996
+ }
1997
+ return obj;
1998
+ }
1999
+
2000
+ function _formObjectCount(formObj) {
2001
+ if (typeof Pdfium.wasmExports.FPDFFormObj_CountObjects !== 'function') return 0;
2002
+ if (typeof Pdfium.wasmExports.FPDFFormObj_GetObject !== 'function') return 0;
2003
+ return Pdfium.wasmExports.FPDFFormObj_CountObjects(formObj);
2004
+ }
2005
+
2006
+ function _identityMatrix() {
2007
+ return { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
2008
+ }
2009
+
2010
+ function _multiplyMatrix(parent, child) {
2011
+ return {
2012
+ a: parent.a * child.a + parent.c * child.b,
2013
+ b: parent.b * child.a + parent.d * child.b,
2014
+ c: parent.a * child.c + parent.c * child.d,
2015
+ d: parent.b * child.c + parent.d * child.d,
2016
+ e: parent.a * child.e + parent.c * child.f + parent.e,
2017
+ f: parent.b * child.e + parent.d * child.f + parent.f,
2018
+ };
2019
+ }
2020
+
2021
+ function _mapBounds(matrix, left, top, right, bottom) {
2022
+ const points = [
2023
+ _mapPoint(matrix, left, top),
2024
+ _mapPoint(matrix, right, top),
2025
+ _mapPoint(matrix, right, bottom),
2026
+ _mapPoint(matrix, left, bottom),
2027
+ ];
2028
+ let minX = points[0].x;
2029
+ let maxX = points[0].x;
2030
+ let minY = points[0].y;
2031
+ let maxY = points[0].y;
2032
+ for (let i = 1; i < points.length; i++) {
2033
+ minX = Math.min(minX, points[i].x);
2034
+ maxX = Math.max(maxX, points[i].x);
2035
+ minY = Math.min(minY, points[i].y);
2036
+ maxY = Math.max(maxY, points[i].y);
2037
+ }
2038
+ return [minX, maxY, maxX, minY];
2039
+ }
2040
+
2041
+ function _mapPoint(matrix, x, y) {
2042
+ return {
2043
+ x: matrix.a * x + matrix.c * y + matrix.e,
2044
+ y: matrix.b * x + matrix.d * y + matrix.f,
2045
+ };
2046
+ }
2047
+
1928
2048
  /**
1929
2049
  * Enumerate text-markup annotations.
1930
2050
  * @param {{docHandle: number, pageIndex: number}} params
@@ -4884,6 +5004,7 @@ const functions = {
4884
5004
  loadText,
4885
5005
  loadLinks,
4886
5006
  loadImages,
5007
+ loadImageObject,
4887
5008
  loadMarkups,
4888
5009
  addMarkup,
4889
5010
  ensureMarkupStableId,
@@ -33,10 +33,10 @@ addEventListener("message", eventListener);
33
33
  if (!window._flutter) {
34
34
  window._flutter = {};
35
35
  }
36
- _flutter.buildConfig = {"engineRevision":"c416acfeb8126e097f758c664aaa3da929e27da0","builds":[{"compileTarget":"dart2wasm","renderer":"skwasm","mainWasmPath":"main.dart.wasm","jsSupportRuntimePath":"main.dart.mjs"},{"compileTarget":"dart2js","renderer":"canvaskit","mainJsPath":"main.dart.js"}]};
36
+ _flutter.buildConfig = {"engineRevision":"77e2e94772b6eb43759e34ed1ad7da4674e19cab","builds":[{"compileTarget":"dart2wasm","renderer":"skwasm","mainWasmPath":"main.dart.wasm","jsSupportRuntimePath":"main.dart.mjs"},{"compileTarget":"dart2js","renderer":"canvaskit","mainJsPath":"main.dart.js"}]};
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "2157789543" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
40
+ serviceWorkerVersion: "533477910" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
41
41
  }
42
42
  });