electron-pdf | 📄 A command line tool to generate PDF from URL, HTML or Markdown files
kandi X-RAY | electron-pdf Summary
kandi X-RAY | electron-pdf Summary
[NPM version][npm-image]][npm-url] [build status][travis-image]][travis-url] [Downloads][downloads-image]][downloads-url]
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sets the instances of the logger to this instance
electron-pdf Key Features
electron-pdf Examples and Code Snippets
var ElectronPDF = require('electron-pdf')
var express = require('express')
var bodyParser = require('body-parser')
var app = express()
app.use(bodyParser.json())
var exporter = new ElectronPDF()
exporter.on('charged', () => {
//Onl
Community Discussions
Trending Discussions on electron-pdf
QUESTION
I'm building an app and all works fine while I'm in developer mode. Everythink works as it should. But when I package my app with electron-builder, app opens but it doesnt start express server and app doesnt work properly.
Here is my package.json code
...ANSWER
Answered 2018-May-21 at 07:34I had something similar happen to me. The challenge was that if you use fork() the application path changes. So I would recommend that you check __dirname
in all of your files especially the ones in your forked process (e. g. app.js). I wouldn't be surprised if some of them don't make sense anymore.
QUESTION
Is it possible to jump to PDF page number using the electron PDF window library?https://github.com/gerhardberger/electron-pdf-window
...ANSWER
Answered 2019-Mar-30 at 12:30For anyone interested in support of PDF viewer in election version 3.1.7 use the mentioned plugin above. To use PDF navigation in URL, to navigate using file:pathofyour.pdf#page=pagenumber just uncomment the content in isPDF() function and replace it with resolve(true)
Electron is a great way to develope cross platform applications but the api is not really mature and is alternated a way to often with every major release in my opinion
QUESTION
I'm in the process of writing an app in Electron. The app requires there to be a pdf rendered in a frame that takes up approximately 50% of the window. Because of the somewhat restricted space, I would like a solution that allows me to render a PDF without any frame, margin or controls bar around it. In macOS native apps, you have access to PDFView, which is a PDF renderer with nothing around it. I'm trying to find the closest thing to this, but for Node.js/Electron.
Before this gets marked as duplicate, I've read through a number of "Rendering PDF's in electron" posts on here. All of them pointed towards a number of libraries, notably "electron-pdf-window". The problem with the library is that all it does is wrap up "PDF.js". I've looked through PDF.js as well as the examples, but it also has the chrome-style frame and controls.
Are there any libraries/implementations of a PDF viewer for Node.js/Electron that provide a near-native (macOS) experience, in a "frameless" window? It needs to have copy/paste support, as well as support for trackpad gestures. Additionally, it should be able to support documents of at least a hundred pages.
Side question - Are you able to modify the default Chrome PDF viewer? (i.e remove the top "controls" bar, as well as trim down all the margins)? This seems like the fastest (most efficient) way to do it, but I'm not sure if it's possible.
...ANSWER
Answered 2018-Dec-30 at 05:48After some research and testing, I've found that you can make a very minimal version of PDF.js. The "pinch-to-zoom" functionality isn't as smooth as on a native app, but you can get fairly close if you use PDF.js' experimental SVG renderer.
Here are some examples of a full PDF viewer with no toolbar: https://github.com/mozilla/pdf.js/tree/master/examples/components
QUESTION
_____ Project Overview _____
I am building an Electron application, using React and Typescript, in which I read a plain HTML string to memory to then adjust some elements in it and finally convert it to a pdf.
_____ Problem Description _____
Because the html is never really rendered (it is just in memory), I am uncertain on how to convert the html (with style) to a pdf without rendering the html first.
_____ What I've tried _____
- I have tried using a combination of
html2canvas
andjspdf
.jspdf
works fine to convert the HTML, without styling, to pdf, but I need the styling. So I tried getting a "screenshot" of my page withhtml2canvas
first but that fails because the page is never rendered. - I tried using
electron-pdf
, but I could not get this to work in my application. It works fine as a command line tool though, so an option would be to invoke the command line tool. I think that that should work, but it feels very hacky (so I'd prefer not going that route).
_____ Code _____
...ANSWER
Answered 2018-Dec-29 at 12:51According to Generating PDF with Electron.js, it seems possible to use the webContents method printToPDF in a new BrowserWindow without actually showing the window:
QUESTION
I'm trying to open pdf in electron app with electron-pdf-window. Its working fine before build but when i build app as installer .exe file for windows and install exe file on windows 8.1 , its not showing pdf window, i am using it through renderer process on click of anchor. Any ideas? here is my code
...ANSWER
Answered 2018-Feb-25 at 22:51If you're using the latest Electron 1.8 or newer, it has built in PDF support in BrowserWindow
's and tags. You just have to ensure plugins are enabled:
BrowserWindow
QUESTION
I am attempting to make a pdf viewer app using electron and electron-pdf-window
the code below works when i want to open from a URL file path, but when i tried to open a pdf from my local files using the file:///
the application download the pdf instead of viewing it on my window.
ANSWER
Answered 2017-Aug-17 at 11:56Base on this readme, https://github.com/electron/electron/blob/master/docs/api/browser-window.md
you can do it something like
win.loadURL(`file://${__dirname}/app/index.html`)
but you have to put this inside app.on('ready', function() {}
to avoid getting the Cannot create BrowserWindow before app is ready
error.
Reason why that error appears Because the app is not yet ready and is still loading
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install electron-pdf
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page