Jspdf: Modernize Source Code Examples

Created on 24 Sep 2020  路  11Comments  路  Source: MrRio/jsPDF

JsPDF has a lot of code examples that haven't been looked at for quite some time and some of them are outdated.

Have a look at the examples and modernize them:

  • Use recent ES6 code
  • Add one or two TypeScript examples
  • Use [email protected] API
  • delete unused files
  • delete the examples/css folder and load required CSS libraries from a CDN
  • delete jquery (examples/js/jquery) and replace it with modern browser APIs
  • reduce code duplication in html files (styles)

Bonus: Add small examples for the three major UI frameworks: VueJs, Angular, and React. Setup the initial applications with @vue/cli, create-react-app, and @angular/cli then add jsPDF.

beginner hacktoberfest help wanted persistent

All 11 comments

Hi,

I would like to help, can you assign it to me please?

Sure. Thanks!

Hi @HackbrettXXX

Before I submit my PR, could you please read the Update for the event please https://hacktoberfest.digitalocean.com/hacktoberfest-update

@SoldierCorp Thanks for notifying us. Unfortunately, I don't have the permissions to add the Hacktoberfest topic to the repo but I've already reached out to @MrRio. Stay tuned.

Looks like it is already added:

Ah, my bad, didn't check it myself :D

Hi @HackbrettXXX , I wish to add an angular based example, however can you tell me what all things are to be shown in the example?

@dhairyagada For starters, show how to import jsPDF and create a very simple PDF file, e.g. with one line of text. Maybe on button click etc. Additional things would be:

  • Show how to use the html function and how to export HTML created from Angular components as PDF (including CSS styling)
  • Show how to mark canvg as external module (see readme).

@SoldierCorp any news?

Hi @HackbrettXXX

Sorry, I just started reviewing this task. It was a crazy month releasing some projects.

I have a question, I've been updating some of them (3 .html files that contain examples) but there are a lot of files in different folders and some of them are purely js and no HTML to test so I'm not sure if I am in the right direction also, what is the url in production the users visit to check these examples?

Sorry for the delay.

@SoldierCorp You mean the JS files in the examples/js folder? They are used by the toplevel index.html which can be seen here: http://raw.githack.com/MrRio/jsPDF/master/. This would also be the "production" URL.

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaxCodeDE picture MaxCodeDE  路  4Comments

sayo96 picture sayo96  路  3Comments

MelanieCroce picture MelanieCroce  路  4Comments

sajesh1985 picture sajesh1985  路  5Comments

mackersD picture mackersD  路  4Comments