-
Notifications
You must be signed in to change notification settings - Fork 10k
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
PDFDoc() now detects argument type #542
Conversation
var stream = new Stream(data); | ||
function constructor(arg, callback) { | ||
// Stream argument | ||
if (typeof arg.isStream !== 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be |typeof arg.isStream !== 'undefined' && arg.isStream| ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose someone could really mess with us and add a isStream = false
to an object... So, yep :)
Or more simply: if (arg.isStream)
. I just added typeof
for consistency with the test below it (ArrayBuffer
type).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cgjones I was just about to fix this :) oh well, I guess it's no biggie.
PDFDoc() now detects argument type
Let's merge it with your next pull request. |
…ge (but only when pageMode="single")
As per discussion with @angreasgal in #532,
PDFDoc()
now detects whether the argument isArrayBuffer()
or our ownStream()
, and initializes accordingly.