├── Blazor-PDF ├── Output │ ├── text.pdf │ ├── fonts.pdf │ ├── images.pdf │ ├── tables.pdf │ └── bookmarks.pdf ├── Blazor-PDF │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── images │ │ │ └── Logo.png │ │ ├── css │ │ │ ├── open-iconic │ │ │ │ ├── font │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ │ ├── open-iconic.woff │ │ │ │ │ │ └── open-iconic.svg │ │ │ │ │ └── css │ │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── FONT-LICENSE │ │ │ └── site.css │ │ └── js │ │ │ └── pdfAction.js │ ├── Assets │ │ └── Moder DOS 437.ttf │ ├── illustrations │ │ └── home.PNG │ ├── appsettings.json │ ├── appsettings.Development.json │ ├── Helpers │ │ └── Extensions.cs │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── NavMenu.razor │ │ ├── NavMenu.razor.css │ │ └── MainLayout.razor.css │ ├── _Imports.razor │ ├── Program.cs │ ├── App.razor │ ├── Blazor-PDF.csproj │ ├── Pages │ │ ├── Error.razor │ │ ├── _Host.cshtml │ │ └── Index.razor │ ├── Properties │ │ └── launchSettings.json │ └── PDF │ │ ├── page3.cs │ │ ├── page4.cs │ │ ├── page6.cs │ │ ├── PDFHeaderFooter.cs │ │ ├── page1.cs │ │ ├── page7.cs │ │ ├── report.cs │ │ ├── page2.cs │ │ └── page5.cs └── Blazor-PDF.sln ├── README.md └── .gitignore /Blazor-PDF/Output/text.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Output/text.pdf -------------------------------------------------------------------------------- /Blazor-PDF/Output/fonts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Output/fonts.pdf -------------------------------------------------------------------------------- /Blazor-PDF/Output/images.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Output/images.pdf -------------------------------------------------------------------------------- /Blazor-PDF/Output/tables.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Output/tables.pdf -------------------------------------------------------------------------------- /Blazor-PDF/Output/bookmarks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Output/bookmarks.pdf -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/Assets/Moder DOS 437.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/Assets/Moder DOS 437.ttf -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/illustrations/home.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/illustrations/home.PNG -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/wwwroot/images/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/wwwroot/images/Logo.png -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-PDF/master/Blazor-PDF/Blazor-PDF/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/Helpers/Extensions.cs: -------------------------------------------------------------------------------- 1 | namespace Blazor_PDF 2 | { 3 | public static class Extensions 4 | { 5 | public static float ToDpi(this float centimeter) 6 | { 7 | var inch = centimeter / 2.54; 8 | return (float)(inch * 72); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
6 | 7 |Sorry, there's nothing at this address.
10 |9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |
11 |12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |
-------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:52479", 7 | "sslPort": 44388 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Blazor-PDF": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/PDF/page3.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using iTextSharp.text; 3 | using iTextSharp.text.pdf; 4 | 5 | namespace Blazor_PDF.PDF 6 | { 7 | public class Page3 8 | { 9 | 10 | public static void PageImage(Document pdf, PdfWriter writer) 11 | { 12 | 13 | string image = $"{Directory.GetCurrentDirectory()}{@"\wwwroot\images\Logo.png"}"; 14 | Image img = Image.GetInstance(image); 15 | 16 | img.SetAbsolutePosition( 17 | (PageSize.A4.Width - img.ScaledWidth) / 2, 18 | (PageSize.A4.Height - img.ScaledHeight) / 2); 19 | 20 | pdf.Add(img); 21 | 22 | 23 | //PdfContentByte cb = writer.DirectContent; 24 | //cb.SetLineWidth(3f); 25 | //cb.MoveTo(50, 20); 26 | //cb.LineTo(20, 80); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Blazor-PDF/Blazor-PDF/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 7 | 8 |