Logo Search packages:      
Sourcecode: inkscape version File versions

static void do_export_ps ( SPDocument doc,
gchar const *  uri,
char const *  mime 
) [static]

Perform an export of either PS or EPS.

Parameters:
doc Document to export.
uri URI to export to.
mime MIME type to export as.

Definition at line 1110 of file main.cpp.

{
    Inkscape::Extension::DB::OutputList o;
    Inkscape::Extension::db.get_output_list(o);
    Inkscape::Extension::DB::OutputList::const_iterator i = o.begin();
    while (i != o.end() && strcmp( (*i)->get_mimetype(), mime ) != 0) {
        i++;
    }

    if (i == o.end())
    {
        g_warning ("Could not find an extension to export this file.");
        return;
    }

    bool old_text_to_path = false;
    bool old_font_embedded = false;
    bool old_bbox_page = false;

    try {
        old_text_to_path = (*i)->get_param_bool("textToPath");
        (*i)->set_param_bool("textToPath", sp_export_text_to_path);
    }
    catch (...) {
        g_warning ("Could not set export-text-to-path option for this export.");
    }

    try {
        old_font_embedded = (*i)->get_param_bool("fontEmbedded");
        (*i)->set_param_bool("fontEmbedded", sp_export_font);
    }
    catch (...) {
        g_warning ("Could not set export-font option for this export.");
    }

    try {
        old_bbox_page = (*i)->get_param_bool("pageBoundingBox");
        (*i)->set_param_bool("pageBoundingBox", sp_export_bbox_page);
    }
    catch (...) {
        g_warning ("Could not set export-bbox-page option for this export.");
    }

    (*i)->save(doc, uri);

    try {
        (*i)->set_param_bool("textToPath", old_text_to_path);
        (*i)->set_param_bool("fontEmbedded", old_font_embedded);
        (*i)->set_param_bool("pageBoundingBox", old_bbox_page);
    }
    catch (...) {

    }
}


Generated by  Doxygen 1.6.0   Back to index