Skip to content

Commit d354f81

Browse files
committed
1.0.2
1 parent ab96e92 commit d354f81

3 files changed

Lines changed: 23 additions & 26 deletions

File tree

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Tests and Coverage
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ main, master ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ main, master ]
88

99
jobs:
1010
build-test:

CreatePdf.NET.Tests/DocumentTests.cs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -244,35 +244,32 @@ public void OcrOptions_PdfConverterPath_CanBeSet()
244244
[Fact]
245245
public void OcrOptions_PageSegmentationMode_CanBeSet()
246246
{
247-
var options = new OcrOptions();
248-
249-
options.PageSegmentationMode = 3;
250-
247+
var options = new OcrOptions
248+
{
249+
PageSegmentationMode = 3
250+
};
251+
251252
options.PageSegmentationMode.Should().Be(3);
252253
}
253254

254255
[Fact]
255-
public async Task SaveAndOcrAsync_UsesOcrOptions_IncludingOutputDirectory()
256+
public void WithOcrOptions_SetsCustomOptions_CapturesCorrectly()
256257
{
257-
var customOptions = new OcrOptions
258+
var doc = Pdf.Create();
259+
OcrOptions? capturedOptions = null;
260+
261+
doc.WithOcrOptions(opt =>
258262
{
259-
OutputDirectory = "custom-ocr-test",
260-
Dpi = 150,
261-
Language = "eng"
262-
};
263-
264-
var (path, text) = await Pdf.Create()
265-
.WithOcrOptions(opt =>
266-
{
267-
opt.OutputDirectory = customOptions.OutputDirectory;
268-
opt.Dpi = customOptions.Dpi;
269-
opt.Language = customOptions.Language;
270-
})
271-
.AddText("Test OCR")
272-
.SaveAndOcrAsync("test-ocr-options");
273-
274-
path.Should().NotBeNullOrEmpty();
275-
text.Should().Contain("Test OCR");
263+
opt.OutputDirectory = "custom-ocr-test";
264+
opt.Dpi = 150;
265+
opt.Language = "eng";
266+
capturedOptions = opt;
267+
});
268+
269+
capturedOptions.Should().NotBeNull();
270+
capturedOptions!.OutputDirectory.Should().Be("custom-ocr-test");
271+
capturedOptions.Dpi.Should().Be(150);
272+
capturedOptions.Language.Should().Be("eng");
276273
}
277274

278275
[Fact]

CreatePdf.NET/CreatePdf.NET.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77

88
<PackageId>CreatePdf.NET</PackageId>
9-
<Version>1.0.1</Version>
9+
<Version>1.0.2</Version>
1010
<Authors>Alexander Nachtmann</Authors>
1111
<Description>A simple, .NET library for PDF creation with text and bitmap rendering, plus optional OCR functionality for text extraction.</Description>
1212
<PackageTags>pdf;document;generation;lightweight;net10;preview;ocr</PackageTags>

0 commit comments

Comments
 (0)