Page 1 of 1

Importing Server Script Libraries

Posted: Sun Jan 18, 2015 9:25 pm
by Aeneas McBurney

Hi,

I am trying to import a js library (pdfMake from https://github.com/bpampuch/pdfmake) and use but when I reference it I get these errors

18.1.2015, 10:06:42 AM: Script CreateInvoice: ReferenceError: pdfMake is not defined ( @ 3 : 0 ) - pdfMake.createPdf(docDefinition).open();

The library is showing as pdfMake under libraries but I don't appear to be referencing correctly. Can you please help?


Importing Server Script Libraries

Posted: Mon Jan 19, 2015 6:22 am
by Illya Stepanov

Hi Aeneas -

Could you please clarify how exactly you have imported this JS inside your project?
Have you declare the document-definition-object as stated in their documentations?


Importing Server Script Libraries

Posted: Mon Jan 19, 2015 7:24 am
by Aeneas McBurney

I am trying to import the js files using the import button but it doesn't seem to work unless I copy and paste onto the script page.

What I am trying to achieve is to create a pdf file from an html document or string. Is this possible?

Thanks,
Aeneas


Importing Server Script Libraries

Posted: Mon Jan 19, 2015 7:49 am
by Illya Stepanov

Are you trying from here:
Image


Importing Server Script Libraries

Posted: Sat Feb 27, 2016 12:44 am
by pakbull6772540

Hi, trying to use the pdfmake.js javascript library.

I have created a simple html file and the pdf gets created. Simple.

However, when included in appery, it generates this error while loading:

appery.js:2171 Uncaught TypeError: _.isTrueObject is not a function

around this code snippet:
Apperyio.processSelectMenu = function (screen) {
var ctx;
if (screen) {
if (.isTrueObject(screen)) {
ctx = $(screen);
} else if (.isString(screen)) {
ctx = $("#" + screen);
}
}

This looks like a very useful library and it works outside of appery, but somehow appery compiler is not liking something. I have created a simple blank jquery app to use so no other code or library present.

Can you tell why Appery is giving an error when using it.


Importing Server Script Libraries

Posted: Sat Feb 27, 2016 12:45 am
by pakbull6772540

were you able to use this library


Importing Server Script Libraries

Posted: Mon Feb 29, 2016 12:54 pm
by Serhii Kulibaba

Hello,

Please clarify, what project type do you use AngularJS or JQM? When do you get that error, after app starting of after running pdfmake?


Importing Server Script Libraries

Posted: Sat Mar 05, 2016 11:23 pm
by pakbull6772540

It is JQUERY app. When on appery development ask to Export Build ipa, it does not complete and breaks down with the error above. So the app never comes up. Take out the pdfmake javascript (manually added and tried with both minified and normal versions) and app compiles fine.

Somehow the compiler does not like the pdfmake js files.


Importing Server Script Libraries

Posted: Tue Mar 15, 2016 3:28 pm
by pakbull6772540

Any ideas yet?


Importing Server Script Libraries

Posted: Wed Mar 16, 2016 1:11 pm
by Serhii Kulibaba

We are very sorry, but this is something outside the scope (http://devcenter.appery.io/support-po...) of our standard support.
Please check any another library for that, e.g.:
https://parall.ax/products/jspdf