Skip to content

Commit 7d03f8d

Browse files
committed
Merge branch 'release/2.3.0'
2 parents 8e06c39 + 9c67286 commit 7d03f8d

8 files changed

Lines changed: 59 additions & 7 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ jobs:
1515
- name: Setup Dotnet
1616
uses: actions/setup-dotnet@v1
1717
with:
18-
dotnet-version: 7.0.405
18+
dotnet-version: 8.0.x
1919

2020
- name: Install GitVersion
21-
uses: gittools/actions/gitversion/setup@v0.9.7
21+
uses: gittools/actions/gitversion/setup@v1.1.1
2222
with:
2323
versionSpec: '5.x'
2424

2525
- name: GitVersion
2626
id: gitversion
27-
uses: gittools/actions/gitversion/execute@v0.9.7
27+
uses: gittools/actions/gitversion/execute@v1.1.1
2828
with:
2929
useConfigFile: true
3030

lib/Domain/Builders/Faceted/HtmlConversionBehaviorBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public HtmlConversionBehaviorBuilder SetBrowserWaitExpression(string expression)
7474
/// <returns></returns>
7575
/// <exception cref="InvalidOperationException"></exception>
7676
[PublicAPI]
77+
[Obsolete("Deprecated in Gotenberg v8+")]
7778
public HtmlConversionBehaviorBuilder SetUserAgent(string userAgent)
7879
{
7980
if (userAgent.IsNotSet()) throw new InvalidOperationException("headerName is not set");

lib/Domain/Builders/MergeOfficeBuilder.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Gotenberg.Sharp.API.Client.Domain.Builders;
2323
/// <summary>
2424
/// Any non office files sent in are just ignored.
2525
/// A nice surprise: Gotenberg/Chrome will merge in all sheets within a multi-sheet excel workbook.
26-
/// If you send in a csv file but with an xlsx extension, it will merge it in as text.
26+
/// If you send in a csv file but with a xlsx extension, it will merge it in as text.
2727
/// </summary>
2828
public sealed class MergeOfficeBuilder : BaseMergeBuilder<MergeOfficeRequest, MergeOfficeBuilder>
2929
{
@@ -39,12 +39,33 @@ public MergeOfficeBuilder PrintAsLandscape()
3939
return this;
4040
}
4141

42+
/// <summary>
43+
/// If provided, the API will return a pdf containing the pages in the specified range.
44+
/// </summary>
45+
/// <remarks>
46+
/// The format is the same as the one from the print options of Google Chrome, e.g. 1-5,8,11-13.
47+
/// This may move...
48+
/// </remarks>
4249
[PublicAPI]
4350
public MergeOfficeBuilder SetPageRanges(string pageRanges)
4451
{
4552
this.Request.PageRanges = pageRanges;
4653
return this;
4754
}
55+
56+
/// <summary>
57+
/// Set whether to export the form fields or to use the inputted/selected
58+
/// content of the fields. Default is TRUE.
59+
/// </summary>
60+
/// <remarks>
61+
/// Gotenberg v8.3+
62+
/// </remarks>
63+
[PublicAPI]
64+
public MergeOfficeBuilder SetExportFormFields(bool exportFormFields)
65+
{
66+
this.Request.ExportFormFields = exportFormFields;
67+
return this;
68+
}
4869

4970
/// <summary>
5071
/// This tells gotenberg to use unoconv to perform the conversion.

lib/Domain/Requests/Facets/RequestConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void Validate()
7979
/// <remarks>
8080
/// Attention: this feature does not work if the form field webHookURL is given.
8181
/// </remarks>
82-
// Not sure this is useful with the way this client is used, although.. maybe Webhook requests honor it?
82+
// Not sure if this is useful with the way this client is used, although.. maybe Webhook requests honor it?
8383
public string? ResultFileName { get; set; }
8484

8585
/// <summary>

lib/Domain/Requests/MergeOfficeRequest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,23 @@ protected override string ApiPath
3535

3636
public bool PrintAsLandscape { get; set; }
3737

38+
/// <summary>
39+
/// If provided, the API will return a pdf containing the pages in the specified range.
40+
/// </summary>
41+
/// <remarks>
42+
/// The format is the same as the one from the print options of Google Chrome, e.g. 1-5,8,11-13.
43+
/// This may move...
44+
/// </remarks>
3845
public string? PageRanges { get; set; }
46+
47+
/// <summary>
48+
/// Set whether to export the form fields or to use the inputted/selected
49+
/// content of the fields. Default is TRUE.
50+
/// </summary>
51+
/// <remarks>
52+
/// Gotenberg v8.3+
53+
/// </remarks>
54+
public bool? ExportFormFields { get; set; }
3955

4056
/// <summary>
4157
/// Tells gotenberg to perform the conversion with unoconv.

lib/Extensions/MergeOfficeRequestExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ internal static IEnumerable<HttpContent> PropertiesToHttpContent(this MergeOffic
3434
yield return BuildRequestBase.CreateFormDataItem(
3535
request.PageRanges,
3636
Constants.Gotenberg.LibreOffice.Routes.Convert.PageRanges);
37+
38+
if (request.ExportFormFields.HasValue)
39+
yield return BuildRequestBase.CreateFormDataItem(
40+
request.ExportFormFields.Value,
41+
Constants.Gotenberg.LibreOffice.Routes.Convert.ExportFormFields);
3742

3843
if (!request.UseNativePdfFormat && request.Format == default) yield break;
3944

lib/Gotenberg.Sharp.Api.Client.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<AssemblyName>Gotenberg.Sharp.API.Client</AssemblyName>
77
<RootNamespace>Gotenberg.Sharp.API.Client</RootNamespace>
@@ -13,13 +13,14 @@
1313
</PropertyGroup>
1414

1515
<PropertyGroup Label="PackageInfo">
16-
<PackageVersion>2.2.2</PackageVersion>
16+
<PackageVersion>2.3.0</PackageVersion>
1717
<PackageTags>Gotenberg pdf C# ApiClient unoconv</PackageTags>
1818
<Description>
1919
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.
2020
</Description>
2121
<IncludeSymbols>True</IncludeSymbols>
2222
<PackageReleaseNotes>
23+
v2.3 - Added Convert Page 'ExportFormFields' flag support (Gotenberg v8.3+ Only). Added .NET 8 target.
2324
v2.2 - Added 'SkipNetworkIdle' flag support (Gotenberg v8+ Only). Thank you for the PR @guillaumeduhr! Upgraded nugets to latest. Added .NET 7.0 support.
2425
v2.1 - Added Trace Support. Fixed extra webhook header support.
2526
v2.0 - Upgraded to support Gotenberg v7 -- this version no longer works with Gotenberg v6.
@@ -84,6 +85,12 @@
8485
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.0" />
8586
</ItemGroup>
8687

88+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
89+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
90+
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
91+
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.4" />
92+
</ItemGroup>
93+
8794
<ItemGroup>
8895
<None Include="..\README.md" Pack="true" PackagePath="\" />
8996
<None Include="..\.editorconfig" Link=".editorconfig" />

lib/Infrastructure/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public static class Convert
9999
public const string Landscape = CrossCutting.Landscape;
100100

101101
public const string PageRanges = CrossCutting.PageRanges;
102+
103+
public const string ExportFormFields = "exportFormFields";
102104

103105
public const string NativePdfFormat = "nativePdfFormat";
104106

0 commit comments

Comments
 (0)