Render pdf
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
glib
|
||||
libadwaita
|
||||
libsoup_3
|
||||
poppler
|
||||
];
|
||||
};
|
||||
default = self.packages."${system}".allesapp;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user