diff options
author | Martin Kretzschmar <martink@src.gnome.org> | 2005-06-17 13:33:00 (GMT) |
---|---|---|
committer | Martin Kretzschmar <martink@src.gnome.org> | 2005-06-17 13:33:00 (GMT) |
commit | 97bfa85d313ea1bd867ef3b37e1e2b7355a00706 (patch) | |
tree | 37dc280b4786a3544a986bc8f70b7bf5470c5a0e /ps/ps.c | |
parent | dfbda438b1e9f7427e0a5efb5daed603e8a51d61 (diff) |
read "Creator:" comment, free creator field if necessary.
* ps/ps.c (psscan, psfree): read "Creator:" comment, free creator
field if necessary.
* ps/ps.h: add creator field to document.
* ps/ps-document.c (ps_document_get_info): set format to PostScript,
set creator field.
Diffstat (limited to 'ps/ps.c')
-rw-r--r-- | ps/ps.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -133,7 +133,7 @@ pages_new(struct page *pages, int current, int maxpages) * Page Size (for the Page Size), Bounding Box (to minimize backing * pixmap size or determine window size for encapsulated PostScript), * Orientation of Paper (for default transformation matrix), and - * Page Order. The title and CreationDate are also retrieved to + * Page Order. The Title, Creator, and CreationDate are also retrieved to * help identify the document. * * The following comments are examined: @@ -144,6 +144,7 @@ pages_new(struct page *pages, int current, int maxpages) * * %!PS-Adobe-* [EPSF-*] * %%BoundingBox: <int> <int> <int> <int>|(atend) + * %%Creator: <textline> * %%CreationDate: <textline> * %%Orientation: Portrait|Landscape|(atend) * %%Pages: <uint> [<int>]|(atend) @@ -348,6 +349,9 @@ psscan(FILE * file, int respect_eof, const gchar * fname) else if(doc->date == NULL && iscomment(line + 2, "CreationDate:")) { doc->date = gettextline(line + length("%%CreationDate:")); } + else if(doc->creator == NULL && iscomment(line + 2, "Creator:")) { + doc->creator = gettextline(line + length("%%Creator:")); + } else if(bb_set == NONE && iscomment(line + 2, "BoundingBox:")) { sscanf(line + length("%%BoundingBox:"), "%256s", text); if(strcmp(text, "(atend)") == 0) { @@ -1155,6 +1159,8 @@ psfree(doc) g_free(doc->title); if(doc->date) g_free(doc->date); + if(doc->creator) + g_free(doc->creator); if(doc->pages) g_free(doc->pages); if(doc->size) |