Showing
1 changed file
with
11 additions
and
11 deletions
| @@ -36,6 +36,16 @@ for documentation. | @@ -36,6 +36,16 @@ for documentation. | ||
| 36 | ``` | 36 | ``` |
| 37 | 4. For MacOS add printing capability by opening macos directory in XCode | 37 | 4. For MacOS add printing capability by opening macos directory in XCode |
| 38 | 38 | ||
| 39 | +5. For the web, a javascript library and a small script has to be added to | ||
| 40 | + your `web/index.html` file, just before | ||
| 41 | + `<script src="main.dart.js" type="application/javascript"></script>`: | ||
| 42 | + | ||
| 43 | + ```html | ||
| 44 | + <script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.7.570/pdf.min.js"></script> | ||
| 45 | + <script type="text/javascript"> | ||
| 46 | + pdfjsLib.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.7.570/pdf.worker.min.js"; | ||
| 47 | + </script> | ||
| 48 | + ``` | ||
| 39 | 49 | ||
| 40 | ## Examples | 50 | ## Examples |
| 41 | 51 | ||
| @@ -134,17 +144,7 @@ PdfPreview( | @@ -134,17 +144,7 @@ PdfPreview( | ||
| 134 | ); | 144 | ); |
| 135 | ``` | 145 | ``` |
| 136 | 146 | ||
| 137 | -This widget is compatible with Android, iOS, macOS and web. | ||
| 138 | - | ||
| 139 | -For the web, a javascript library and a small script has to be added to | ||
| 140 | -your `web/index.html` file: | ||
| 141 | - | ||
| 142 | -```html | ||
| 143 | -<script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.min.js"></script> | ||
| 144 | -<script type="text/javascript"> | ||
| 145 | - pdfjsLib.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js"; | ||
| 146 | -</script> | ||
| 147 | -``` | 147 | +This widget is compatible with Android, iOS, macOS, Linau, Windows and web. |
| 148 | 148 | ||
| 149 | ## Designing your PDF document | 149 | ## Designing your PDF document |
| 150 | 150 |
-
Please register or login to post a comment