pdf-input.cpp revision 8a735fa23cb61a2329248562d0aeac0e9dcf1b57
5858N/A#ifdef HAVE_CONFIG_H
3136N/A#ifdef HAVE_POPPLER
3136N/A#include "goo/GooString.h"
3136N/A#include "ErrorCodes.h"
3136N/A#include "GlobalParams.h"
3136N/A#ifdef HAVE_POPPLER_CAIRO
3136N/A#include "pdf-input.h"
3136N/A#include "svg-builder.h"
3136N/A#include "pdf-parser.h"
3136N/A#include "document-private.h"
3136N/A#include "dialogs/dialog-events.h"
#ifdef HAVE_POPPLER_CAIRO
for ( int i = 0 ; i < num_crop_choices ; i++ ) {
_labelPrecision = Gtk::manage(new class Gtk::Label(_("Precision of approximating gradient meshes:")));
_labelPrecisionWarning = Gtk::manage(new class Gtk::Label(_("<b>Note</b>: setting the precision too high may result in a large SVG file and slow performance.")));
this->set_modal(true);
this->set_resizable(true);
this->set_has_separator(true);
_previewArea->signal_expose_event().connect(sigc::mem_fun(*this, &PdfImportDialog::_onExposePreview));
_pageNumberSpin_adj->signal_value_changed().connect(sigc::mem_fun(*this, &PdfImportDialog::_onPageNumberChanged));
_fallbackPrecisionSlider_adj->signal_value_changed().connect(sigc::mem_fun(*this, &PdfImportDialog::_onPrecisionChanged));
_render_thumb = false;
#ifdef HAVE_POPPLER_CAIRO
_render_thumb = true;
if (doc_uri) {
#ifdef HAVE_POPPLER_CAIRO
if (_cairo_surface) {
if (_poppler_doc) {
if (_thumb_data) {
if (_render_thumb) {
delete _thumb_data;
show();
hide();
return TRUE;
return FALSE;
return _current_page;
for ( ; i < num_crop_choices ; i++ ) {
#ifdef HAVE_POPPLER_CAIRO
* Borrowed from libpoppler, from the file poppler-page.cc
unsigned char *data,
unsigned int *src;
for (y = 0; y < cairo_height; y++)
for (x = 0; x < cairo_width; x++)
src++;
if (!_thumb_data) {
if (_render_thumb) {
if (!thumb) {
if (_render_thumb) {
if (!back_pixmap) {
#ifdef HAVE_POPPLER_CAIRO
if (_render_thumb) {
if (!_render_thumb) {
if (_thumb_data) {
#ifdef HAVE_POPPLER_CAIRO
if (_thumb_data) {
delete _thumb_data;
if (_cairo_surface) {
if (!globalParams) {
// poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from glib gstdio.c
#ifndef WIN32
delete filename_goo;
return NULL;
PDFDoc *pdf_doc = new PDFDoc(wfilename, wcslen(wfilename), NULL, NULL, NULL); // TODO: Could ask for password
delete pdf_doc;
return NULL;
delete dlg;
delete pdf_doc;
return NULL;
if (dot) {
*dot = 0;
double crop_setting;
switch (crop_choice) {
double color_delta;
delete pdf_parser;
delete builder;
delete pdf_doc;
return doc;
#include "../clear-n_.h"
"<mimetype>application/pdf</mimetype>\n"
"<mimetype>image/x-adobe-illustrator</mimetype>\n"