41 capypdf::DocumentProperties opt;
45 g_error(
"Couldn't save PDF, no document root");
53 opt.set_author(author);
67 opt.set_creator(creator.c_str());
74 if (mod->get_param_bool(
"blurToBitmap")) {
75 pdf.set_filter_resolution(mod->get_param_int(
"resolution"));
77 if (mod->get_param_optiongroup_is(
"textToPath",
"paths")) {
79 }
else if (mod->get_param_optiongroup_is(
"textToPath",
"LaTeX")) {
80 pdf.set_text_enabled(
false);
89 auto drawing_id = pdf.add_group(group_ctx);
103 for (
auto const &svg_page : pm.getPages()) {
106 if (!svg_page->isBarePage()) {
107 pdf_page.set_pagebox(CAPY_BOX_BLEED, svg_page->getDocumentRect());
108 pdf_page.set_pagebox(CAPY_BOX_TRIM, svg_page->getDocumentRect());
109 pdf_page.set_pagebox(CAPY_BOX_ART, svg_page->getDocumentMargin());
112 if (
auto label = svg_page->label()) {
120 pdf_page.add_anchors_for_page(svg_page);
126 }
catch (std::exception &ex) {
127 g_warning(
"Couldn't save pdf file: %s", ex.what());
131#include "../clear-n_.h"
137 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
138 "<name>Portable Document Format</name>\n"
139 "<id>org.inkscape.output.pdf.capypdf</id>\n"
140 "<param name=\"PDFversion\" gui-text=\"" N_(
"Restrict to PDF version:")
"\" type=\"optiongroup\" appearance=\"combo\" >\n"
141 "<option value='PDF-1.7'>" N_(
"PDF 1.7")
"</option>\n"
144 "<param name=\"textToPath\" gui-text=\"" N_(
"Text output options:")
"\" type=\"optiongroup\" appearance=\"radio\">\n"
145 "<option value=\"embed\">" N_(
"Embed fonts")
"</option>\n"
146 "<option value=\"paths\">" N_(
"Convert text to paths")
"</option>\n"
147 "<option value=\"LaTeX\">" N_(
"Omit text in PDF and create LaTeX file")
"</option>\n"
149 "<param name=\"blurToBitmap\" gui-text=\"" N_(
"Rasterize filter effects")
"\" type=\"bool\">true</param>\n"
150 "<param name=\"resolution\" gui-text=\"" N_(
"Resolution for rasterization (dpi):")
"\" type=\"int\" min=\"1\" max=\"10000\">96</param>\n"
151 "<output is_exported='true' priority='4'>\n"
152 "<extension>.pdf</extension>\n"
153 "<mimetype>application/pdf</mimetype>\n"
154 "<filetypename>PDF (*.pdf)</filetypename>\n"
155 "<filetypetooltip>PDF File</filetypetooltip>\n"
157 "</inkscape-extension>", std::make_unique<PdfOutput>());
Extension * get(const gchar *key) const
This function looks up a Inkscape::Extension::Extension by using its unique id. It then returns a ref...
The object that is the basis for the Extension system.
bool check(Inkscape::Extension::Extension *module) override
Verify any dependencies.
void save(Inkscape::Extension::Output *mod, SPDocument *doc, char const *filename) override
Save the PDF file.
Generic failure for an undescribed reason.
void enablePages()
Enables multi page support by turning the document viewBox into the first page.
Typed SVG document implementation.
SPRoot * getRoot()
Returns our SPRoot.
Inkscape::PageManager & getPageManager()
Mini static library that contains the version of Inkscape.
Declaration of LaTeXTextRenderer, used for rendering the accompanying LaTeX file when exporting to PD...
bool latex_render_document_text_to_file(SPDocument *doc, gchar const *filename, bool pdflatex)
This method is called by the PDF, EPS and PS output extensions.
DB db
This is the actual database object.
void build_from_mem(gchar const *buffer, std::unique_ptr< Implementation::Implementation > in_imp)
Create a module from a buffer holding an XML description.
char const * version_string_without_revision
version string excluding revision and date
void convert_text_to_curves(SPDocument *)
Convert all text in the document to path, in-place.
struct rdf_work_entity_t * rdf_find_entity(gchar const *name)
Retrieves a known RDF/Work entity by name.
const gchar * rdf_get_work_entity(SPDocument const *doc, struct rdf_work_entity_t *entity)
Retrieves a known RDF/Work entity's contents from the document XML by name.
SPRoot: SVG <svg> implementation.