Skip to content
websharper-samplesPublic

About

JsPDF sample for WebSharper

Resources

Stars

1 star

Watchers

3 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSharper JsPDF

An in-browser PDF generator built with WebSharper and the WebSharper.JsPDF bindings: compose a document and watch jsPDF render it live — then download it.

screenshot

Try it live

What it shows

  • A title and body editor whose PDF preview is regenerated on every keystroke.
  • Automatic line wrapping with SplitTextToSize and page breaks when the text overflows the page.
  • A Download PDF button that saves the document with Save.

How it works

  • src/Client.fs builds a JsPDF document from the current inputs, exposes it as a blob: URL for the preview iframe, and revokes the previous URL.
  • src/wwwroot/index.html holds the page header, and jsPDF is bundled from npm by esbuild.

Running locally

dotnet run --project src

Then open http://localhost:5896.

Building

dotnet build src/JsPDF.fsproj -c Release

Deployment

Every push to master builds in Release and publishes src/wwwroot to the gh-pages branch via .github/workflows/deploy.yml.

About

JsPDF sample for WebSharper

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages