Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

#1 Update to version 2.5.1 and convert to be npm based #2

Merged
merged 11 commits into from
Sep 13, 2023
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