Git Product home page Git Product logo

Comments (8)

slimlime avatar slimlime commented on September 24, 2024 2

Thanks @edisonneza

Progressively journalled notes as I went through πŸ˜…

Still uncertain which parts of jsPDF are documented as feature vs bug πŸ› itself :P - will see whether we get further (official) responses from their issue tracker - otherwise some of my drop-in types may have to do in the shortβ€”to mediumβ€”term.

I added a comment to a font metrics issue to start (will find and reference back) with a sample of expected input/output interface shape)


Working things through - I will hopefully be able to incrementally separate it in a maintainable fashion to PR back

May be a while :S

from jspdf-invoice-template.

edisonneza avatar edisonneza commented on September 24, 2024 1

😯😳 lots of topics in a single issue haha. I will try to seprate them, or if you can it would be the best to create a PR if you're gonna do any fix or features. Tomorrow I will work on the fix of the other issue and publish the package. Thanks for the contribution!!

from jspdf-invoice-template.

slimlime avatar slimlime commented on September 24, 2024

Bouncing around ideas / discussion πŸ™Œ

from jspdf-invoice-template.

slimlime avatar slimlime commented on September 24, 2024

Also I think the text alignment property may not be working due to this similar issue

and, on delving in, it looks like the text() function expects the align property within a settings object rather than as a direct string

  export interface TextOptionsLight {
    align?: "left" | "center" | "right" | "justify";

from jspdf-invoice-template.

slimlime avatar slimlime commented on September 24, 2024

This usage is different to the other times the function is used in the file

https://github.com/edisonneza/jspdf-invoice-template/blob/main/src/index.js#L477

        /* no compile-time warning */
        doc.text(
          param.pageLabel + " " + i + " / " + doc.getNumberOfPages(),
          docWidth - 20,
          doc.internal.pageSize.height - 6
        );


also noting a non-bug (for this repo) as I was wondering why doc.getPageWidth() raised errors on transpile

  var getPageWidth = (API.getPageWidth = function(pageNumber) {
    pageNumber = pageNumber || currentPage;
    return (
      (pagesContext[pageNumber].mediaBox.topRightX -
        pagesContext[pageNumber].mediaBox.bottomLeftX) /
      scaleFactor
    );
  });
  • this is actually a jsPDF bug where it is missing type declarations for some parts and not others.

A common issue in many longstanding js dependencies

from jspdf-invoice-template.

slimlime avatar slimlime commented on September 24, 2024

js vs the documented index.d.ts discrepancies get tedious to review as the footer did appear to be centered at the bottom

however,
the types expected a settings object instead of the string "center"

                doc.text(
                    param.footer.text,
                    docWidth / 2,
                    docHeight - 10,
                    "center"
                );

from jspdf-invoice-template.

slimlime avatar slimlime commented on September 24, 2024

^ Wondering if right alignment is present for decimal currency fields as part of the table

from jspdf-invoice-template.

edisonneza avatar edisonneza commented on September 24, 2024

Added in my TODO list. Reopen it if anything else.

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.