|
| 1 | +// Licensed to the .NET Foundation under one or more agreements. |
| 2 | +// The .NET Foundation licenses this file to you under the Apache 2.0 License |
| 3 | +// See the LICENSE file in the project root for more information. |
| 4 | +// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone |
| 5 | + |
| 6 | +namespace BootstrapBlazor.Components; |
| 7 | + |
| 8 | +/// <summary> |
| 9 | +/// 纸张规格配置类 |
| 10 | +/// </summary> |
| 11 | +[ExcludeFromCodeCoverage] |
| 12 | +public record PaperFormat |
| 13 | +{ |
| 14 | + /// <summary> |
| 15 | + /// |
| 16 | + /// </summary> |
| 17 | + public static PaperFormat Letter => new(8.5m, 11m); |
| 18 | + |
| 19 | + /// <summary> |
| 20 | + /// |
| 21 | + /// </summary> |
| 22 | + public static PaperFormat Legal => new(8.5m, 14m); |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// |
| 26 | + /// </summary> |
| 27 | + public static PaperFormat Tabloid => new(11m, 17m); |
| 28 | + |
| 29 | + /// <summary> |
| 30 | + /// |
| 31 | + /// </summary> |
| 32 | + public static PaperFormat Ledger => new(17m, 11m); |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// |
| 36 | + /// </summary> |
| 37 | + public static PaperFormat A0 => new(33.1102m, 46.811m); |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// |
| 41 | + /// </summary> |
| 42 | + public static PaperFormat A1 => new(23.3858m, 33.1102m); |
| 43 | + |
| 44 | + /// <summary> |
| 45 | + /// |
| 46 | + /// </summary> |
| 47 | + public static PaperFormat A2 => new(16.5354m, 23.3858m); |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// |
| 51 | + /// </summary> |
| 52 | + public static PaperFormat A3 => new(11.6929m, 16.5354m); |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// |
| 56 | + /// </summary> |
| 57 | + public static PaperFormat A4 => new(8.2677m, 11.6929m); |
| 58 | + |
| 59 | + /// <summary> |
| 60 | + /// |
| 61 | + /// </summary> |
| 62 | + public static PaperFormat A5 => new(5.8268m, 8.2677m); |
| 63 | + |
| 64 | + /// <summary> |
| 65 | + /// |
| 66 | + /// </summary> |
| 67 | + public static PaperFormat A6 => new(4.1339m, 5.8268m); |
| 68 | + |
| 69 | + /// <summary> |
| 70 | + /// |
| 71 | + /// </summary> |
| 72 | + public decimal Width { get; set; } |
| 73 | + |
| 74 | + /// <summary> |
| 75 | + /// |
| 76 | + /// </summary> |
| 77 | + public decimal Height { get; set; } |
| 78 | + |
| 79 | + /// <summary> |
| 80 | + /// |
| 81 | + /// </summary> |
| 82 | + /// <param name="width"></param> |
| 83 | + /// <param name="height"></param> |
| 84 | + public PaperFormat(decimal width, decimal height) |
| 85 | + { |
| 86 | + Width = width; |
| 87 | + Height = height; |
| 88 | + } |
| 89 | +} |
0 commit comments