### Install Dependencies Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/CONTRIBUTING.md Installs project dependencies using npm. This command needs to be run in specific project directories. ```bash npm install ``` -------------------------------- ### Install Gotho.BlazorPdf Package Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/Gotho.BlazorPdf/README.md Installs the Blazor PDF viewer package from NuGet using the .NET CLI. ```bash dotnet add package Gotho.BlazorPdf ``` -------------------------------- ### Install Blazor PDF Package Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/README.md Command to add the Gotho.BlazorPdf NuGet package to your .NET project. ```bash dotnet add package Gotho.BlazorPdf ``` -------------------------------- ### Password Protected PDF Example Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/files/README.md Demonstrates the use of a password-protected PDF file. The password for this file is 'password'. This is useful for testing authentication and access control mechanisms in the PDF viewer. ```PDF test_pdf_document-protected.pdf ``` -------------------------------- ### Malformed PDF Example Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/files/README.md A malformed PDF document used for testing error handling and robustness of the PDF viewer. This file is intentionally corrupted to check how the viewer responds to invalid PDF structures. ```PDF test_pdf_document-bad.pdf ``` -------------------------------- ### Configure Blazor PDF Viewer Service Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/Gotho.BlazorPdf/README.md Adds the Blazor PDF viewer services to the application's service collection during startup. ```csharp builder.Services.AddBlazorPdfViewer(); ``` -------------------------------- ### Configure Blazor PDF Services Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/README.md Adds the Blazor PDF viewer services to the application's service collection in Program.cs. ```csharp builder.Services.AddBlazorPdfViewer(); ``` -------------------------------- ### Gotho.MudBlazor.PdfViewer Legacy Features Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/LEGACY.md This section details features from the legacy Gotho.MudBlazor.PdfViewer package, highlighting its evolution and eventual removal of MudBlazor dependency. It includes functionalities like text selection, PDF downloading, and password-protected document support. ```text Legacy Features: - Text selection for single page mode - Ability to download PDF to device - Support for password protected PDF documents - Alternative scrolling mode - Ability to print documents - Support for page thumbnails - Ability to change color of icons and PDF background ``` -------------------------------- ### Import Blazor PDF Viewer Namespace Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/Gotho.BlazorPdf/README.md Imports the Gotho.BlazorPdf namespace into the _Imports.razor file to make the PdfViewer component available. ```html @using Gotho.BlazorPdf ``` -------------------------------- ### Import Blazor PDF Viewer CSS Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/Gotho.BlazorPdf/README.md Imports the necessary CSS file for the Blazor PDF viewer component into the main application layout. ```html ``` -------------------------------- ### Add Blazor PDF Namespace Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/README.md Imports the Gotho.BlazorPdf namespace into the _Imports.razor file for easy access to components. ```csharp @using Gotho.BlazorPdf ``` -------------------------------- ### Include Blazor PDF CSS Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/README.md Links the Blazor PDF viewer's CSS file in the App.razor file for styling. ```html ``` -------------------------------- ### Robot Exclusion Protocol (robots.txt) Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/Gotho.BlazorPdf.Docs/wwwroot/robots.txt Specifies which parts of the website crawlers are allowed to access. This configuration disallows all user agents from accessing any content. ```text User-agent: * Allow: / Sitemap: https://blazorpdf.info/sitemap.xml ``` -------------------------------- ### Standard PDF Test Document Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/files/README.md A standard PDF test document, a copy from Mozilla's PDF-js library. This serves as a baseline for testing the general rendering and functionality of the PDF viewer. ```PDF test_pdf_document.pdf ``` -------------------------------- ### Javascript Interop Rewrite in Typescript Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/LEGACY.md In version 2.0.0, the Javascript interop code for the PDF viewer was rewritten in Typescript. This improved code maintainability and type safety for the client-side interactions. ```typescript // Example of Typescript interop code (conceptual) interface IPdfViewerInterop { loadDocument(url: string): Promise; printDocument(): void; // ... other methods } // Usage in Blazor component: // await jsRuntime.InvokeAsync("getPdfViewerInstance").loadDocument("path/to/document.pdf"); ``` -------------------------------- ### Bug Fix: JS Code Execution Prevention Source: https://github.com/tgothorp/gotho.blazorpdf/blob/main/LEGACY.md Version 1.0.1 addressed a critical bug where Javascript code execution was being prevented. This fix ensures that any necessary client-side scripts within the PDF viewer function correctly. ```javascript // Conceptual fix for JS execution issue // Ensure that the Blazor interop correctly allows script execution // Example: Blazor.Web.JS.Interop.JSRuntime.InvokeAsync("eval", "console.log('Script executed!');"); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.