Skip to content

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

@hishobhit82

Description

@hishobhit82

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions