Dr. Werner Fink 2013-02-08 11:15:09 +00:00 committed by Git OBS Bridge
parent 81defae636
commit a25f2445c9
2 changed files with 23 additions and 14 deletions

View File

@ -1,25 +1,29 @@
--- f_readeps.c
+++ f_readeps.c 2013-02-07 14:10:06.681492792 +0000
@@ -79,15 +79,21 @@ read_epsf_pdf(FILE *file, int filetype,
if (pdf_flag) {
if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */
char *c;
+ float rllx, rlly, rurx, rury;
+++ f_readeps.c 2013-02-08 11:11:22.717952436 +0000
@@ -77,11 +77,13 @@ read_epsf_pdf(FILE *file, int filetype,
c = strchr(buf, '[') + 1;
/* look for /MediaBox for pdf file */
if (pdf_flag) {
- if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */
+ char *s;
+ for(s=buf; (s=strchr(s,'/')); s++) {
+ if (!strncmp(s, "/MediaBox", 8)) { /* look for the MediaBox spec */
char *c;
- c = strchr(buf, '[') + 1;
- if (c && sscanf(c, "%d %d %d %d", &llx, &lly, &urx, &ury) < 4) {
+ if (c && sscanf(c, "%d %d %d %d", "%f %f %f %f", &rllx, &rlly, &rurx, &rury) < 4) {
+ c = strchr(buf, '[');
+ if (c && sscanf(c+1, "%d %d %d %d", &llx, &lly, &urx, &ury) < 4) {
llx = lly = 0;
urx = paper_sizes[0].width * 72 / PIX_PER_INCH;
ury = paper_sizes[0].height * 72 / PIX_PER_INCH;
file_msg("Bad MediaBox in header, assuming %s size",
@@ -89,7 +91,9 @@ read_epsf_pdf(FILE *file, int filetype,
appres.INCHES ? "Letter" : "A4");
app_flush();
+ } else {
+ llx = round(rllx);
+ lly = round(rlly);
+ urx = round(rurx);
+ ury = round(rury);
}
+ break;
}
+ }
/* look for bounding box */
} else if (!nested && !strncmp(buf, "%%BoundingBox:", 14)) {
if (!strstr(buf, "(atend)")) { /* make sure doesn't say (atend) */

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Feb 8 11:14:39 UTC 2013 - werner@suse.de
- User original patch from Debian
-------------------------------------------------------------------
Thu Feb 7 14:12:21 UTC 2013 - werner@suse.de