pdf-input.cpp revision cd20f44794b5102a82bd3f2344504158e28faa92
/** \file
* Native PDF import using libpoppler.
*
* Authors:
* miklos erdelyi
*
* Copyright (C) 2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_POPPLER
#include "goo/GooString.h"
#include "ErrorCodes.h"
#include "GlobalParams.h"
#include "PDFDoc.h"
#include "Page.h"
#include "Catalog.h"
#include "pdf-input.h"
#include "svg-builder.h"
#include "pdf-parser.h"
#include "document-private.h"
namespace Inkscape {
namespace Extension {
namespace Internal {
/**
* Parses the first page of the given PDF document using PdfParser.
*/
// Initialize the globalParams variable for poppler
if (!globalParams) {
globalParams = new GlobalParams();
}
delete pdf_doc;
if (error == errEncrypted) {
g_message("Document is encrypted.");
} else {
}
return NULL;
}
// Get needed page
int page_num = 1;
// Create builder and parser
// Parse the document structure
}
// Cleanup
delete pdf_parser;
delete builder;
delete pdf_doc;
// Restore undo
return doc;
}
#include "../clear-n_.h"
void
"<inkscape-extension>\n"
"<name>PDF Input</name>\n"
"<id>org.inkscape.input.pdf</id>\n"
"<input>\n"
"<extension>.pdf</extension>\n"
"<mimetype>application/pdf</mimetype>\n"
"<filetypename>Adobe PDF (*.pdf) [native]</filetypename>\n"
"<filetypetooltip>PDF Document</filetypetooltip>\n"
"</input>\n"
"</inkscape-extension>", new PdfInput());
} // init
} } } /* namespace Inkscape, Extension, Implementation */
#endif /* HAVE_POPPLER */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :