Skip to content

Commit 7e567a6

Browse files
committed
Merge branch 'release/2.6.0'
2 parents dd202b5 + d3e11ba commit 7e567a6

File tree

66 files changed

+445
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+445
-196
lines changed

GotenbergSharpApiClient.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jaben/@EntryIndexedValue">True</s:Boolean>
2929
<s:Boolean x:Key="/Default/UserDictionary/Words/=Libre/@EntryIndexedValue">True</s:Boolean>
3030
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pdfs/@EntryIndexedValue">True</s:Boolean>
31+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Picas/@EntryIndexedValue">True</s:Boolean>
3132
<s:Boolean x:Key="/Default/UserDictionary/Words/=potm/@EntryIndexedValue">True</s:Boolean>
3233
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rpcc/@EntryIndexedValue">True</s:Boolean>
3334
<s:Boolean x:Key="/Default/UserDictionary/Words/=suppressions/@EntryIndexedValue">True</s:Boolean>

lib/Domain/Builders/BaseBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
1+
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
22
// and GotenbergSharpApiClient Contributors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");

lib/Domain/Builders/BaseChromiumBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
1+
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
22
// and GotenbergSharpApiClient Contributors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");

lib/Domain/Builders/BaseMergeBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
1+
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
22
// and GotenbergSharpApiClient Contributors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");

lib/Domain/Builders/Faceted/AssetBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
1+
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
22
// and GotenbergSharpApiClient Contributors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");

lib/Domain/Builders/Faceted/ConfigBuilder.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
1+
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
22
// and GotenbergSharpApiClient Contributors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,8 +13,6 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
17-
1816
namespace Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;
1917

2018
public sealed class ConfigBuilder
@@ -61,7 +59,6 @@ public ConfigBuilder ResultFileName(string resultFileName)
6159
{
6260
return this.SetResultFileName(resultFileName);
6361
}
64-
6562

6663
public ConfigBuilder SetTrace(string trace)
6764
{
@@ -73,7 +70,6 @@ public ConfigBuilder SetTrace(string trace)
7370
return this;
7471
}
7572

76-
7773
public ConfigBuilder AddWebhook(Action<WebhookBuilder> action)
7874
{
7975
if (action == null) throw new ArgumentNullException(nameof(action));
@@ -85,14 +81,12 @@ public ConfigBuilder AddWebhook(Action<WebhookBuilder> action)
8581
return this;
8682
}
8783

88-
8984
public ConfigBuilder SetWebhook(Webhook webhook)
9085
{
9186
this._requestConfig.Webhook = webhook ?? throw new ArgumentNullException(nameof(webhook));
9287

9388
return this;
9489
}
95-
9690

9791
[Obsolete("Renamed: Use SetWebhook instead.")]
9892
public ConfigBuilder AddWebhook(Webhook webhook)

lib/Domain/Builders/Faceted/HtmlConversionBehaviorBuilder.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,35 @@ public HtmlConversionBehaviorBuilder AddAdditionalHeaders(JObject extraHeaders)
102102
return this;
103103
}
104104

105+
/// <summary>
106+
/// Sets the document metadata.
107+
/// Not all metadata are writable. Consider taking a look at https://exiftool.org/TagNames/XMP.html#pdf for an (exhaustive?) list of available metadata.
108+
/// </summary>
109+
/// <param name="dictionary"></param>
110+
/// <returns></returns>
111+
public HtmlConversionBehaviorBuilder SetMetadata(IDictionary<string, object> dictionary)
112+
{
113+
SetMetadata(new JObject(dictionary));
114+
115+
return this;
116+
}
117+
118+
/// <summary>
119+
/// Sets the document metadata.
120+
/// Not all metadata are writable. Consider taking a look at https://exiftool.org/TagNames/XMP.html#pdf for an (exhaustive?) list of available metadata.
121+
/// </summary>
122+
/// <param name="metadata"></param>
123+
/// <returns></returns>
124+
125+
public HtmlConversionBehaviorBuilder SetMetadata(JObject metadata)
126+
{
127+
if (metadata == null) throw new InvalidOperationException("metadata is null");
128+
129+
this._htmlConversionBehaviors.MetaData = metadata;
130+
131+
return this;
132+
}
133+
105134
/// <summary>
106135
/// Tells gotenberg to return a 409 response if there are exceptions in the Chromium console.
107136
/// </summary>

lib/Domain/Builders/Faceted/Margins.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
1+
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
22
// and GotenbergSharpApiClient Contributors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,11 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
17-
1816
namespace Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;
1917

20-
2118
public enum Margins
2219
{
2320
None = 0,

lib/Domain/Builders/Faceted/PagePropertyBuilder.cs

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16+
using Gotenberg.Sharp.API.Client.Domain.Dimensions;
17+
1618
namespace Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;
1719

1820
public sealed class PagePropertyBuilder(PageProperties pageProperties)
@@ -56,83 +58,83 @@ public PagePropertyBuilder SetScale(double scale)
5658
return this;
5759
}
5860

61+
#region Obsolete Helper Functions
62+
5963
[Obsolete("Use SetPaperWidth")]
60-
public PagePropertyBuilder PaperWidth(double width)
61-
{
62-
this._pageProperties.PaperWidth = width;
63-
return this;
64-
}
64+
public PagePropertyBuilder PaperWidth(double width) => SetPaperWidth(width);
6565

6666
[Obsolete("Use SetPaperHeight")]
67-
public PagePropertyBuilder PaperHeight(double height)
68-
{
69-
this._pageProperties.PaperHeight = height;
70-
return this;
71-
}
67+
public PagePropertyBuilder PaperHeight(double height) => SetPaperHeight(height);
7268

7369
[Obsolete("Use SetMarginTop")]
74-
public PagePropertyBuilder MarginTop(double marginTop)
75-
{
76-
this._pageProperties.MarginTop = marginTop;
77-
return this;
78-
}
70+
public PagePropertyBuilder MarginTop(double marginTop) => SetMarginTop(marginTop);
7971

8072
[Obsolete("Use SetMarginBottom")]
81-
public PagePropertyBuilder MarginBottom(double marginBottom)
82-
{
83-
this._pageProperties.MarginBottom = marginBottom;
84-
return this;
85-
}
73+
public PagePropertyBuilder MarginBottom(double marginBottom) => SetMarginBottom(marginBottom);
8674

8775
[Obsolete("Use SetMarginLeft")]
88-
public PagePropertyBuilder MarginLeft(double marginLeft)
89-
{
90-
this._pageProperties.MarginLeft = marginLeft;
91-
return this;
92-
}
76+
public PagePropertyBuilder MarginLeft(double marginLeft) => SetMarginLeft(marginLeft);
9377

9478
[Obsolete("Use SetMarginRight")]
95-
public PagePropertyBuilder MarginRight(double marginRight)
96-
{
97-
this._pageProperties.MarginRight = marginRight;
98-
return this;
99-
}
79+
public PagePropertyBuilder MarginRight(double marginRight) => SetMarginRight(marginRight);
80+
81+
#endregion
82+
83+
#region Dimension Helpers for Inches
84+
85+
public PagePropertyBuilder SetPaperWidth(double widthInches) => SetPaperWidth(Dimension.FromInches(widthInches));
86+
87+
public PagePropertyBuilder SetPaperHeight(double heightInches) => SetPaperHeight(Dimension.FromInches(heightInches));
10088

101-
public PagePropertyBuilder SetPaperWidth(double width)
89+
public PagePropertyBuilder SetMarginTop(double marginTopInches) => SetMarginTop(Dimension.FromInches(marginTopInches));
90+
91+
public PagePropertyBuilder SetMarginBottom(double marginBottomInches) => SetMarginBottom(Dimension.FromInches(marginBottomInches));
92+
93+
public PagePropertyBuilder SetMarginLeft(double marginLeftInches) => SetMarginLeft(Dimension.FromInches(marginLeftInches));
94+
95+
public PagePropertyBuilder SetMarginRight(double marginRightInches) => SetMarginRight(Dimension.FromInches(marginRightInches));
96+
97+
#endregion
98+
99+
#region Dimension Helpers
100+
101+
public PagePropertyBuilder SetPaperWidth(Dimension width)
102102
{
103103
this._pageProperties.PaperWidth = width;
104104
return this;
105105
}
106106

107-
public PagePropertyBuilder SetPaperHeight(double height)
107+
public PagePropertyBuilder SetPaperHeight(Dimension height)
108108
{
109109
this._pageProperties.PaperHeight = height;
110110
return this;
111111
}
112112

113-
public PagePropertyBuilder SetMarginTop(double marginTop)
113+
public PagePropertyBuilder SetMarginTop(Dimension marginTop)
114114
{
115115
this._pageProperties.MarginTop = marginTop;
116116
return this;
117117
}
118118

119-
public PagePropertyBuilder SetMarginBottom(double marginBottom)
119+
public PagePropertyBuilder SetMarginBottom(Dimension marginBottom)
120120
{
121121
this._pageProperties.MarginBottom = marginBottom;
122122
return this;
123123
}
124124

125-
public PagePropertyBuilder SetMarginLeft(double marginLeft)
125+
public PagePropertyBuilder SetMarginLeft(Dimension marginLeft)
126126
{
127127
this._pageProperties.MarginLeft = marginLeft;
128128
return this;
129129
}
130130

131-
public PagePropertyBuilder SetMarginRight(double marginRight)
131+
public PagePropertyBuilder SetMarginRight(Dimension marginRight)
132132
{
133133
this._pageProperties.MarginRight = marginRight;
134134
return this;
135-
}
135+
}
136+
137+
#endregion
136138

137139
[Obsolete("Use SetLandscape()")]
138140
public PagePropertyBuilder LandScape(bool landscape = true)

lib/Domain/Builders/Faceted/PaperSizes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Chris Mohan, Jaben Cargman
1+
// Copyright 2019-2025 Chris Mohan, Jaben Cargman
22
// and GotenbergSharpApiClient Contributors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)