}
else
{
- /* TO DO */
+ /* TODO */
g_warning ("Not a valid RepTool print report format.");
}
}
xmlNode *cur = xmlDocGetRootElement (priv->xdoc);
if (cur == NULL)
{
- /* TO DO */
+ /* TODO */
g_warning ("Xml isn't a valid reptool print definition.");
return;
}
{
if (xmlStrcmp (cur->name, (const xmlChar *)"reptool_report") != 0)
{
- /* TO DO */
+ /* TODO */
g_warning ("Xml isn't a valid reptool print definition.");
return;
}
}
else
{
- /* TO DO */
+ /* TODO */
g_warning ("No pages found in xml.");
return;
}
fout = fopen (priv->output_filename, "w");
if (fout == NULL)
{
- /* TO DO */
+ /* TODO */
g_warning ("Unable to write to the output file.");
return;
}
fout = fopen (new_out_filename, "w");
if (fout == NULL)
{
- /* TO DO */
+ /* TODO */
g_warning ("Unable to write to the output file.");
return;
}
}
else
{
- /* TO DO */
+ /* TODO */
g_warning ("Cairo status not sucess: %d", cairo_status (priv->cr));
}
}
else
{
- /* TO DO */
+ /* TODO */
g_warning ("Cairo surface status not sucess.");
}
}
else
{
- /* TO DO */
+ /* TODO */
g_warning ("Page width or height cannot be zero.");
}
}
else
{
- /* TO DO */
+ /* TODO */
}
cur = cur->next;
break;
}
- /* TO DO */
+ /* TODO */
/* setting vertical alignment */
switch (align->v_align)
{
rpt_print_rotate (rpt_print, position, size, rotation->angle);
}
- /* TO DO */
+ /* TODO */
/*cairo_set_line_width (priv->cr, stroke.width);*/
cairo_rectangle (priv->cr,
rpt_common_value_to_points (priv->unit, position->x),
size = rpt_common_get_size (xnode);
stroke = rpt_common_get_stroke (xnode);
- /* TO DO */
+ /* TODO */
/* rotation */
if (position == NULL || size == NULL)
{
RptPrintPrivate *priv = RPT_PRINT_GET_PRIVATE (rpt_print);
+ gdouble to_add;
+
if (from_p == NULL || to_p == NULL)
{
g_warning ("Line node from point and to point are mandatories.");
return;
}
+ to_add = 0;
if (stroke != NULL)
{
- /* TO DO */
- /*cairo_set_line_width (priv->cr, stroke.width);*/
+ cairo_set_line_width (priv->cr, stroke->width);
+ if ((gint)stroke->width % 2 != 0)
+ {
+ to_add = 0.5;
+ }
+
if (stroke->color != NULL)
{
cairo_set_source_rgba (priv->cr, stroke->color->r, stroke->color->g, stroke->color->b, stroke->color->a);
cairo_move_to (priv->cr,
rpt_common_value_to_points (priv->unit, from_p->x),
- rpt_common_value_to_points (priv->unit, from_p->y));
+ rpt_common_value_to_points (priv->unit, from_p->y) + to_add);
cairo_line_to (priv->cr,
rpt_common_value_to_points (priv->unit, to_p->x),
- rpt_common_value_to_points (priv->unit, to_p->y));
+ rpt_common_value_to_points (priv->unit, to_p->y) + to_add);
cairo_stroke (priv->cr);
if (stroke != NULL && stroke->style != NULL)
<reptool>
<properties>
<unit-length>pt</unit-length>
- <output-type>pdf</output-type>
- <output-filename>rptreport.pdf</output-filename>
+ <output-type>png</output-type>
+ <output-filename>test.png</output-filename>
<copies>1</copies>
</properties>
<database>
- <provider>SQLite</provider>
- <connection-string>DB_DIR=.;DB_NAME=db_test.db</connection-string>
- <sql>SELECT * FROM articles ORDER BY name</sql>
+ <provider/>
+ <connection-string/>
+ <sql/>
</database>
<page width="595.000000" height="842.000000"/>
<report>
if (rptr != NULL)
{
+ rpt_report_set_output_type (rptr, RPT_OUTPUT_PNG);
+ rpt_report_set_output_filename (rptr, "test.png");
+
xmlDoc *report = rpt_report_get_xml (rptr);
xmlSaveFormatFile ("test_report.rpt", report, 2);
{
g_object_set (G_OBJECT (rptp), "path-relatives-to", "..", NULL);
- rpt_print_set_output_type (rptp, RPT_OUTPUT_PDF);
- rpt_print_set_output_filename (rptp, "test.pdf");
rpt_print_print (rptp, NULL);
}
}