Skip to content

Add input validation, PDF metadata support, NuGet packaging, and documentation#37

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/resolve-issue-status
Draft

Add input validation, PDF metadata support, NuGet packaging, and documentation#37
Copilot wants to merge 5 commits intomainfrom
copilot/resolve-issue-status

Conversation

Copy link

Copilot AI commented Feb 22, 2026

Addresses several open issues to round out the v0.1.0 feature set: argument validation on public APIs, PDF document metadata, improved NuGet package metadata, and comprehensive documentation.

Input validation (#26)

  • All public methods now validate arguments using .NET 9 throw helpers (ArgumentNullException.ThrowIfNull, ArgumentException.ThrowIfNullOrEmpty, ArgumentOutOfRangeException.ThrowIfLessThanOrEqual)
  • Covers PdfDocument, PdfPage, and ExcelToPdfConverter entry points

PDF metadata (#25)

  • PdfDocument exposes Title, Author, Subject, Keywords, Creator properties
  • PdfWriter conditionally emits a PDF Info dictionary when any metadata is set, referenced in the trailer
var doc = new PdfDocument { Title = "Report", Author = "Jane" };
doc.AddPage().AddText("Hello", 50, 700);
doc.Save("report.pdf"); // PDF contains /Info dictionary

NuGet packaging (#5, #35)

  • Added Authors, RepositoryUrl, RepositoryType, PackageProjectUrl, PackageReadmeFile to .csproj
  • README bundled in package via <None Include="../../README.md" Pack="true" />

Documentation (#1, #7)

  • README: added text color and metadata usage examples, supported feature matrix table, install instructions
  • New ROADMAP.md tracking v0.1.0 (done), v0.2.0/v0.3.0 (planned)

Tests

  • 17 new tests (50 total) covering argument validation and metadata output
Original prompt

finish issue


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 4 commits February 22, 2026 13:30
- Add argument validation to PdfDocument, PdfPage, and ExcelToPdfConverter
  using .NET 9 throw helpers (ArgumentNullException.ThrowIfNull,
  ArgumentException.ThrowIfNullOrEmpty, ArgumentOutOfRangeException.ThrowIfLessThanOrEqual)
- Add Title, Author, Subject, Keywords, Creator metadata properties to PdfDocument
- Write PDF Info dictionary in PdfWriter when any metadata property is set

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rter

Add 12 new tests to PdfDocumentTests.cs covering:
- AddPage argument validation (zero width, negative height)
- Save argument validation (null/empty file path, null stream)
- AddText/AddTextWrapped argument validation (null text, zero maxWidth)
- Metadata properties (title, all properties, no metadata, special chars)

Add 5 new tests to ExcelToPdfConverterTests.cs covering:
- Convert argument validation (null/empty path, null stream)
- ConvertToFile argument validation (null excel path, null pdf path)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…P.md

Co-authored-by: shps951023 <12729184+shps951023@users.noreply.github.com>
Co-authored-by: shps951023 <12729184+shps951023@users.noreply.github.com>
Copilot AI changed the title [WIP] Finish work on issue resolution Add input validation, PDF metadata support, NuGet packaging, and documentation Feb 22, 2026
Copilot AI requested a review from shps951023 February 22, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants