Skip to content

Commit

Permalink
#1 Update to version 2.5.1 and convert to be npm based (#2)
Browse files Browse the repository at this point in the history
* Initial update commit, some bindings are subject to change after finding out what's not included in the compat api

* API changes based on index.d.ts found for the npm package
Initial JsPDF HTML plugin support (bindings+jsPDF.html method)

* AcroForm, AddImage, Annotations, AutoPrint, Arabic plugin bindings

* fix

* Context2d, Canvas, Cell, Outline, FileLoading plugin bindings

* Last plugin bindings
(SplitTextToSize, SVG, SetLanguage, TotalPages, ViewerPreferences, VFS, XmpMetadata)

* HTMLWorker fix + tiny update in tests

* AcroFormButton fix+JsPDFOptions param name

* AcroForm changes+fixes

* Sample pdf changes+tiny binding fixes

* Removed WS.JsPDF.Resources
  • Loading branch information
GyGerg authored and Jooseppi12 committed Nov 23, 2023
1 parent e912605 commit 097b85e
Show file tree
Hide file tree
Showing 10 changed files with 1,892 additions and 65 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WebSharper.JsPDF

WebSharper Extension for JsPDF 1.3.4
WebSharper bindings for JsPDF 2.5.1

* [Source Repository](https://github.com/intellifactory/websharper.jspdf)
44 changes: 37 additions & 7 deletions WebSharper.JsPDF.Sample/Client.fs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions WebSharper.JsPDF.Sample/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
width: 100%;
}
</style>
<script type="text/javascript" src="Content/WebSharper.JsPDF.Sample.head.js"></script>
<script type="module" src="Content/WebSharper.JsPDF.Sample.head.js"></script>
</head>
<body>
<div id="main" ws-children-template="Main">
<div class="pdf-holder">
<div ws-replace="PDF"></div>
</div>
</div>
<script type="text/javascript" src="Content/WebSharper.JsPDF.Sample.min.js"></script>
<script type="module" src="Content/WebSharper.JsPDF.Sample.min.js"></script>
</body>
</html>
215 changes: 215 additions & 0 deletions WebSharper.JsPDF.Sample/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions WebSharper.JsPDF.Sample/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "websharper.jspdf.sample",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"jspdf": "^2.5.1"
}
}
9 changes: 9 additions & 0 deletions WebSharper.JsPDF.Tests/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
namespace WebSharper.JsPDF.Tests

open WebSharper
open WebSharper.JsPDF
open WebSharper.Sitelets
open WebSharper.UI

Expand All @@ -38,6 +39,14 @@ module Client =
Test "JsPDF constructor test" {
notEqualMsg (JsPDF.JsPDF()) (JS.Undefined) "JsPDF() constructor"
}

Test "Promise test" {
let! valami = JsPDF().Html("<body><h1>Hello world</h1></body>").outputImg(HTMLWorkerOutputImgType.Dataurlstring)
notEqualMsg
valami
JS.Undefined
"HTMLWorker OutputImg"
}

}

Expand Down
4 changes: 2 additions & 2 deletions WebSharper.JsPDF.Tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
margin: 20px 0;
}
</style>
<script type="text/javascript" src="Content/WebSharper.JsPDF.Tests.head.js"></script>
<script type="module" src="Content/WebSharper.JsPDF.Tests.head.js"></script>
</head>
<body>
<!-- Static navbar -->
Expand Down Expand Up @@ -65,6 +65,6 @@
</p>
</div>
</footer>
<script type="text/javascript" src="Content/WebSharper.JsPDF.Tests.min.js"></script>
<script type="module" src="Content/WebSharper.JsPDF.Tests.min.js"></script>
</body>
</html>
Loading

0 comments on commit 097b85e

Please sign in to comment.