summaryrefslogtreecommitdiff
path: root/src/book.c
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2011-04-21 16:11:44 +0200
committerAlessio Treglia <alessio@debian.org>2011-04-21 16:11:44 +0200
commit0898b615a2ea01bd65aa1d560350b48bd036b5b6 (patch)
tree363c58bda25cacc07c8d1af8f5a777d12cf54dcc /src/book.c
parentfafc0daa6bd26ad254943315f253b1b218e71080 (diff)
Imported Upstream version 2.32.0.2upstream/2.32.0.2
Diffstat (limited to 'src/book.c')
-rw-r--r--src/book.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/book.c b/src/book.c
index aced0ad..de40036 100644
--- a/src/book.c
+++ b/src/book.c
@@ -423,16 +423,35 @@ book_save_pdf (Book *book, GFile *file, GError **error)
/* Header */
pdf_printf (writer, "%%PDF-1.3\n");
+
+ /* Comment with binary as recommended so file is treated as binary */
+ pdf_printf (writer, "%%\xe2\xe3\xcf\xd3\n");
/* Catalog */
catalog_number = pdf_start_object (writer);
pdf_printf (writer, "%d 0 obj\n", catalog_number);
pdf_printf (writer, "<<\n");
pdf_printf (writer, "/Type /Catalog\n");
- pdf_printf (writer, "/Pages %d 0 R\n", catalog_number + 1);
+ //FIXMEpdf_printf (writer, "/Metadata %d 0 R\n", catalog_number + 1);
+ pdf_printf (writer, "/Pages %d 0 R\n", catalog_number + 1); //+2
pdf_printf (writer, ">>\n");
pdf_printf (writer, "endobj\n");
+ /* Metadata */
+ /* FIXME pdf_printf (writer, "\n");
+ number = pdf_start_object (writer);
+ pdf_printf (writer, "%d 0 obj\n", number);
+ pdf_printf (writer, "<<\n");
+ pdf_printf (writer, "/Type /Metadata\n");
+ pdf_printf (writer, "/Subtype /XML\n");
+ pdf_printf (writer, "/Length %d\n", ...);
+ pdf_printf (writer, ">>\n");
+ pdf_printf (writer, "stream\n");
+ // ...
+ pdf_printf (writer, "\n");
+ pdf_printf (writer, "endstream\n");
+ pdf_printf (writer, "endobj\n");*/
+
/* Pages */
pdf_printf (writer, "\n");
pages_number = pdf_start_object (writer);
@@ -698,6 +717,7 @@ book_save_pdf (Book *book, GFile *file, GError **error)
pdf_printf (writer, "/Size %d\n", writer->n_objects);
pdf_printf (writer, "/Info %d 0 R\n", info_number);
pdf_printf (writer, "/Root %d 0 R\n", catalog_number);
+ //FIXME: pdf_printf (writer, "/ID [<...> <...>]\n");
pdf_printf (writer, ">>\n");
pdf_printf (writer, "startxref\n");
pdf_printf (writer, "%d\n", xref_offset);