X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=ps%2Fps.c;h=30b9e5675acb8a14acdcfa42c75d3cdba3ad00d9;hb=f00b898dd13b85e510188714f6b9d9a349d23ed2;hp=c95c8152c683dd7b5dee07d2fd30568cde16dc53;hpb=4e8c27b1594fbfc20df693cb25537da8fad9cde4;p=evince.git diff --git a/ps/ps.c b/ps/ps.c index c95c8152..30b9e567 100644 --- a/ps/ps.c +++ b/ps/ps.c @@ -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: |(atend) + * %%Creator: * %%CreationDate: * %%Orientation: Portrait|Landscape|(atend) * %%Pages: []|(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) { @@ -615,7 +619,7 @@ psscan(FILE * file, int respect_eof, const gchar * fname) if(!DSCcomment(line)) { /* Do nothing */ } - else if(doc->default_page_orientation == NONE && + else if(doc->default_page_orientation == GTK_GS_ORIENTATION_NONE && iscomment(line + 2, "PageOrientation:")) { sscanf(line + length("%%PageOrientation:"), "%256s", text); if(strcmp(text, "Portrait") == 0) { @@ -743,7 +747,7 @@ psscan(FILE * file, int respect_eof, const gchar * fname) if(!DSCcomment(line)) { /* Do nothing */ } - else if(doc->default_page_orientation == NONE && + else if(doc->default_page_orientation == GTK_GS_ORIENTATION_NONE && iscomment(line + 2, "PageOrientation:")) { sscanf(line + length("%%PageOrientation:"), "%256s", text); if(strcmp(text, "Portrait") == 0) { @@ -809,13 +813,21 @@ psscan(FILE * file, int respect_eof, const gchar * fname) doc->lensetup = section_len - line_len; } - /* Added this (Nov. 2, 1999) when I noticed that - a Postscript file would load in gv but not in ggv - - dmg@csg.uwaterloo.ca */ + /* HACK: Mozilla 1.8 Workaround. + + It seems that Mozilla 1.8 generates important postscript code + after the '%%EndProlog' and before the first page comment '%%Page: x y'. + See comment below also. + */ + + if(doc->beginprolog && !doc->beginsetup) { + doc->lenprolog += section_len - line_len; + doc->endprolog = position; + } + + /* HACK: Windows NT Workaround - /* BEGIN Windows NT fix ###jp### - Mark Pfeifer (pfeiferm%ppddev@comet.cmis.abbott.com) told me + Mark Pfeifer (pfeiferm%ppddev@comet.cmis.abbott.com) noticed about problems when viewing Windows NT 3.51 generated postscript files with gv. He found that the relevant postscript files show important postscript code after the '%%EndSetup' and before @@ -833,7 +845,6 @@ psscan(FILE * file, int respect_eof, const gchar * fname) doc->endsetup = position; } } - /* END Windows NT fix ###jp## */ /* Individual Pages */ @@ -1155,6 +1166,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)