Skip to content

Commit d3e11ba

Browse files
committed
Releasing v2.6
1 parent a6a7278 commit d3e11ba

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

lib/Domain/Dimensions/Dimension.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,37 @@
2020

2121
namespace Gotenberg.Sharp.API.Client.Domain.Dimensions;
2222

23+
/// <summary>
24+
/// Represents a numeric dimension and its corresponding unit type (e.g., points, pixels, inches, etc.).
25+
/// This class is primarily used to specify size values like page dimensions and margins.
26+
///
27+
/// <para>
28+
/// Example usage:
29+
/// <code>
30+
/// var dim1 = Dimension.Parse("200px"); // Parses from string
31+
/// var dim2 = Dimension.FromInches(8.5); // Creates a dimension in inches
32+
/// var dim3 = new Dimension(21.0, DimensionUnitType.Centimeters);
33+
/// </code>
34+
/// </para>
35+
///
36+
/// <para>
37+
/// Dimensions are immutable, meaning both <see cref="Value"/> and <see cref="UnitType"/>
38+
/// cannot be changed after instantiation. The class implements <see cref="IEquatable{Dimension}"/>
39+
/// to facilitate comparisons.
40+
/// </para>
41+
///
42+
/// <para>
43+
/// Supported unit strings when parsing are: "pt", "px", "in", "mm", "cm", and "pc".
44+
/// An <see cref="ArgumentException"/> will be thrown if an unsupported or malformed dimension string is provided.
45+
/// </para>
46+
///
47+
/// <para>
48+
/// Use the static convenience methods (e.g., <see cref="FromPoints(double)"/>,
49+
/// <see cref="FromPixels(double)"/>, <see cref="FromInches(double)"/>, etc.) to create instances
50+
/// in a specific unit type. The <see cref="Parse(string)"/> method can be used to parse a dimension
51+
/// string directly, ensuring validation of both the numeric value and the unit type.
52+
/// </para>
53+
/// </summary>
2354
public sealed class Dimension(double value, DimensionUnitType unitType) : IEquatable<Dimension?>
2455
{
2556
private static readonly Regex ValidDimensionRegex =

lib/Gotenberg.Sharp.Api.Client.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup Label="PackageInfo">
17-
<PackageVersion>2.5</PackageVersion>
17+
<PackageVersion>2.6</PackageVersion>
1818
<PackageTags>Gotenberg pdf C# ApiClient unoconv</PackageTags>
1919
<Description>
2020
C# API client for interacting with the Gotenberg v7 &amp; v8 micro-service's API, a docker-powered stateless API for converting &amp; merging HTML, Markdown and Office documents to PDF. The client supports a configurable Polly retry policy with exponential back-off for handling transient exceptions.
2121
</Description>
2222
<IncludeSymbols>True</IncludeSymbols>
2323
<PackageReleaseNotes>
24+
v2.6 - Updated office Extensions. Added document metadata support. Add Dimension.FromUnit() support for dimensional values.
2425
v2.5 - Renamed "Dimentions" to "PageProperties". Added support for 'GenerateDocumentOutline' and 'OmitBackground.'
2526
v2.4 - Updated dependencies. Removed Annotations. Add support for PDF/UA form field. Thank you for the PR @lennartb-!
2627
v2.3 - Added Convert Page 'ExportFormFields' flag support (Gotenberg v8.3+ Only). Added .NET 8 target.
@@ -41,6 +42,7 @@
4142
<EmbedUntrackedSources>true</EmbedUntrackedSources>
4243
<IncludeSymbols>true</IncludeSymbols>
4344
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
45+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
4446
</PropertyGroup>
4547

4648
<ItemGroup>

0 commit comments

Comments
 (0)