summaryrefslogtreecommitdiff
path: root/support/hoffset-voffset/hovo.pas
blob: f334dced09bd2a506d33481e8e82d224acfa8731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
uses crt;
const oneinch:longint=72;
var f:text;
    paperwidth,
    hoffset,
    oddsidemargin,
    textwidth,
    marginparsep,
    marginparwidth,
    hsomething,
    paperheight,
    voffset,
    topmargin,
    headheight,
    headsep,
    textheight,
    footskip,
    vsomething:longint;
begin
clrscr;
assign(f,'dimfile.txt');
rewrite(f);

writeln('please input parameters (pt, one-side printing):');
writeln(f,'layout parameters (pt, one-side printing):');
write('\paperwidth=');readln(paperwidth);
write('\oddsidemargin=');readln(oddsidemargin);
write('\marginparsep=');readln(marginparsep);
write('\marginparwidth=');readln(marginparwidth);
write('\paperheight=');readln(paperheight);
write('\topmargin=');readln(topmargin);
write('\headheight=');readln(headheight);
write('\headsep=');readln(headsep);
write('\footskip=');readln(footskip);
write('ATTENTION! What do you want: \textwidth=');readln(textwidth);

writeln(f,'\paperwidth=',paperwidth);
writeln(f,'\oddsidemargin=',oddsidemargin);
writeln(f,'\marginparsep=',marginparsep);
writeln(f,'\marginparwidth=',marginparwidth);
writeln(f,'\paperheight=',paperheight);
writeln(f,'\topmargin=',topmargin);
writeln(f,'\headheight=',headheight);
writeln(f,'\headsep=',headsep);
writeln(f,'\footskip=',footskip);
writeln(f,'ATTENTION! What do you want: \textwidth=',textwidth);

hoffset:=(paperwidth-2*oneinch-2*oddsidemargin-textwidth)div(2);
writeln('Your \hoffset=',hoffset);
writeln(f,'Your \hoffset=',hoffset);

voffset:=hoffset+oddsidemargin-topmargin;
writeln('Your \voffset=',voffset,' (if take header into account).');
writeln(f,'Your \voffset=',voffset,' (if take header into account).');
textheight:=paperheight-2*(oneinch+voffset+topmargin+headheight+headsep);
writeln('Your \textheight=',textheight,' (if take header into account).');
writeln(f,'Your \textheight=',textheight,' (if take header into account).');

voffset:=hoffset+oddsidemargin-topmargin-headheight-headsep;
writeln('Your \voffset=',voffset,' (if not take header into account).');
writeln(f,'Your \voffset=',voffset,' (if not take header into account).');
textheight:=paperheight-2*(oneinch+voffset+topmargin+headheight+headsep);
writeln('Your \textheight=',textheight,' (if not take header into account).');
writeln(f,'Your \textheight=',textheight,' (if not take header into account).');

close(f);
writeln('Done. Press [Enter]...');
readln;
end.