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

No ArrayBuffer in IE9 ( and possibly below ) #425

Closed
furoTmark opened this issue Dec 16, 2014 · 7 comments
Closed

No ArrayBuffer in IE9 ( and possibly below ) #425

furoTmark opened this issue Dec 16, 2014 · 7 comments

Comments

@furoTmark
Copy link

When trying out the examples in Internet Exolorer 9 this exception comes up:
Error in function : 'ArrayBuffer' is undefinedReferenceError: 'ArrayBuffer' is undefined

The block of code that gives the error is on line 803:

    getArrayBuffer = function() {
        var data = buildDocument(), len = data.length,
        ab = new ArrayBuffer(len), u8 = new Uint8Array(ab);

        while(len--) u8[len] = data.charCodeAt(len);
        return ab;
    },

Added https://github.com/inexorabletash/polyfill/blob/master/typedarray.js for ArrayBuffer, but still get:

Error in function : Object expectedTypeError: Object expected

@furoTmark furoTmark reopened this Dec 16, 2014
@diegocr
Copy link
Collaborator

diegocr commented Feb 6, 2015

This seems a problem on the polyfill, probably a limitation on the implementation for your specific browser, so i'd report it on their repo.

@codefactor
Copy link

I have this same issue, and unfortunately most of our users (which are mostly corporations) are using IE 9.

Go to this page in IE 9: http://mrrio.github.io/jsPDF/
The current behavior is a javascript alert: "Error in function : 'ArrayBuffer' is undefined

If the jsPDF library requires some other libraries to work in IE 9, it may be a good idea to list those dependencies on the README.md

@MrRio
Copy link
Member

MrRio commented Apr 13, 2015

Good idea. Something like this perhaps:

https://gist.github.com/Benvie/5020656

Not sure how performant this is. 

On Monday, Apr 13, 2015 at 20:32, Code Factor notifications@github.com, wrote:

I have this same issue, and unfortunately most of our users (which are mostly corporations) are using IE 9.

Go to this page in IE 9: http://mrrio.github.io/jsPDF/

The current behavior is a javascript alert: "Error in function : 'ArrayBuffer' is undefined

If the jsPDF library requires some other libraries to work in IE 9, it may be a good idea to list those dependencies on the README.md


Reply to this email directly or view it on GitHub.

@codefactor
Copy link

Here is another one:

https://github.com/inexorabletash/polyfill/blob/master/typedarray.js

However, I had to modify this because there is a maximum array size of 100,000 which I increased to 1,000,000

@vlvagerviwager
Copy link
Contributor

I'm having the same issue when I try to save a PDF - I took in https://github.com/inexorabletash/polyfill/blob/master/typedarray.js as a polyfill for ArrayBuffer and am now getting the "Error in function : Object expected" error in IE 9. Tracked it down to line 423 of jspdf.js (I have a version downloaded from the Parallax site rather than downloaded from here), if you look at what fn is at line 410, it's cut off in IE 9 but not in Chrome.

i.e. IE 9:

function(type, options) {
            switch (type) {
                case undefined:
                    return buildDocument();
                case 'save':
                    if (navigator.getUserMedia) {
                        if (global.URL === undefined
                        || global.URL.createObjectURL === undefined) {
                            return 

Whereas in Chrome, it's the full function. Therefore in IE it stops at the unfinished return statement at the end, as it's expecting an Object, just as the error message says...that's what I think is happening.

Additionally, IE 9 is missing implementations of atob and Blob, which I have found polyfills for:

https://github.com/carlo/jquery-base64
https://github.com/eligrey/Blob.js

@vlvagerviwager
Copy link
Contributor

Possibly relevant issues on the typedarray.js polyfill Github:

@RikaLuo
Copy link

RikaLuo commented Apr 4, 2017

I can't download it in IE11 and edge browser,I have used JSPDF v1.3.3 plugin , can you tell me how to debug it?

MrRio pushed a commit that referenced this issue Sep 2, 2017
Solution to solve memory leaks caused by big images.
Is solving the issues #844 and #425
Uzlopak added a commit that referenced this issue Feb 22, 2018
* Update karma.conf.js

* Merge  (#7)

* Update addimage.js

Solution to solve memory leaks caused by big images.
Is solving the issues #844 and #425

* normalize Color Methods

* f2 => f3

* make it black

* make it gray again

typeof comparison was wrong...

* make typeof comparison wrong to pass test

* Update jspdf.js

d'oh

* Update jspdf.js

correct it again....

* operation fix

ch1 === ch2  === ch3 is wrong. it would process from left to right resulting in a ch1 === ch2 => true, true === ch3 => false

* update test pdf

fix it so that the test is passed

* Update rectangles.pdf

stupid letter

* Update rectangles.pdf

fix length of content

* Update rectangles.pdf

... why?

* Update jspdf.js

DRY it up
add cssColor to rgb  conversion

* Update jspdf.js

bugfix

* Update standard.spec.js

add test for colornames

* Update standard.spec.js

* Update standard.spec.js

* Update jspdf.js

convert short rgb to long form

* Update standard.spec.js

add test case for short rgb-values

* Update jspdf.js

add a setter for the CreationDate

* Update jspdf.js

some major changes to the setCreationDate Algorythm

* Update jspdf.js

bugfix

* Update jspdf.js

darn...

* Update jspdf.js

* Update jspdf.js

* Update jspdf.js

bugfix

* Update addimage.js

round is not the proper method. It has to be ceil so that the splice-method is called atleast once.

* add polyfill for Object.assign

* Add files via upload

* Add files via upload

fix small mistake

* fix tainted standardfontsmetrics

* Add files via upload

one fix

* Update acroform.js

* update references

* modify tests

* force testing

* Update acroform.js

* Add files via upload

* Update acroform.js

* update references

* Add files via upload

* Update acroform.js

* Update acroform.js

* Add files via upload

* Update acroform.js

* Add files via upload

* Add files via upload

* Update acroform.js

* Add files via upload

* addimage.js add cmyk recognition for jpg

* make it less code

* Update saucelabs.karma.conf.js

* Create standard.spec.js

* Create jpg.pdf

* Rename tests/addimage/jpg.pdf to tests/addimage/reference/jpg.pdf

* Add files via upload

* test first if jpeg is working

* Add files via upload

* Update jpeg.spec.js

* Add files via upload

* Add files via upload

* Add files via upload

* Update saucelabs.karma.conf.js

* Update jpg.b64

* Update addhtml.js

#1480

* add ability to recognize filetype by header

* remove unnecessary variable

* typo-fix

* Update addimage.js

* Update addimage.js

#966

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

* Update saucelabs.karma.conf.js

* Update compare.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

* Add files via upload

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update compare.js

D'Oh

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

why is here a done? fml

* Add files via upload

* Add files via upload

* Add files via upload

* Delete jpg.b64

* Update jpeg.spec.js

* Update compare.js

* Update saucelabs.karma.conf.js

* Update png.spec.js

* Update saucelabs.karma.conf.js

* Update addimage.js

* Create filetypeRecognition.spec.js

* Update saucelabs.karma.conf.js

* Update filetypeRecognition.spec.js

* Update addimage.js

* fix IE error

* Update standard.spec.js

HideWindowUI.pdf is misssing

* compare.js make it look good

* add tests

* Update saucelabs.karma.conf.js

* Fix for #905 #1163 #1317

adler32cs is no longer maintained, made package.json point to my fork of  adler32cs that contains the loader.js fix

* small modification

* Update outline.js

* Add files via upload

* Update standard.spec.js

* Update karma.conf.js to load outline.js

* Update saucelabs.karma.conf.js to load outline.js

* chore(package): update rollup-plugin-babel to version 3.0.3

* chore(package): update karma to version 2.0.0

* Add new method for internal, getTextColor

* Update dist files and docs to include getTextColor

* Revise getTextColor to return hex code; add new spec

* Compiled assets for getTextColor modifications

* Updates spec and documentation per feedback

* chore(package): update uglify-js to version 3.3.5

Closes #1506

* simplify

* addCreationDate

* Update standard.spec.js

* Update standard.spec.js

* Update jspdf.js

* Update standard.spec.js

* Update standard.spec.js

* Add png adam7 interlace (#6)

* Update png.js

Adapted from here 
foliojs/png.js#8

* make it look good

* fix possible merging error

* fix minor bug

* hopefull removed all dupes

* Update main.js

* Don't skip HideWindowUI

* Update addimage.js

* Update compare.js

* Add files via upload

* Update jspdf.js

* Update jspdf.js

* Update addhtml.js

* Update outline.js

* Update cell.js

* Update annotations.js

* Update from_html.js

* Update context2d.js

* Update acroform.js

* Update addimage.js

* Update karma.conf.js

* Create getImageProperties.spec.js

* typo
Uzlopak added a commit that referenced this issue May 8, 2018
* Update karma.conf.js

* Merge  (#7)

* Update addimage.js

Solution to solve memory leaks caused by big images.
Is solving the issues #844 and #425

* normalize Color Methods

* f2 => f3

* make it black

* make it gray again

typeof comparison was wrong...

* make typeof comparison wrong to pass test

* Update jspdf.js

d'oh

* Update jspdf.js

correct it again....

* operation fix

ch1 === ch2  === ch3 is wrong. it would process from left to right resulting in a ch1 === ch2 => true, true === ch3 => false

* update test pdf

fix it so that the test is passed

* Update rectangles.pdf

stupid letter

* Update rectangles.pdf

fix length of content

* Update rectangles.pdf

... why?

* Update jspdf.js

DRY it up
add cssColor to rgb  conversion

* Update jspdf.js

bugfix

* Update standard.spec.js

add test for colornames

* Update standard.spec.js

* Update standard.spec.js

* Update jspdf.js

convert short rgb to long form

* Update standard.spec.js

add test case for short rgb-values

* Update jspdf.js

add a setter for the CreationDate

* Update jspdf.js

some major changes to the setCreationDate Algorythm

* Update jspdf.js

bugfix

* Update jspdf.js

darn...

* Update jspdf.js

* Update jspdf.js

* Update jspdf.js

bugfix

* Update addimage.js

round is not the proper method. It has to be ceil so that the splice-method is called atleast once.

* add polyfill for Object.assign

* Add files via upload

* Add files via upload

fix small mistake

* fix tainted standardfontsmetrics

* Add files via upload

one fix

* Update acroform.js

* update references

* modify tests

* force testing

* Update acroform.js

* Add files via upload

* Update acroform.js

* update references

* Add files via upload

* Update acroform.js

* Update acroform.js

* Add files via upload

* Update acroform.js

* Add files via upload

* Add files via upload

* Update acroform.js

* Add files via upload

* addimage.js add cmyk recognition for jpg

* make it less code

* Update saucelabs.karma.conf.js

* Create standard.spec.js

* Create jpg.pdf

* Rename tests/addimage/jpg.pdf to tests/addimage/reference/jpg.pdf

* Add files via upload

* test first if jpeg is working

* Add files via upload

* Update jpeg.spec.js

* Add files via upload

* Add files via upload

* Add files via upload

* Update saucelabs.karma.conf.js

* Update jpg.b64

* Update addhtml.js

#1480

* add ability to recognize filetype by header

* remove unnecessary variable

* typo-fix

* Update addimage.js

* Update addimage.js

#966

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

* Update saucelabs.karma.conf.js

* Update compare.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

* Add files via upload

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update compare.js

D'Oh

* Update compare.js

* Update jpeg.spec.js

* Update compare.js

* Update compare.js

* Update compare.js

* Update jpeg.spec.js

why is here a done? fml

* Add files via upload

* Add files via upload

* Add files via upload

* Delete jpg.b64

* Update jpeg.spec.js

* Update compare.js

* Update saucelabs.karma.conf.js

* Update png.spec.js

* Update saucelabs.karma.conf.js

* Update addimage.js

* Create filetypeRecognition.spec.js

* Update saucelabs.karma.conf.js

* Update filetypeRecognition.spec.js

* Update addimage.js

* fix IE error

* Update standard.spec.js

HideWindowUI.pdf is misssing

* compare.js make it look good

* add tests

* Update saucelabs.karma.conf.js

* Fix for #905 #1163 #1317

adler32cs is no longer maintained, made package.json point to my fork of  adler32cs that contains the loader.js fix

* small modification

* Update outline.js

* Add files via upload

* Update standard.spec.js

* Update karma.conf.js to load outline.js

* Update saucelabs.karma.conf.js to load outline.js

* chore(package): update rollup-plugin-babel to version 3.0.3

* chore(package): update karma to version 2.0.0

* Add new method for internal, getTextColor

* Update dist files and docs to include getTextColor

* Revise getTextColor to return hex code; add new spec

* Compiled assets for getTextColor modifications

* Updates spec and documentation per feedback

* chore(package): update uglify-js to version 3.3.5

Closes #1506

* simplify

* addCreationDate

* Update standard.spec.js

* Update standard.spec.js

* Update jspdf.js

* Update standard.spec.js

* Update standard.spec.js

* Add png adam7 interlace (#6)

* Update png.js

Adapted from here 
foliojs/png.js#8

* make it look good

* fix possible merging error

* fix minor bug

* hopefull removed all dupes

* Update main.js

* Don't skip HideWindowUI

* Update addimage.js

* Update compare.js

* Add files via upload

* Update jspdf.js

* Update jspdf.js

* Update addhtml.js

* Update outline.js

* Update cell.js

* Update annotations.js

* Update from_html.js

* Update context2d.js

* Update acroform.js

* Update addimage.js

* Update karma.conf.js

* Create getImageProperties.spec.js

* typo
@Uzlopak Uzlopak closed this as completed Oct 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants