: asapien/signet

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
/* Synthetic text-only A5 input: no payroll records or images from real files. */
#include <stdio.h>

#include "pdfw.h"

int
main(int argc, char **argv)
{
	pdfw *p;
	char line[128];
	int row;

	if (argc != 2)
		return 2;
	p = pdfw_open(argv[1]);
	if (p == NULL)
		return 1;
	if (pdfw_page(p, 420, 595) != 0) {
		pdfw_close(p);
		return 1;
	}
	pdfw_text(p, PDFW_HELVETICA, 13, 30, 555, "SYNTHETIC A5 RESOURCE FIXTURE");
	pdfw_text(p, PDFW_HELVETICA, 10, 30, 533, "Reference: TEST-ONLY     Period: Example month");
	for (row = 0; row < 29; row++) {
		snprintf(line, sizeof(line),
		    "Example line %02d     Description     Units: 1     Amount: 100.00", row + 1);
		pdfw_text(p, PDFW_HELVETICA, 8, 30, 510 - row * 11, line);
	}
	pdfw_text(p, PDFW_HELVETICA, 9, 30, 135, "All entries are synthetic. Not a real payroll document.");
	return pdfw_close(p) == 0 ? 0 : 1;
}