I'm quite new to Javascript.
I want to make a very simple native PDF viewer using nw.js and pdf.js. It reads a package file and extract a buffer that contains a valid PDF file. Then I convert the buffer into a stream like this:
var stream = require('stream');
var bufferStream = new stream.PassThrough();
bufferStream.end(pdfbuffer); // pdfbuffer is the PDF file's buffer
But I don't know how to make a valid URL for this PDF file so that I can fill it in pdf.js' default viewer code here:
// viewer.js from PDF.JS
var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf';
Or am I thinking of the wrong direction?