From 5b86bb441a320664e1889245e234e5d44c059d7d Mon Sep 17 00:00:00 2001 From: TWithers Date: Mon, 17 Nov 2025 22:25:56 -0700 Subject: [PATCH] Fixes issue #52 --- resources/electron/electron-plugin/dist/server/api/system.js | 2 +- resources/electron/electron-plugin/src/server/api/system.ts | 2 +- src/System.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/electron/electron-plugin/dist/server/api/system.js b/resources/electron/electron-plugin/dist/server/api/system.js index 73042e27..a1410296 100644 --- a/resources/electron/electron-plugin/dist/server/api/system.js +++ b/resources/electron/electron-plugin/dist/server/api/system.js @@ -107,7 +107,7 @@ router.post('/print-to-pdf', (req, res) => __awaiter(void 0, void 0, void 0, fun }); }); }); - yield printWindow.loadURL(`data:text/html;charset=UTF-8,${html}`); + yield printWindow.loadURL(`data:text/html;base64;charset=UTF-8,${html}`); })); router.get('/theme', (req, res) => { res.json({ diff --git a/resources/electron/electron-plugin/src/server/api/system.ts b/resources/electron/electron-plugin/src/server/api/system.ts index 4c74e0a0..b46cf64c 100644 --- a/resources/electron/electron-plugin/src/server/api/system.ts +++ b/resources/electron/electron-plugin/src/server/api/system.ts @@ -117,7 +117,7 @@ router.post('/print-to-pdf', async (req, res) => { }); }); - await printWindow.loadURL(`data:text/html;charset=UTF-8,${html}`); + await printWindow.loadURL(`data:text/html;base64;charset=UTF-8,${html}`); }); router.get('/theme', (req, res) => { diff --git a/src/System.php b/src/System.php index d9d47c52..7fc8104f 100644 --- a/src/System.php +++ b/src/System.php @@ -78,7 +78,7 @@ public function print(string $html, ?Printer $printer = null, ?array $settings = public function printToPDF(string $html, ?array $settings = []): string { return $this->client->post('system/print-to-pdf', [ - 'html' => $html, + 'html' => base64_encode($html), 'settings' => $settings, ])->json('result'); }