diff --git a/resources/electron/electron-plugin/dist/server/api/system.js b/resources/electron/electron-plugin/dist/server/api/system.js index 73042e2..a141029 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 4c74e0a..b46cf64 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 d9d47c5..7fc8104 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'); }