int font_index;
font_encoding *fe;
page_data *page;
- int pageno;
FILE *fp;
char *filename;
paragraph *p;
sprintf(buf, "<%02X>", i + ranges[i] - 1);
objstream(cmap, buf);
sprintf(buf, "%hu\n",
+ (unsigned short)
sfnt_glyphtoindex(fe->font->info->fontfile,
fe->vector[i]));
objstream(cmap, buf);
sprintf(buf, "<%02X>", i);
objstream(cmap, buf);
sprintf(buf, "%hu\n",
+ (unsigned short)
sfnt_glyphtoindex(fe->font->info->fontfile,
fe->vector[i]));
objstream(cmap, buf);
/*
* Create and render the individual pages.
*/
- pageno = 0;
for (page = doc->pages; page; page = page->next) {
object *opage, *cstr;
rect *r;
* 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);
}