-
-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add PdfViewer project * Working example * Sort extensions in the demo * Loading and pages navigation * Optimize scripts loading * Use buttons * loadDocument method * Zoom * Update sln guid * Split viewer into separate components * nuget pack * Docs and release notes * readonly note * Update PageNumber and Scale options * Update Rotation * Delete extra NotifyPdfInitialized * Scale two way binding * Mention mthods in docs * Fix initial pageNumber * Add printing * Fix zoom icon names * Non-generic subscribable callbacks * Use internal state * URL wording * mark Subscribable methods as internal * Rename method insertCSSIntoDocumentHead * Rename canvas to element * Null checks * null checks * Use delegate in example * Grammar * Rename to SubscribeOrReplace * Base64 example * Comment * Change lead sentence * Separate API page
- Loading branch information
Showing
52 changed files
with
1,884 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@page "/tests/pdfviewer" | ||
<Row> | ||
<Column> | ||
<Card Margin="Margin.Is4.OnY"> | ||
<CardHeader> | ||
<CardTitle>PdfViewer</CardTitle> | ||
</CardHeader> | ||
<CardBody> | ||
<PdfViewerContainer Height="Height.Rem(50)"> | ||
<PdfViewerToolbar /> | ||
<PdfViewer Source="@source" /> | ||
</PdfViewerContainer> | ||
</CardBody> | ||
</Card> | ||
</Column> | ||
</Row> | ||
<Row> | ||
<Column> | ||
<Card Margin="Margin.Is4.OnY"> | ||
<CardHeader> | ||
<CardTitle>As a standalone PdfViewer</CardTitle> | ||
</CardHeader> | ||
<CardBody> | ||
<Button Color="Color.Primary" Clicked="@(()=>standalonePdfViewerRef.PreviousPage())">Previous page</Button> | ||
<Button Color="Color.Primary" Clicked="@(()=>standalonePdfViewerRef.NextPage())">Next page</Button> | ||
<Button Color="Color.Secondary" Clicked="@(()=>pageNumber = 5)">Go to Page 5</Button> | ||
<Button Color="Color.Secondary" Clicked="@(()=>scale = 1)">Set Scale 1</Button> | ||
<Button Color="Color.Secondary" Clicked="@(()=>scale = 2)">Set Scale 2</Button> | ||
<Button Color="Color.Dark" Clicked="@(()=>standalonePdfViewerRef.Print())">Print</Button> | ||
</CardBody> | ||
<CardBody> | ||
<Div Height="Height.Rem(50)" Overflow="Overflow.Auto"> | ||
<PdfViewer @ref="@standalonePdfViewerRef" Source="@source" @bind-PageNumber="@pageNumber" @bind-Scale="@scale" /> | ||
</Div> | ||
</CardBody> | ||
</Card> | ||
</Column> | ||
</Row> | ||
@code { | ||
string source = "https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf"; | ||
PdfViewer standalonePdfViewerRef; | ||
int pageNumber = 2; | ||
double scale = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...ation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/ImportPdfViewerExampleCode.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="blazorise-codeblock"> | ||
<div class="html"><pre> | ||
<span class="atSign">@</span>using Blazorise.PdfViewer | ||
</pre></div> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
...ation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...tation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBasicExampleCode.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="blazorise-codeblock"> | ||
<div class="html"><pre> | ||
<span class="htmlTagDelimiter"><</span><span class="htmlElementName">PdfViewer</span> <span class="htmlAttributeName">Source</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="htmlAttributeValue">https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf</span><span class="quot">"</span> <span class="htmlTagDelimiter">/></span> | ||
</pre></div> | ||
</div> |
5 changes: 5 additions & 0 deletions
5
...Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerNugetInstallExampleCode.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="blazorise-codeblock"> | ||
<div class="html"><pre> | ||
Install-Package Blazorise.PdfViewer | ||
</pre></div> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
...ation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerPagingExampleCode.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="blazorise-codeblock"> | ||
<div class="html"><pre> | ||
<span class="htmlTagDelimiter"><</span><span class="htmlElementName">Button</span> <span class="htmlAttributeName">Color</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="enum">Color</span><span class="enumValue">.Primary</span><span class="quot">"</span> <span class="htmlAttributeName">Clicked</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="sharpVariable"><span class="atSign">@</span>OnPreviousPageClicked</span><span class="quot">"</span><span class="htmlTagDelimiter">></span>Prev<span class="htmlTagDelimiter"></</span><span class="htmlElementName">Button</span><span class="htmlTagDelimiter">></span> | ||
<span class="htmlTagDelimiter"><</span><span class="htmlElementName">Button</span> <span class="htmlAttributeName">Color</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="enum">Color</span><span class="enumValue">.Primary</span><span class="quot">"</span> <span class="htmlAttributeName">Clicked</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="sharpVariable"><span class="atSign">@</span>OnNextPageClicked</span><span class="quot">"</span><span class="htmlTagDelimiter">></span>Next<span class="htmlTagDelimiter"></</span><span class="htmlElementName">Button</span><span class="htmlTagDelimiter">></span> | ||
|
||
<span class="htmlTagDelimiter"><</span><span class="htmlElementName">PdfViewer</span> <span class="htmlAttributeName"><span class="atSign">@</span>ref</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="sharpVariable"><span class="atSign">@</span>pdfViewerRef</span><span class="quot">"</span> <span class="htmlAttributeName">Source</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="htmlAttributeValue">https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf</span><span class="quot">"</span> <span class="htmlTagDelimiter">/></span> | ||
</pre></div> | ||
<div class="csharp"><pre> | ||
<span class="atSign">@</span>code { | ||
PdfViewer pdfViewerRef; | ||
|
||
Task OnPreviousPageClicked() => pdfViewerRef.PreviousPage(); | ||
Task OnNextPageClicked() => pdfViewerRef.NextPage(); | ||
} | ||
</pre></div> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
...tion/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerToolbarExampleCode.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="blazorise-codeblock"> | ||
<div class="html"><pre> | ||
<span class="htmlTagDelimiter"><</span><span class="htmlElementName">PdfViewerContainer</span> <span class="htmlAttributeName">Height</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="htmlAttributeValue">Height.Rem(35)</span><span class="quot">"</span><span class="htmlTagDelimiter">></span> | ||
<span class="htmlTagDelimiter"><</span><span class="htmlElementName">PdfViewerToolbar</span> <span class="htmlTagDelimiter">/></span> | ||
<span class="htmlTagDelimiter"><</span><span class="htmlElementName">PdfViewer</span> <span class="htmlAttributeName">Source</span><span class="htmlOperator">=</span><span class="quot">"</span><span class="htmlAttributeValue">https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf</span><span class="quot">"</span> <span class="htmlTagDelimiter">/></span> | ||
<span class="htmlTagDelimiter"></</span><span class="htmlElementName">PdfViewerContainer</span><span class="htmlTagDelimiter">></span> | ||
</pre></div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
...on/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Examples/ImportPdfViewerExample.snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@using Blazorise.PdfViewer |
7 changes: 7 additions & 0 deletions
7
...tion/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Examples/PdfViewerBase64Example.razor
Large diffs are not rendered by default.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...ation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Examples/PdfViewerBasicExample.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@namespace Blazorise.Docs.Docs.Examples | ||
|
||
<PdfViewer Source="https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf" /> |
1 change: 1 addition & 0 deletions
1
...zorise.Docs/Pages/Docs/Extensions/PdfViewer/Examples/PdfViewerNugetInstallExample.snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Install-Package Blazorise.PdfViewer |
13 changes: 13 additions & 0 deletions
13
...tion/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Examples/PdfViewerPagingExample.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@namespace Blazorise.Docs.Docs.Examples | ||
|
||
<Button Color="Color.Primary" Clicked="@OnPreviousPageClicked">Prev</Button> | ||
<Button Color="Color.Primary" Clicked="@OnNextPageClicked">Next</Button> | ||
|
||
<PdfViewer @ref="@pdfViewerRef" Source="https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf" /> | ||
|
||
@code { | ||
PdfViewer pdfViewerRef; | ||
|
||
Task OnPreviousPageClicked() => pdfViewerRef.PreviousPage(); | ||
Task OnNextPageClicked() => pdfViewerRef.NextPage(); | ||
} |
6 changes: 6 additions & 0 deletions
6
...ion/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Examples/PdfViewerToolbarExample.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@namespace Blazorise.Docs.Docs.Examples | ||
|
||
<PdfViewerContainer Height="Height.Rem(35)"> | ||
<PdfViewerToolbar /> | ||
<PdfViewer Source="https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf" /> | ||
</PdfViewerContainer> |
Oops, something went wrong.