crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

The Print.js can not print on the Electron when the print type is pdf #643

Open hy999 opened 2 years ago

hy999 commented 2 years ago

Dependencies

Print-js Version: 1.6.0 Vue Version:3.2.39 node Version:16.8.9 npm Version:8.14.0 vite Version:3.0.9 electron Version:20.1.3

Question

It actived on the website,but not on the Electron when print PDF files. When type is image、html , The operation is ok. I put an issue to Electron,they recomand me put an issue to Print-js

As I Know,The electron only integrated render module of Chromium。

Steps

Install the print-js

 npm install print-js@latest --save-dev

Import the print-js

import printJs from 'print-js'

Template

<template>
<div @click='PrintTest'>
</template>

Javascript

<script>
const PrintTest=()=>{
       printJs({
            printable:"base64 str / pdf url",
            type:'pdf',
            base64:true
      })
}
</script>
TingNLP commented 1 year ago

@hy999
Hi, did you solve the problem? Have you changed to another printing tool?

FlorianMold commented 1 year ago

@TingNLP did you encounter the same problem? I have the same problem in my application. The printed pdf is always damaged.

hy999 commented 1 year ago

@TingNLP @FlorianMold I can't solve it, I publish the project as a website. I also take a issue with Electron project, that they say it can not be solved recently or never.