Pdfmake: .open() immediately closes when using pdfmake.min.js

Created on 30 Jul 2014  路  9Comments  路  Source: bpampuch/pdfmake

The title pretty much says it all. When I try .open() when I include pdfmake.min.js, a tab opens then immediately closes. However, when I use pdfmake.js, it works as I expect it to.

I have no idea why this is happening but I thought I'd let you know.
I'm using Mac OSX 10.9.4 and Chrome 36.0.1985.125
I can recreate this issue in Safari 7.0.5 and Firefox 30.0

The pdfmake.js and pdfmake.min.js files were downloaded a few minutes ago.

Hope this can be resolved!

Most helpful comment

If anyone else is experiencing this on the current v0.1.27, first check you have whatever flavour of ad blocker you may have turned off. That's coming from a guy who definitely didn't accidentally turn on uBlock Origin in his dev environment...

All 9 comments

try change it .download(). You'll see the errors. Normally you have to check your data definition again. What are you trying to produce?

Same issue (only with minified version)
data definition is picked from examples on site

download doesn't work either and i get the following error (also with print )

Uncaught Error: No unicode cmap for font

here is a plunker to reproduce the issue
http://plnkr.co/edit/Ur67QHZTnQUBilTG3Xay?p=preview

have you check the settings in vfs_fonts.js. I just think the plugin should be runnable without this font settings.

@infacq excuse me but didn't understand you question.
did i miss something in my setup?

i only suspect vfs_fonts.js

If anyone else is experiencing this on the current v0.1.27, first check you have whatever flavour of ad blocker you may have turned off. That's coming from a guy who definitely didn't accidentally turn on uBlock Origin in his dev environment...

Do you guys know a way that we don't have to force the user to disable his ad blocker?

Not that I know of, if there's an option to open in the current window then it should work however.

Just wanted to say that I encountered this issue January 2019, being blocked by uBlock. However, if I breakpoint the this.getBlob function call inside of Document.prototype._openPdf and wait ~15 or more seconds then hit run, it loads without immediately closing the window. Something about the adblocker stops caring if you wait awhile.

My current solution is to detect whether there's an adblocker. If no, open(), if yes, download().

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmatesic picture dmatesic  路  3Comments

CharlyPoppins picture CharlyPoppins  路  3Comments

ValeSauer picture ValeSauer  路  3Comments

kumarandena picture kumarandena  路  3Comments

kamilkp picture kamilkp  路  3Comments