Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbaarssen/PdfLibCore
PdfLib CORE is a fast PDF editing and reading library for modern .NET Core applications.
https://github.com/jbaarssen/PdfLibCore
Last synced: 27 days ago
JSON representation
PdfLib CORE is a fast PDF editing and reading library for modern .NET Core applications.
- Host: GitHub
- URL: https://github.com/jbaarssen/PdfLibCore
- Owner: jbaarssen
- License: mit
- Created: 2020-04-16T05:31:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-18T23:12:22.000Z (about 1 year ago)
- Last Synced: 2024-05-16T05:06:11.508Z (7 months ago)
- Language: C#
- Size: 49.5 MB
- Stars: 91
- Watchers: 7
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-avalonia - PdfLibCore - A fast PDF editing and reading library for modern .NET Core applications (Libraries & Extensions / Controls)
README
[![build](https://github.com/jbaarssen/PdfLibCore/actions/workflows/build-validation.yml/badge.svg)](https://github.com/jbaarssen/PdfLibCore/actions/workflows/build-validation.yml)
[![Release Package Version](https://github.com/jbaarssen/PdfLibCore/actions/workflows/nuget-publish.yml/badge.svg)](https://github.com/jbaarssen/PdfLibCore/actions/workflows/nuget-publish.yml)# PdfLibCore
PdfLib CORE is a fast PDF editing and reading library for modern .NET Core applications.## Example: Creating images from all pages in a PDF
Opening a PDF file can be done either through providing a filepath, a stream or a byte array..
```c#
var dpiX, dpiY = 300D;
var i = 0;using var pdfDocument = new PdfDocument(File.Open(<>, FileMode.Open));
foreach (var page in pdfDocument.Pages)
{
using var pdfPage = page;
var pageWidth = (int) (dpiX * pdfPage.Size.Width / 72);
var pageHeight = (int) (dpiY * pdfPage.Size.Height / 72);using var bitmap = new PdfiumBitmap(pageWidth, pageHeight, true);
pdfPage.Render(bitmap, PageOrientations.Normal, RenderingFlags.LcdText);
using var stream = bitmap.AsBmpStream(dpiX, dpiY);
// <<< do something with your stream...>>>
}
```## Notes
If you encounter errors in T4 generation on Windows VS, convert the line endings to CRLF and it will work.