Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read MemoryStream of a PDF and open it #15

Open
hishobhit82 opened this issue Oct 14, 2016 · 0 comments
Open

How to read MemoryStream of a PDF and open it #15

hishobhit82 opened this issue Oct 14, 2016 · 0 comments

Comments

@hishobhit82
Copy link

Hi,

I am a newbie in working with electron. I have built an app which communicates with a .Net REST service to fetch some data and display it on the screen. One of the data includes a PDF file which resides on a remote server which is read by the REST service and sent to the app as a MemoryStream.

How can i read the PDF from this memory stream and open the same in the Adobe Acrobat Reader which is installed on my windows 7 machine ? Please find below a sample code -

var optionsGetPDF = {
        host: 'localhost',
        port: 8080,
        path: '/GetPDFdoc?docid=' + docid,
        method: 'GET'
};

http.request(optionsGetPDF, function (res) {
    res.pipe(memStream);
    res.on('end', function () {
         alert(memStream.toString().length)
    })
}).end();

Any help is very much appreciated !!

Regards
Shobhit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant