Render pdf
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
glib
|
glib
|
||||||
libadwaita
|
libadwaita
|
||||||
libsoup_3
|
libsoup_3
|
||||||
|
poppler
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
default = self.packages."${system}".allesapp;
|
default = self.packages."${system}".allesapp;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ allesapp_deps = [
|
|||||||
dependency('gtk4'),
|
dependency('gtk4'),
|
||||||
dependency('libadwaita-1', version: '>= 1.4'),
|
dependency('libadwaita-1', version: '>= 1.4'),
|
||||||
dependency('libsoup-3.0'),
|
dependency('libsoup-3.0'),
|
||||||
|
dependency('poppler-glib'),
|
||||||
]
|
]
|
||||||
|
|
||||||
allesapp_sources += gnome.compile_resources('allesapp-resources',
|
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) {
|
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(
|
cr.arc(
|
||||||
width / 2,
|
width / 2,
|
||||||
height / 2,
|
height / 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user