agent-reader 1.1.2 → 1.1.3
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.
- package/bin/agent-reader.js +1 -1
- package/package.json +1 -1
- package/src/core/exporter.js +0 -23
- package/src/mcp/server.js +1 -1
package/bin/agent-reader.js
CHANGED
package/package.json
CHANGED
package/src/core/exporter.js
CHANGED
|
@@ -760,29 +760,6 @@ img { break-inside: avoid; max-width: 100%; }
|
|
|
760
760
|
blockquote { break-inside: avoid; }`,
|
|
761
761
|
});
|
|
762
762
|
|
|
763
|
-
if (landscape) {
|
|
764
|
-
await page.evaluate(() => {
|
|
765
|
-
const MAX_W = 1920;
|
|
766
|
-
const QUALITY = 0.82;
|
|
767
|
-
const imgs = document.querySelectorAll('img');
|
|
768
|
-
const promises = Array.from(imgs).map((img) => new Promise((resolve) => {
|
|
769
|
-
if (!img.naturalWidth) { resolve(); return; }
|
|
770
|
-
const scale = img.naturalWidth > MAX_W ? MAX_W / img.naturalWidth : 1;
|
|
771
|
-
const w = Math.round(img.naturalWidth * scale);
|
|
772
|
-
const h = Math.round(img.naturalHeight * scale);
|
|
773
|
-
const canvas = document.createElement('canvas');
|
|
774
|
-
canvas.width = w;
|
|
775
|
-
canvas.height = h;
|
|
776
|
-
const ctx = canvas.getContext('2d');
|
|
777
|
-
ctx.drawImage(img, 0, 0, w, h);
|
|
778
|
-
img.src = canvas.toDataURL('image/jpeg', QUALITY);
|
|
779
|
-
img.onload = resolve;
|
|
780
|
-
img.onerror = resolve;
|
|
781
|
-
}));
|
|
782
|
-
return Promise.all(promises);
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
|
|
786
763
|
await page.pdf({
|
|
787
764
|
path: pdfPath,
|
|
788
765
|
format: pageSize,
|