jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

Modernize Source Code Examples

Open HackbrettXXX opened this issue 5 years ago • 13 comments

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.

HackbrettXXX avatar Sep 24 '20 09:09 HackbrettXXX

Hi,

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

SoldierCorp avatar Sep 25 '20 10:09 SoldierCorp

Sure. Thanks!

HackbrettXXX avatar Sep 25 '20 12:09 HackbrettXXX

Hi @HackbrettXXX

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

SoldierCorp avatar Oct 03 '20 04:10 SoldierCorp

@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.

HackbrettXXX avatar Oct 05 '20 09:10 HackbrettXXX

Looks like it is already added:

listopadiya avatar Oct 05 '20 09:10 listopadiya

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

HackbrettXXX avatar Oct 05 '20 10:10 HackbrettXXX

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 avatar Oct 27 '20 14:10 dhairyagada

@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?

HackbrettXXX avatar Oct 27 '20 16:10 HackbrettXXX

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 avatar Oct 29 '20 00:10 SoldierCorp

@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.

HackbrettXXX avatar Oct 29 '20 15:10 HackbrettXXX

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.

github-actions[bot] avatar Jan 28 '21 02:01 github-actions[bot]

Hello,

I would like to help with it. Can you assign it to me please?

wirtaw avatar Oct 01 '24 16:10 wirtaw

Heyy, I would love to help <3 Can you assign it to me?

definitelynotchirag avatar Oct 06 '24 17:10 definitelynotchirag