Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Oaz/AvaloniaUI.PrintToPDF
Create PDF documents from Avalonia UI visuals
https://github.com/Oaz/AvaloniaUI.PrintToPDF
Last synced: 26 days ago
JSON representation
Create PDF documents from Avalonia UI visuals
- Host: GitHub
- URL: https://github.com/Oaz/AvaloniaUI.PrintToPDF
- Owner: Oaz
- License: mit
- Created: 2020-05-01T14:42:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T05:43:21.000Z (9 months ago)
- Last Synced: 2024-03-26T15:02:21.934Z (9 months ago)
- Language: C#
- Size: 3.34 MB
- Stars: 65
- Watchers: 7
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-avalonia - Print to PDF - An experimental library for creating PDFs from Avalonia UI visuals. (Libraries & Extensions / Controls)
README
# AvaloniaUI.PrintToPDF
This is an experimental lib to create PDF documents from [Avalonia UI](https://github.com/AvaloniaUI/Avalonia) visuals.
The PDF files are generated by the [Skia](https://github.com/mono/SkiaSharp) PDF backend.
## Demo
The demo app generates PDF files using some pages from the Avalonia Control Catalog.
Here is [a sample PDF file](https://github.com/Oaz/AvaloniaUI.PrintToPDF/raw/master/doc/sample.pdf).
## Usage
One of the simplest code is a full screenshot (in vector graphics) of a desktop app main window:
```C#
AvaloniaUI.PrintToPDF.Print.ToFile(
"app_screenshot.pdf",
(Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).MainWindow
);
```