~ubuntu-branches/ubuntu/gutsy/dvipdfmx/gutsy

« back to all changes in this revision

Viewing changes to src/dvi.c

  • Committer: Bazaar Package Importer
  • Author(s): Yu Guanghui
  • Date: 2007-02-23 20:48:19 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20070223204819-cmq5zsbprwjztzp9
Tags: upstream-20061211
ImportĀ upstreamĀ versionĀ 20061211

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  $Header: /home/cvsroot/dvipdfmx/src/dvi.c,v 1.37 2005/08/18 08:46:21 chofchof Exp $
 
1
/*  $Header: /home/cvsroot/dvipdfmx/src/dvi.c,v 1.38 2006/12/06 12:50:40 chofchof Exp $
2
2
    
3
3
    This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
4
4
 
1684
1684
 
1685
1685
 
1686
1686
static int
1687
 
scan_special (double *wd, double *ht, char *lm, const char *buf, UNSIGNED_QUAD size)
 
1687
scan_special (double *wd, double *ht, double *xo, double *yo, char *lm, const char *buf, UNSIGNED_QUAD size)
1688
1688
{
1689
1689
  char  *q, *p = (char *) buf;
1690
1690
  char  *endptr;
1724
1724
            error = read_length(ht, dvi_tell_mag(), &p, endptr);
1725
1725
            if (!error)
1726
1726
              *ht *= dvi_tell_mag();
 
1727
          } else if (!strcmp(kp, "xoffset")) {
 
1728
            error = read_length(xo, dvi_tell_mag(), &p, endptr);
 
1729
            if (!error)
 
1730
              *xo *= dvi_tell_mag();
 
1731
          } else if (!strcmp(kp, "yoffset")) {
 
1732
            error = read_length(yo, dvi_tell_mag(), &p, endptr);
 
1733
            if (!error)
 
1734
              *yo *= dvi_tell_mag();
1727
1735
          }
1728
1736
          RELEASE(kp);
1729
1737
        }
1760
1768
 
1761
1769
void
1762
1770
dvi_scan_paper_size (unsigned page_no,
1763
 
                     double *page_width, double *page_height, char *landscape)
 
1771
                     double *page_width, double *page_height,
 
1772
                     double *x_offset, double *y_offset, char *landscape)
1764
1773
{
1765
1774
  FILE          *fp = dvi_file;
1766
1775
  long           offset;
1789
1798
      size = MIN(size, 1024);
1790
1799
      if (fread(buf, sizeof(char), size, fp) != size)
1791
1800
        ERROR("Reading DVI file failed!");
1792
 
      scan_special(page_width, page_height, landscape, buf, size);
 
1801
      scan_special(page_width, page_height, x_offset, y_offset, landscape, buf, size);
1793
1802
      continue;
1794
1803
    }
1795
1804