still doesn't _work_ properly if there aren't any contents entries,
but it's a start.
git-svn-id: svn://svn.tartarus.org/sgt/halibut@4250
cda61777-01e9-0310-a592-
d414129be87e
olist.number = 1;
cat = new_object(&olist);
olist.number = 1;
cat = new_object(&olist);
- outlines = new_object(&olist);
+ if (doc->n_outline_elements > 0)
+ outlines = new_object(&olist);
+ else
+ outlines = NULL;
pages = new_object(&olist);
resources = new_object(&olist);
pages = new_object(&olist);
resources = new_object(&olist);
* The catalogue just contains references to the outlines and
* pages objects.
*/
* The catalogue just contains references to the outlines and
* pages objects.
*/
- objtext(cat, "<<\n/Type /Catalog\n/Outlines ");
- objref(cat, outlines);
+ objtext(cat, "<<\n/Type /Catalog");
+ if (outlines) {
+ objtext(cat, "\n/Outlines ");
+ objref(cat, outlines);
+ }
objtext(cat, "\n/Pages ");
objref(cat, pages);
objtext(cat, "\n/Pages ");
objref(cat, pages);
- objtext(cat, "\n/PageMode /UseOutlines\n>>\n");
+ if (outlines)
+ objtext(cat, "\n/PageMode /UseOutlines");
+ objtext(cat, "\n>>\n");
/*
* Set up the resources dictionary, which mostly means
/*
* Set up the resources dictionary, which mostly means
/*
* Set up the outlines dictionary.
*/
/*
* Set up the outlines dictionary.
*/
int topcount;
char buf[80];
int topcount;
char buf[80];