Skip to content

Commit

Permalink
Merge branch 'release/2.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaben committed Feb 16, 2025
2 parents dd202b5 + d3e11ba commit 7e567a6
Show file tree
Hide file tree
Showing 66 changed files with 445 additions and 196 deletions.
1 change: 1 addition & 0 deletions GotenbergSharpApiClient.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jaben/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Libre/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pdfs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Picas/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=potm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rpcc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=suppressions/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/BaseBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/BaseChromiumBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/BaseMergeBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/Faceted/AssetBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
8 changes: 1 addition & 7 deletions lib/Domain/Builders/Faceted/ConfigBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,8 +13,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.



namespace Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;

public sealed class ConfigBuilder
Expand Down Expand Up @@ -61,7 +59,6 @@ public ConfigBuilder ResultFileName(string resultFileName)
{
return this.SetResultFileName(resultFileName);
}


public ConfigBuilder SetTrace(string trace)
{
Expand All @@ -73,7 +70,6 @@ public ConfigBuilder SetTrace(string trace)
return this;
}


public ConfigBuilder AddWebhook(Action<WebhookBuilder> action)
{
if (action == null) throw new ArgumentNullException(nameof(action));
Expand All @@ -85,14 +81,12 @@ public ConfigBuilder AddWebhook(Action<WebhookBuilder> action)
return this;
}


public ConfigBuilder SetWebhook(Webhook webhook)
{
this._requestConfig.Webhook = webhook ?? throw new ArgumentNullException(nameof(webhook));

return this;
}


[Obsolete("Renamed: Use SetWebhook instead.")]
public ConfigBuilder AddWebhook(Webhook webhook)
Expand Down
29 changes: 29 additions & 0 deletions lib/Domain/Builders/Faceted/HtmlConversionBehaviorBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,35 @@ public HtmlConversionBehaviorBuilder AddAdditionalHeaders(JObject extraHeaders)
return this;
}

/// <summary>
/// Sets the document metadata.
/// Not all metadata are writable. Consider taking a look at https://exiftool.org/TagNames/XMP.html#pdf for an (exhaustive?) list of available metadata.
/// </summary>
/// <param name="dictionary"></param>
/// <returns></returns>
public HtmlConversionBehaviorBuilder SetMetadata(IDictionary<string, object> dictionary)
{
SetMetadata(new JObject(dictionary));

return this;
}

/// <summary>
/// Sets the document metadata.
/// Not all metadata are writable. Consider taking a look at https://exiftool.org/TagNames/XMP.html#pdf for an (exhaustive?) list of available metadata.
/// </summary>
/// <param name="metadata"></param>
/// <returns></returns>

public HtmlConversionBehaviorBuilder SetMetadata(JObject metadata)
{
if (metadata == null) throw new InvalidOperationException("metadata is null");

this._htmlConversionBehaviors.MetaData = metadata;

return this;
}

/// <summary>
/// Tells gotenberg to return a 409 response if there are exceptions in the Chromium console.
/// </summary>
Expand Down
5 changes: 1 addition & 4 deletions lib/Domain/Builders/Faceted/Margins.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,11 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.



namespace Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;


public enum Margins
{
None = 0,
Expand Down
76 changes: 39 additions & 37 deletions lib/Domain/Builders/Faceted/PagePropertyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Gotenberg.Sharp.API.Client.Domain.Dimensions;

namespace Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;

public sealed class PagePropertyBuilder(PageProperties pageProperties)
Expand Down Expand Up @@ -56,83 +58,83 @@ public PagePropertyBuilder SetScale(double scale)
return this;
}

#region Obsolete Helper Functions

[Obsolete("Use SetPaperWidth")]
public PagePropertyBuilder PaperWidth(double width)
{
this._pageProperties.PaperWidth = width;
return this;
}
public PagePropertyBuilder PaperWidth(double width) => SetPaperWidth(width);

[Obsolete("Use SetPaperHeight")]
public PagePropertyBuilder PaperHeight(double height)
{
this._pageProperties.PaperHeight = height;
return this;
}
public PagePropertyBuilder PaperHeight(double height) => SetPaperHeight(height);

[Obsolete("Use SetMarginTop")]
public PagePropertyBuilder MarginTop(double marginTop)
{
this._pageProperties.MarginTop = marginTop;
return this;
}
public PagePropertyBuilder MarginTop(double marginTop) => SetMarginTop(marginTop);

[Obsolete("Use SetMarginBottom")]
public PagePropertyBuilder MarginBottom(double marginBottom)
{
this._pageProperties.MarginBottom = marginBottom;
return this;
}
public PagePropertyBuilder MarginBottom(double marginBottom) => SetMarginBottom(marginBottom);

[Obsolete("Use SetMarginLeft")]
public PagePropertyBuilder MarginLeft(double marginLeft)
{
this._pageProperties.MarginLeft = marginLeft;
return this;
}
public PagePropertyBuilder MarginLeft(double marginLeft) => SetMarginLeft(marginLeft);

[Obsolete("Use SetMarginRight")]
public PagePropertyBuilder MarginRight(double marginRight)
{
this._pageProperties.MarginRight = marginRight;
return this;
}
public PagePropertyBuilder MarginRight(double marginRight) => SetMarginRight(marginRight);

#endregion

#region Dimension Helpers for Inches

public PagePropertyBuilder SetPaperWidth(double widthInches) => SetPaperWidth(Dimension.FromInches(widthInches));

public PagePropertyBuilder SetPaperHeight(double heightInches) => SetPaperHeight(Dimension.FromInches(heightInches));

public PagePropertyBuilder SetPaperWidth(double width)
public PagePropertyBuilder SetMarginTop(double marginTopInches) => SetMarginTop(Dimension.FromInches(marginTopInches));

public PagePropertyBuilder SetMarginBottom(double marginBottomInches) => SetMarginBottom(Dimension.FromInches(marginBottomInches));

public PagePropertyBuilder SetMarginLeft(double marginLeftInches) => SetMarginLeft(Dimension.FromInches(marginLeftInches));

public PagePropertyBuilder SetMarginRight(double marginRightInches) => SetMarginRight(Dimension.FromInches(marginRightInches));

#endregion

#region Dimension Helpers

public PagePropertyBuilder SetPaperWidth(Dimension width)
{
this._pageProperties.PaperWidth = width;
return this;
}

public PagePropertyBuilder SetPaperHeight(double height)
public PagePropertyBuilder SetPaperHeight(Dimension height)
{
this._pageProperties.PaperHeight = height;
return this;
}

public PagePropertyBuilder SetMarginTop(double marginTop)
public PagePropertyBuilder SetMarginTop(Dimension marginTop)
{
this._pageProperties.MarginTop = marginTop;
return this;
}

public PagePropertyBuilder SetMarginBottom(double marginBottom)
public PagePropertyBuilder SetMarginBottom(Dimension marginBottom)
{
this._pageProperties.MarginBottom = marginBottom;
return this;
}

public PagePropertyBuilder SetMarginLeft(double marginLeft)
public PagePropertyBuilder SetMarginLeft(Dimension marginLeft)
{
this._pageProperties.MarginLeft = marginLeft;
return this;
}

public PagePropertyBuilder SetMarginRight(double marginRight)
public PagePropertyBuilder SetMarginRight(Dimension marginRight)
{
this._pageProperties.MarginRight = marginRight;
return this;
}
}

#endregion

[Obsolete("Use SetLandscape()")]
public PagePropertyBuilder LandScape(bool landscape = true)
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/Faceted/PaperSizes.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/Faceted/PdfFormats.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/Faceted/UrlExtraResourcesBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/Faceted/UrlHeaderFooterBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/Faceted/WebhookBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/MergeBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/MergeOfficeBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/PdfConversionBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/Builders/UrlRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion lib/Domain/ContentTypes/IResolveContentType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
// and GotenbergSharpApiClient Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

0 comments on commit 7e567a6

Please sign in to comment.