Commit c3f1897e authored by Claes Sjofors's avatar Claes Sjofors

Plc editor print pdf, distance between multitext lines adjustement (refs #151)

parent 8517ac9f
......@@ -105,8 +105,18 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
int line_cnt = 0;
char *line = ((FlowNode *) node)->annotv[number];
char *s;
ctx->fdraw->get_text_extent( ctx, "Ag", 2, draw_type, text_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size));
switch ( ctx->current_print->type()) {
case print_eType_Pdf: {
ctx->fdraw->get_text_extent( ctx, "Ag", 2, draw_type, text_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size));
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62;
z_height *= k;
break;
}
default:
ctx->fdraw->get_text_extent( ctx, "Ag", 2, draw_type, text_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size));
}
z_h = ctx->print_zoom_factor / ctx->base_zoom_factor * z_height;
for ( s = ((FlowNode *) node)->annotv[number]; *s; s++)
{
......
......@@ -47,6 +47,7 @@ class FlowPdf : public FlowPrint {
public:
FlowPdf( char *filename, void *flow_ctx, int page_border, int *sts);
~FlowPdf();
int type() { return print_eType_Pdf;}
int print_page( double ll_x, double ll_y, double ur_x, double ur_y);
int rect( double x, double y, double width, double height, flow_eDrawType type, double idx, int highlight);
int filled_rect( double x, double y, double width, double height, flow_eDrawType type, double idx);
......
......@@ -40,11 +40,18 @@
#include <stdio.h>
#include "flow.h"
typedef enum {
print_eType__,
print_eType_Postscript,
print_eType_Pdf
} print_eType;
class FlowPrint {
public:
FlowPrint() {};
FlowPrint( char *filename, void *flow_ctx, int page_border, int *sts) {}
virtual ~FlowPrint() {}
virtual int type() { return 0;}
virtual int print_page( double ll_x, double ll_y, double ur_x, double ur_y) {return 1;}
virtual int rect( double x, double y, double width, double height, flow_eDrawType type, double idx, int highlight) { return 1;}
virtual int filled_rect( double x, double y, double width, double height, flow_eDrawType type, double idx) {return 1;}
......
......@@ -45,6 +45,7 @@ class FlowPscript : public FlowPrint {
public:
FlowPscript( char *filename, void *flow_ctx, int page_border, int *sts);
~FlowPscript();
int type() { return print_eType_Postscript;}
int print_page( double ll_x, double ll_y, double ur_x, double ur_y);
int rect( double x, double y, double width, double height, flow_eDrawType type, double idx, int highlight);
int filled_rect( double x, double y, double width, double height, flow_eDrawType type, double idx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment