mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-29 06:15:23 -04:00
Allow output to stdout
This commit is contained in:
parent
db6757ab91
commit
ef80d11beb
4 changed files with 33 additions and 13 deletions
10
backend/ps.c
10
backend/ps.c
|
@ -66,7 +66,11 @@ int ps_plot(struct zint_symbol *symbol)
|
|||
comp_offset = 0;
|
||||
addon_text_posn = 0.0;
|
||||
|
||||
feps = fopen(symbol->outfile, "w");
|
||||
if((symbol->output_options & BARCODE_STDOUT) != 0) {
|
||||
feps = stdout;
|
||||
} else {
|
||||
feps = fopen(symbol->outfile, "w");
|
||||
}
|
||||
if(feps == NULL) {
|
||||
strcpy(symbol->errtxt, "Could not open output file [C1]");
|
||||
return ERROR_FILE_ACCESS;
|
||||
|
@ -683,7 +687,7 @@ int ps_plot(struct zint_symbol *symbol)
|
|||
|
||||
|
||||
/* Put boundary bars or box around symbol */
|
||||
if ((symbol->output_options == BARCODE_BOX) || (symbol->output_options == BARCODE_BIND)) {
|
||||
if (((symbol->output_options & BARCODE_BOX) != 0) || ((symbol->output_options & BARCODE_BIND) != 0)) {
|
||||
if(symbol->symbology != BARCODE_CODABLOCKF) {
|
||||
/* boundary bars */
|
||||
fprintf(feps, "TE\n");
|
||||
|
@ -719,7 +723,7 @@ int ps_plot(struct zint_symbol *symbol)
|
|||
}
|
||||
}
|
||||
|
||||
if (symbol->output_options == BARCODE_BOX) {
|
||||
if((symbol->output_options & BARCODE_BOX) != 0) {
|
||||
/* side bars */
|
||||
fprintf(feps, "TE\n");
|
||||
fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue