Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • evince evince
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 745
    • Issues 745
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • evinceevince
  • Issues
  • #1506
Closed
Open
Issue created Oct 20, 2020 by Mathieu Yahoi@Mathye

EvinceDev : File type document PDF (application/pdf) is not supported

Hello,

I wanted to play with gtk and evince but I get this error : File type document PDF (application/pdf) is not supported

However, when I open a pdf with Evince it works very well.

Here is the sample code I try to run with this which maybe wrong gcc pkg-config --cflags evince-view-3.0 gtk+-3.0 poppler-glib libxml-2.0-o example-0 test.cpkg-config --libs evince-view-3.0 gtk+-3.0 poppler-glib libxml-2.0`` :

#include <gtk/gtk.h>
#include <evince/3.0/evince-document.h>
#include <evince/3.0/evince-view.h>

int main(int argc, char *argv[]){
  GtkWidget *window;
  GError *error = NULL;
  GFile *file = g_file_new_for_uri ("file:///home/mathyew/Documents/sample-evince/dummy.pdf");
  EvDocument *document = ev_document_factory_get_document_for_gfile (file, EV_DOCUMENT_LOAD_FLAG_NONE, NULL, &error);
  if (error)
    {
      g_message ("Error : %s", error->message);
      return 0;
    }
  EvDocumentModel *docmodel = ev_document_model_new_with_document (EV_DOCUMENT(document));
  GtkWidget *view;

  gtk_init(&argc, &argv);
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  view = ev_view_new();
  ev_view_set_model(EV_VIEW(view), EV_DOCUMENT_MODEL(docmodel));
  gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
  gtk_widget_show_all(window);
  gtk_main();
  return 0;
}

I tested on debian buster with evince 3.30.2 and on ubuntu focal 3.36.7.

Also, I wanted to see the documentations here about libevdocument but I don't see the docs related to ev-document-factory or any exemple with compile flags (which would be very helpful) and if I click on the other links it's empty.....

If it's a miskate of mine, so I'm sorry to have bothering you

Cordially

Edited Oct 20, 2020 by Mathieu Yahoi
Assignee
Assign to
Time tracking