* Write out the PDF file.
*/
- fp = fopen(filename, "wb");
+ if (!strcmp(filename, "-"))
+ fp = stdout;
+ else
+ fp = fopen(filename, "wb");
if (!fp) {
error(err_cantopenw, filename);
return;
olist.tail->number + 1, cat->number, info->number);
fprintf(fp, "startxref\n%d\n%%%%EOF\n", fileoff);
- fclose(fp);
+ if (fp != stdout)
+ fclose(fp);
sfree(filename);
}