Skip to content

Adding text to pdf file#19

Merged
artemkdr merged 7 commits into
mainfrom
pdf-service-working-branch
Jul 3, 2025
Merged

Adding text to pdf file#19
artemkdr merged 7 commits into
mainfrom
pdf-service-working-branch

Conversation

@Kate797979

Copy link
Copy Markdown
Collaborator

Adding text to pdf file + tests + some bug fixed

@Kate797979 Kate797979 requested a review from artemkdr June 26, 2025 09:42
@artemkdr artemkdr requested a review from Copilot June 27, 2025 13:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for inserting styled text into PDFs and returns available font lists in the PDF service.

  • Extends ReadFields to include available font keys and updates IPdfService, controller, and response model.
  • Implements FontsHelper to discover registered, document-embedded, and resource folder fonts.
  • Adds text styling (size, color, alignment, bold/italic/underline) in Fill and corresponding tests.

Reviewed Changes

Copilot reviewed 13 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
API/appsettings.json Added Resources:Fonts section and fixed trailing comma
API/Services/ITextPdfService/PdfService.cs Updated ReadFields/Fill to support fonts and text styling; added FontsHelper
API/Services/IPdfService.cs Changed ReadFields signature to return font list
API/Program.cs Removed unused using Microsoft.OpenApi.Models;
API/Models/Responses/FieldsResponse.cs Added Fonts property
API/Models/Requests/FillRequest.cs Added TextStyle, FontStyle, and alignment enums
API/Converters/FieldValueJsonConverter.cs Extended converter to handle int, double, bool
API/Converters/EnumJsonConverter.cs Introduced generic enum JSON converter
API/Controllers/PdfController.cs Adapted ReadFields to include fonts in response
API.Tests/... Added functional tests for fonts and text insertion; updated converter tests
Comments suppressed due to low confidence (1)

API/Services/ITextPdfService/PdfService.cs:308

  • FontsHelper scans resource directories and the document for every instance. Consider caching font discovery globally or reusing a singleton helper to avoid repeated I/O and improve performance.
class FontsHelper

Comment thread API/Services/ITextPdfService/PdfService.cs Outdated
Comment thread API/Services/ITextPdfService/PdfService.cs Outdated
Comment thread API/Services/ITextPdfService/PdfService.cs Outdated
artemkdr and others added 3 commits June 27, 2025 15:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@artemkdr artemkdr merged commit 89f612e into main Jul 3, 2025
1 check passed
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.

3 participants