summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfmx/src/epdf.c
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-19 00:42:35 +0000
committerKarl Berry <karl@freefriends.org>2009-05-19 00:42:35 +0000
commit136f54b7dc95964f3db31da84ba3f1961967babe (patch)
tree2050345bf4d6396bce5b756842aea46626c7d53b /Build/source/texk/dvipdfmx/src/epdf.c
parent53241b23b422addce6dd1145dfa1d334a940c45d (diff)
update to http://project.ktug.or.kr/dvipdfmx/snapshot/latest/dvipdfmx-20090506.tar.gz
git-svn-id: svn://tug.org/texlive/trunk@13221 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfmx/src/epdf.c')
-rw-r--r--Build/source/texk/dvipdfmx/src/epdf.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/Build/source/texk/dvipdfmx/src/epdf.c b/Build/source/texk/dvipdfmx/src/epdf.c
index 0da13e58a7b..78e269e04c3 100644
--- a/Build/source/texk/dvipdfmx/src/epdf.c
+++ b/Build/source/texk/dvipdfmx/src/epdf.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/epdf.c,v 1.25 2008/10/01 00:48:46 matthias Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/epdf.c,v 1.27 2009/05/04 00:41:42 matthias Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -49,31 +49,32 @@
#include "epdf.h"
int
-pdf_include_page (pdf_ximage *ximage, FILE *image_file)
+pdf_include_page (pdf_ximage *ximage, FILE *image_file, const char *filename)
{
- char *ident = pdf_ximage_get_ident(ximage);
pdf_file *pf;
xform_info info;
- pdf_obj *trailer, *contents = NULL;
+ pdf_obj *contents = NULL, *catalog;
pdf_obj *page = NULL, *resources = NULL, *markinfo = NULL;
long page_no, count;
- pdf_ximage_init_form_info(&info);
-
- pf = pdf_open(ident, image_file);
+ pf = pdf_open(filename, image_file);
if (!pf)
return -1;
- trailer = pdf_file_get_trailer(pf);
+ if (pdf_file_get_version(pf) > pdf_get_version())
+ goto too_recent;
+
+ pdf_ximage_init_form_info(&info);
page_no = pdf_ximage_get_page(ximage);
- page = pdf_doc_get_page(trailer, &page_no, &count,
- &info.bbox, &resources, &markinfo);
+ page = pdf_doc_get_page(pf, &page_no, &count, &info.bbox, &resources);
if(!page)
goto error_silent;
+ catalog = pdf_file_get_catalog(pf);
+ markinfo = pdf_deref_obj(pdf_lookup_dict(catalog, "MarkInfo"));
if (markinfo) {
pdf_obj *tmp = pdf_deref_obj(pdf_lookup_dict(markinfo, "Marked"));
pdf_release_obj(markinfo);
@@ -199,4 +200,10 @@ pdf_include_page (pdf_ximage *ximage, FILE *image_file)
pdf_close(pf);
return -1;
+
+ too_recent:
+ WARN("PDF version of input file more recent than in output file.");
+ WARN("Converting. Use \"-V\" switch to change output PDF version.");
+ pdf_close(pf);
+ return 1;
}