electron / pdf-viewer

Fork of Chrome pdf extension to work as webui page in Electron
51 stars 23 forks source link

Implement Blob Support #13

Open joshuaballas opened 6 years ago

joshuaballas commented 6 years ago

Cross reference to this post: Issue

Electron needs to support opening PDFs from a Blob. No current alternative right now. Saving PDFs locally and then opening them is not a feasible "work around".

let fileUrl = URL.createObjectURL(data);
ipcRenderer.send('show-pdf', fileUrl);
ipcMain.on('show-pdf', (event, arg) => {
let win = new BrowserWindow({
  webPreferences: {
    plugins: true
  }
});

win.loadURL(arg);
jbmonroe commented 6 years ago

Saving the blob (or converting it from Base64 to bytes) would work for me, but I can't find where (or if) pdf-viewer fits into the Electron distribution once it's built.