Skip to content

Commit ab96e92

Browse files
committed
1.0.1
1 parent adec031 commit ab96e92

4 files changed

Lines changed: 57 additions & 2 deletions

File tree

CreatePdf.NET/CreatePdf.NET.csproj

Lines changed: 2 additions & 2 deletions
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.0</Version>
9+
<Version>1.0.1</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>
@@ -19,7 +19,7 @@
1919
<IncludeSymbols>true</IncludeSymbols>
2020
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2121
<GenerateDocumentationFile>true</GenerateDocumentationFile>
22-
<NoWarn>CS1591</NoWarn>
22+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2323
</PropertyGroup>
2424

2525
<ItemGroup>

CreatePdf.NET/Public/Document.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ public sealed class Document
1414
private OcrOptions? _ocrOptions;
1515
private readonly List<IContent> _contents = [];
1616

17+
/// <summary>
18+
/// Initializes a new instance of the <see cref="Document"/> class with the specified background color.
19+
/// </summary>
20+
/// <param name="background">The background color for the PDF document.</param>
1721
public Document(Dye background)
1822
{
1923
_background = background;
@@ -112,16 +116,34 @@ public Document AddText(
112116
return this;
113117
}
114118

119+
/// <summary>
120+
/// Adds text to the document with the specified size.
121+
/// </summary>
122+
/// <param name="text">The text to add.</param>
123+
/// <param name="size">The size of the text.</param>
124+
/// <returns>The document instance for chaining.</returns>
115125
public Document AddText(string text, TextSize size)
116126
{
117127
return AddText(text, null, size);
118128
}
119129

130+
/// <summary>
131+
/// Adds text to the document with the specified color.
132+
/// </summary>
133+
/// <param name="text">The text to add.</param>
134+
/// <param name="color">The color of the text.</param>
135+
/// <returns>The document instance for chaining.</returns>
120136
public Document AddText(string text, Dye color)
121137
{
122138
return AddText(text, color, null);
123139
}
124140

141+
/// <summary>
142+
/// Adds text to the document with the specified alignment.
143+
/// </summary>
144+
/// <param name="text">The text to add.</param>
145+
/// <param name="alignment">The alignment of the text.</param>
146+
/// <returns>The document instance for chaining.</returns>
125147
public Document AddText(string text, TextAlignment alignment)
126148
{
127149
return AddText(text, null, null, alignment);
@@ -159,21 +181,47 @@ public Document AddPixelText(
159181
return this;
160182
}
161183

184+
/// <summary>
185+
/// Adds pixel text with specified text color and size.
186+
/// </summary>
187+
/// <param name="text">The text to render as pixels.</param>
188+
/// <param name="textColor">The color of the text.</param>
189+
/// <param name="size">The size of the pixel text.</param>
190+
/// <returns>The document instance for chaining.</returns>
162191
public Document AddPixelText(string text, Dye textColor, PixelTextSize size)
163192
{
164193
return AddPixelText(text, textColor, null, size);
165194
}
166195

196+
/// <summary>
197+
/// Adds pixel text with specified size.
198+
/// </summary>
199+
/// <param name="text">The text to render as pixels.</param>
200+
/// <param name="size">The size of the pixel text.</param>
201+
/// <returns>The document instance for chaining.</returns>
167202
public Document AddPixelText(string text, PixelTextSize size)
168203
{
169204
return AddPixelText(text, null, null, size);
170205
}
171206

207+
/// <summary>
208+
/// Adds pixel text with specified text color.
209+
/// </summary>
210+
/// <param name="text">The text to render as pixels.</param>
211+
/// <param name="textColor">The color of the text.</param>
212+
/// <returns>The document instance for chaining.</returns>
172213
public Document AddPixelText(string text, Dye textColor)
173214
{
174215
return AddPixelText(text, textColor, null);
175216
}
176217

218+
/// <summary>
219+
/// Adds pixel text with specified text and background colors.
220+
/// </summary>
221+
/// <param name="text">The text to render as pixels.</param>
222+
/// <param name="textColor">The color of the text.</param>
223+
/// <param name="backgroundColor">The background color.</param>
224+
/// <returns>The document instance for chaining.</returns>
177225
public Document AddPixelText(string text, Dye textColor, Dye backgroundColor)
178226
{
179227
return AddPixelText(text, textColor, backgroundColor, null);

CreatePdf.NET/Public/Pdf.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace CreatePdf.NET.Public;
22

3+
/// <summary>
4+
/// Provides factory methods for creating PDF documents.
5+
/// </summary>
36
public static class Pdf
47
{
58
/// <summary>

CreatePdf.NET/Public/PixelTextSize.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ namespace CreatePdf.NET.Public;
88
[ExcludeFromCodeCoverage]
99
public readonly struct PixelTextSize
1010
{
11+
/// <summary>
12+
/// Gets the scale multiplier for pixel text rendering.
13+
/// </summary>
14+
/// <value>The scale factor (1-5) that determines the final pixel size.</value>
1115
public int Value { get; }
1216

1317
private PixelTextSize(int value)

0 commit comments

Comments
 (0)