From 35512dd1ae66e5dbbeb490d3846dafcf150f1f28 Mon Sep 17 00:00:00 2001 From: Wouter Bolsterlee Date: Mon, 04 Dec 2006 11:53:25 +0000 Subject: Adds a paper size field to the properties dialog. Fixes bug #307315. Patch 2006-12-04 Wouter Bolsterlee * backend/ev-document-info.h: * data/evince-properties.glade: * pdf/ev-poppler.cc: * properties/ev-properties-view.c: (ev_regular_paper_size), (ev_properties_view_set_info): * ps/ps-document.c: (ps_document_get_info): Adds a paper size field to the properties dialog. Fixes bug #307315. Patch by Kasper Svendsen (with some i18n changes done by me). --- (limited to 'ps') diff --git a/ps/ps-document.c b/ps/ps-document.c index e9c7ca5..1980010 100644 --- a/ps/ps-document.c +++ b/ps/ps-document.c @@ -1257,17 +1257,25 @@ ps_document_get_info (EvDocument *document) { EvDocumentInfo *info; PSDocument *ps = PS_DOCUMENT (document); + int urx, ury, llx, lly; info = g_new0 (EvDocumentInfo, 1); info->fields_mask = EV_DOCUMENT_INFO_TITLE | EV_DOCUMENT_INFO_FORMAT | EV_DOCUMENT_INFO_CREATOR | - EV_DOCUMENT_INFO_N_PAGES; + EV_DOCUMENT_INFO_N_PAGES | + EV_DOCUMENT_INFO_PAPER_SIZE; + info->title = g_strdup (ps->doc->title); info->format = ps->doc->epsf ? g_strdup (_("Encapsulated PostScript")) : g_strdup (_("PostScript")); info->creator = g_strdup (ps->doc->creator); info->n_pages = ev_document_get_n_pages (document); + + get_page_box (PS_DOCUMENT (document), 0, &urx, &ury, &llx, &lly); + + info->paper_width = (urx - llx) / 72.0f * 25.4f; + info->paper_height = (ury - lly) / 72.0f * 25.4f; return info; } -- cgit v0.9.1