Git Product home page Git Product logo

Comments (13)

edisonneza avatar edisonneza commented on September 24, 2024

Can you provide the code how you have imported it?

from jspdf-invoice-template.

Wollos2019 avatar Wollos2019 commented on September 24, 2024

First I use the following command to install the package on a Angular project: npm i jspdf-invoice-template.
And this is how I imported it :

import jsPDFInvoiceTemplate, { OutputType, jsPDF } from "jspdf-invoice-template";
var pdfObject = jsPDFInvoiceTemplate.default(props); //returns number of pages created

from jspdf-invoice-template.

edisonneza avatar edisonneza commented on September 24, 2024

And 'props' is the object parameter as in the the example i have posted?
The exception you are receiving it's a bit strange.

Can you show a image of the basic implementation with the props parameter? And the error message?

from jspdf-invoice-template.

Wollos2019 avatar Wollos2019 commented on September 24, 2024

image
image

from jspdf-invoice-template.

edisonneza avatar edisonneza commented on September 24, 2024

Understand. I have to do some tests for Angular v13 in order to find a fix. Thank you for reporting it!

from jspdf-invoice-template.

Wollos2019 avatar Wollos2019 commented on September 24, 2024

Exactly, I'm using Angular V13. Thank you for your reply.

from jspdf-invoice-template.

lorenzhh avatar lorenzhh commented on September 24, 2024

You just need to call it that way,

jsPDFInvoiceTemplate(props);
You also may need to add

jsPDFInvoiceTemplate(props as any);

from jspdf-invoice-template.

Wollos2019 avatar Wollos2019 commented on September 24, 2024

Hi @edisonneza, Thanks for your reply, by using this code jsPDFInvoiceTemplate(props as any);,there is no more error in my InvoiceComponent.ts, but now I'm getting this error in InvoiceComponent.html by launching the App:
Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'webpackChunkjsPDFInvoiceTemplate')

from jspdf-invoice-template.

edisonneza avatar edisonneza commented on September 24, 2024

Hi @Wollos2019 , i just updated the package to support Angular v13. I have done a fix by separating the project into two different packages, one for web browsers and another one for nodejs.

Please take a look at the readme for more. The version to install for Angular v13 is 1.4.2.

Try it and let me know if anything.

Thank you!

from jspdf-invoice-template.

Wollos2019 avatar Wollos2019 commented on September 24, 2024

Hi @edisonneza, I installed the package with npm i jspdf-invoice-template-nodejs, but I get this error:

ERROR Error: Uncaught (in promise): ReferenceError: global is not defined
ReferenceError: global is not defined

Maybe I did something wrong or doesn't know how to implement correctly. I also tried to specified the version like this npm i [email protected], but it doesn't work. Thanks a lot for your Attention and your Help.

from jspdf-invoice-template.

edisonneza avatar edisonneza commented on September 24, 2024

You are using nodejs package. Please install the "jspdf-invoice-template" if you are using in frontend web projects.

from jspdf-invoice-template.

edisonneza avatar edisonneza commented on September 24, 2024

@Wollos2019 I'm closing the issue since the problem seems to be fixed.
Open another one if you have other issues!

from jspdf-invoice-template.

Wollos2019 avatar Wollos2019 commented on September 24, 2024

from jspdf-invoice-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.