Thu, 13 Mar 2003 08:03:11 +0000
Acrobat 4.0 fails to optimize PDF files in which the Kids array in the Pages object is an indirect reference.
pdf.c | file | annotate | diff | revisions |
1.1 --- a/pdf.c Thu Mar 13 08:00:21 2003 +0000 1.2 +++ b/pdf.c Thu Mar 13 08:03:11 2003 +0000 1.3 @@ -4,7 +4,7 @@ 1.4 * will be compressed using ITU-T T.6 (G4) fax encoding. 1.5 * 1.6 * PDF routines 1.7 - * $Id: pdf.c,v 1.8 2003/03/12 22:56:57 eric Exp $ 1.8 + * $Id: pdf.c,v 1.9 2003/03/13 00:03:11 eric Exp $ 1.9 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 1.10 * 1.11 * This program is free software; you can redistribute it and/or modify 1.12 @@ -55,7 +55,11 @@ 1.13 struct pdf_pages *pdf_new_pages (pdf_file_handle pdf_file) 1.14 { 1.15 struct pdf_pages *pages = pdf_calloc (1, sizeof (struct pdf_pages)); 1.16 - pages->kids = pdf_new_ind_ref (pdf_file, pdf_new_obj (PT_ARRAY)); 1.17 + 1.18 + pages->kids = pdf_new_obj (PT_ARRAY); 1.19 + /* The PDF 1.0 spec doesn't say that kids can't be an indirect object, 1.20 + but Acrobat 4.0 fails to optimize files if it is. */ 1.21 + 1.22 pages->count = pdf_new_integer (0); 1.23 pages->pages_dict = pdf_new_ind_ref (pdf_file, pdf_new_obj (PT_DICTIONARY)); 1.24 pdf_set_dict_entry (pages->pages_dict, "Type", pdf_new_name ("Pages")); 1.25 @@ -98,7 +102,7 @@ 1.26 pdf_new_name (page_mode_string)); 1.27 1.28 pdf_file->info = pdf_new_ind_ref (pdf_file, pdf_new_obj (PT_DICTIONARY)); 1.29 - pdf_set_info (pdf_file, "Producer", "t2p by Eric Smith <eric@brouhaha.com>"); 1.30 + pdf_set_info (pdf_file, "Producer", "tumble by Eric Smith <eric@brouhaha.com>"); 1.31 1.32 pdf_file->trailer_dict = pdf_new_obj (PT_DICTIONARY); 1.33 /* Size key will be added later */