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

publish / savedAs is not defined. #22

Closed
jonas89 opened this issue Apr 24, 2015 · 4 comments
Closed

publish / savedAs is not defined. #22

jonas89 opened this issue Apr 24, 2015 · 4 comments

Comments

@jonas89
Copy link

jonas89 commented Apr 24, 2015

Hi! Ive stumbled across a problem, that i'm struggeling to figure out.
I keep getting told that publish / savedAs is not defined(tryed both obviously).

code:

var doc = new jsPDF('p', 'pt');
doc.autoTable(addedAttributes, exportData, {});
doc.save('table.pdf');

this is wrapped inside a click event.

JS files( jsPDF files only)

                    "~/Scripts/jsPDF2/jspdf.js",
                    "~/Scripts/jsPDF2/jspdf.plugin.standard_fonts_metrics.js",
                    "~/Scripts/jsPDF2/jspdf.plugin.split_text_to_size.js",
                    "~/Scripts/jsPDF2/jspdf.plugin.from_html.js",
                    "~/Scripts/jsPDF2/jspdf.plugin.cell.js",
                    "~/Scripts/jsPDF2/jspdf.plugin.autotable.js",
                    "~/Scripts/jsPDF2/jspdf.plugin.annotations.js",
                    "~/Scripts/jsPDF2/jspdf.plugin.addimage.js",
                    "~/Scripts/jsPDF2/jspdf.autoprint.js",

Is there any special dependacies appart from these files?

@jonas89 jonas89 closed this as completed Apr 24, 2015
@simonbengtsson
Copy link
Owner

Did you solve your issue?

@jonas89
Copy link
Author

jonas89 commented Apr 24, 2015

Hi there, thx for replying :) Yes i did. I kept getting the error saveAs is not defined, when doing "doc.save("someName.pdf");"

In the end i figured id try to include the debug file from ur example files. And now it does work.

Im pretty new to JS in general, so im not sure why that would help, but i saw there was some "cases" defined in that document, in which "saveAs" was mentioned.

@simonbengtsson
Copy link
Owner

Nice! The reason including only the debug file works is because that file is basically just a concatenation of all the files you included manually (plus a little extra as you found out). Using jspdf I would recommend you to use either the the debug file or the minified debug file from the dist folder in the jspdf repository. If you have other issues, let me know!

@jonas89
Copy link
Author

jonas89 commented Apr 24, 2015

Thx, ur the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants