lib_test2.c
来自「PDF417编码的算法的源程序」· C语言 代码 · 共 80 行
C
80 行
#include <stdio.h>#include <stdlib.h>#include "pdf417.h"#define TRUE 1#define FALSE 0// An example of a c program calling the pdf417_enc routines as library// calls// This example takes a buffer from stdin and makes a symbol// using the annex P algorithmintmain (int argc, char **argv){#define _setmode(X,Y) FILE* fp; char buffer[4096]; int len = 0; char c; _setmode(fileno(stdin), _O_BINARY); memset(buffer,0, 4096); fp = stdout; while(len < 4096) { c = fgetc(stdin); if (c == EOF && feof(stdin)) { break; } buffer[len] = c; len++; } // first initialize some arrays needed pdf417_init_arrays (); printf ("Init arrays success \n"); // take the input buffer read in and put it into the raw // array pdf417_prep_to_raw(buffer,len);// set the output filename pdf417_set_output_filename ("outlib2.ps"); printf ("About to call pdf417_en \n");// call the main encoding routine// parameters are rows, columns, ec_level, output_type, use_default, // usr_raw_mode pdf417_en (8, 24, 2, OUTPUT_PS, TRUE, TRUE); // or// call the main encoding routine// parameters are rows, columns, ec_level, output_type, use_default, // usr_raw_mode, Xwid, Ymultiple, QZwidth// pdf417_en_new( 8, 24, 2, OUTPUT_PS, TRUE, TRUE, 10, 6, 36 );}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?