/// <summary> /// Loads the pdf. This is the function you call when you want to display a pdf. /// </summary> /// <param name='pdfFileName'> /// Pdf file name. /// </param> private void LoadPdf(Uri pdfFileName) { pdf = Poppler.Document.NewFromFile(pdfFileName.AbsoluteUri, ""); PageCountLabel.Text = @"/" + (pdf.NPages - 1).ToString(); CurrentPage.Value = 0; CurrentPage.Adjustment.Upper = pdf.NPages - 1; foreach (Gtk.Widget w in vboxImages.AllChildren) { vboxImages.Remove(w); } for (this.pageIndex = 0; this.pageIndex < pdf.NPages; this.pageIndex++) { Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, false, 8, 0, 0); Gtk.Image img = new Gtk.Image(); img.Pixbuf = pixbuf; img.Name = "image1"; //vboxImages.Add (img); RenderPage(ref img); } this.ShowAll(); }
/// <summary> /// Loads the pdf. This is the function you call when you want to display a pdf. /// </summary> /// <param name='pdfFileName'> /// Pdf file name. /// </param> public void LoadPdf(string pdfFileName) { pdf = Poppler.Document.NewFromFile(pdfFileName, ""); PageCountLabel.Text = @"/" + (pdf.NPages - 1).ToString(); CurrentPage.Value = 0; CurrentPage.Adjustment.Upper = pdf.NPages-1; foreach (Gtk.Widget w in vboxImages.AllChildren) { vboxImages.Remove(w); } for (this.pageIndex = 0; this.pageIndex < pdf.NPages; this.pageIndex++) { Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (Gdk.Colorspace.Rgb, false, 8, 0, 0); Gtk.Image img = new Gtk.Image(); img.Pixbuf = pixbuf; img.Name = "image1"; //vboxImages.Add (img); RenderPage(ref img); } this.ShowAll(); }
public FontInfo(Poppler.Document document) : base(IntPtr.Zero) { if (GetType() != typeof(FontInfo)) { throw new InvalidOperationException("Can't override this constructor."); } Raw = poppler_font_info_new(document == null ? IntPtr.Zero : document.Handle); }
public PSFile(Poppler.Document document, string filename, int first_page, int n_pages) : base(IntPtr.Zero) { if (GetType() != typeof(PSFile)) { throw new InvalidOperationException("Can't override this constructor."); } IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup(filename); Raw = poppler_ps_file_new(document == null ? IntPtr.Zero : document.Handle, native_filename, first_page, n_pages); GLib.Marshaller.Free(native_filename); }
void ExpireThumbnails(IEnumerable <Page> update_pages) { if (poppler_doc != null) { poppler_doc.Dispose(); poppler_doc = null; } foreach (var page in update_pages) { page.SurfaceDirty = true; } }
public LayersIter(Poppler.Document document) { Raw = poppler_layers_iter_new(document == null ? IntPtr.Zero : document.Handle); }
public IndexIter(Poppler.Document document) { Raw = poppler_index_iter_new(document == null ? IntPtr.Zero : document.Handle); }