-
Notifications
You must be signed in to change notification settings - Fork 15
refactor: update README to clarify library functionality and remove o… #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,14 @@ | ||
| # MiniPdf | ||
|
|
||
| A minimal, zero-dependency .NET library for generating PDF documents from text and Excel (.xlsx) files. | ||
| A minimal, zero-dependency .NET library for converting Excel (.xlsx) files to PDF. | ||
|
|
||
| > **Security**: All PRs are automatically reviewed by Copilot AI and Azure AI security scan for vulnerabilities. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Text-to-PDF** — Create PDF documents with positioned or auto-wrapped text | ||
| - **Excel-to-PDF** — Convert `.xlsx` files to paginated PDF with automatic column layout | ||
| - **Zero dependencies** — Uses only built-in .NET APIs (no external packages) | ||
| - **Valid PDF 1.4** output with Helvetica font | ||
| - **Valid PDF 1.4** output | ||
|
|
||
| ## Getting Started | ||
|
|
||
|
|
@@ -23,50 +22,8 @@ dotnet add package MiniPdf | |
|
|
||
| - .NET 9.0 or later | ||
|
|
||
| ### Build | ||
|
|
||
| ```bash | ||
| dotnet build | ||
| ``` | ||
|
|
||
| ### Run Tests | ||
|
|
||
| ```bash | ||
| dotnet test | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Simple Text PDF | ||
|
|
||
| ```csharp | ||
| using MiniPdf; | ||
|
|
||
| var doc = new PdfDocument(); | ||
| var page = doc.AddPage(); // US Letter size by default | ||
|
|
||
| page.AddText("Hello, World!", x: 50, y: 700, fontSize: 24); | ||
| page.AddText("This is MiniPdf.", x: 50, y: 670, fontSize: 12); | ||
|
|
||
| doc.Save("output.pdf"); | ||
| ``` | ||
|
|
||
| ### Auto-Wrapped Text | ||
|
|
||
| ```csharp | ||
| var doc = new PdfDocument(); | ||
| var page = doc.AddPage(); | ||
|
|
||
| var longText = "This is a long paragraph that will automatically wrap " | ||
| + "within the specified width boundary on the page."; | ||
|
|
||
| page.AddTextWrapped(longText, x: 50, y: 700, maxWidth: 500, fontSize: 12); | ||
|
|
||
| doc.Save("wrapped.pdf"); | ||
| ``` | ||
|
|
||
| ### Excel to PDF | ||
|
|
||
| ```csharp | ||
| using MiniPdf; | ||
|
|
||
|
Comment on lines
25
to
29
|
||
|
|
@@ -86,34 +43,6 @@ var doc = ExcelToPdfConverter.Convert("data.xlsx", options); | |
| doc.Save("data.pdf"); | ||
| ``` | ||
|
|
||
| ### Save to Stream or Byte Array | ||
|
|
||
| ```csharp | ||
| var doc = new PdfDocument(); | ||
| doc.AddPage().AddText("Hello", 50, 700); | ||
|
|
||
| // To stream | ||
| using var stream = new MemoryStream(); | ||
| doc.Save(stream); | ||
|
|
||
| // To byte array | ||
| byte[] bytes = doc.ToArray(); | ||
| ``` | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| MiniPdf.sln | ||
| ├── src/MiniPdf/ # Library | ||
| │ ├── PdfDocument.cs # Document model | ||
| │ ├── PdfPage.cs # Page with text placement | ||
| │ ├── PdfTextBlock.cs # Text block data | ||
| │ ├── PdfWriter.cs # PDF 1.4 binary writer | ||
| │ ├── ExcelReader.cs # .xlsx parser (ZIP + XML) | ||
| │ └── ExcelToPdfConverter.cs# Excel-to-PDF public API | ||
| └── tests/MiniPdf.Tests/ # xUnit tests | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| MIT | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README now positions MiniPdf as Excel-to-PDF only, but the NuGet package metadata still describes “generating PDF documents from text and Excel files” and includes
textin tags (src/MiniPdf/MiniPdf.csproj). Consider aligning the README wording with the packaged description/tags so users see consistent functionality across NuGet and GitHub.