Render pdf

This commit is contained in:
2025-11-23 21:04:19 +01:00
parent 70320e5884
commit a4023a5023
3 changed files with 7 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
glib
libadwaita
libsoup_3
poppler
];
};
default = self.packages."${system}".allesapp;

View File

@@ -9,6 +9,7 @@ allesapp_deps = [
dependency('gtk4'),
dependency('libadwaita-1', version: '>= 1.4'),
dependency('libsoup-3.0'),
dependency('poppler-glib'),
]
allesapp_sources += gnome.compile_resources('allesapp-resources',

View File

@@ -37,6 +37,11 @@ public class Allesapp.Window : Adw.ApplicationWindow {
}
public void draw_pdf (Gtk.DrawingArea drawing_area, Cairo.Context cr, int width, int height) {
var uri = File.new_for_commandline_arg("test.pdf").get_uri();
var document = new Poppler.Document.from_file (uri, null);
var page = document.get_page (0);
page.render (cr);
cr.arc(
width / 2,
height / 2,