Skip to content

Instantly share code, notes, and snippets.

View mukulmishra18's full-sized avatar

Mukul Mishra mukulmishra18

View GitHub Profile
@mukulmishra18
mukulmishra18 / getTextContent.js
Created April 17, 2017 15:33
getTextContent function of PDF.js with Streams API.
getTextContent: function PDFPageProxy_getTextContent(params) {
var readableStream = this.transport.messageHandler.sendWithStream('GetTextContent', {
pageIndex: this.pageNumber - 1,
normalizeWhitespace: (params && params.normalizeWhitespace === true ?
true : /* Default */ false),
combineTextItems: (params && params.disableCombineTextItems === true ?
false : /* Default */ true),
});
return new Promise(function (resolve, reject) {
readAllChunks(readableStream);
@mukulmishra18
mukulmishra18 / streams-lib.bundle.js
Created April 6, 2017 19:36
combined binary of streams-lib project.
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["streams-lib"] = factory();
else
root["streams-lib"] = factory();
})(this, function() {