blob: 269042aab25732ee7c6a69c332d4fd8516fc75bb (
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
70
71
72
73
74
75
76
77
78
|
\documentclass{article}
%\usepackage[designv,forcolorpaper,tight*]{web}
\usepackage{hyperref}
\usepackage{forms16be}
\defUniStr{VDV}{\u03B1 cos(\u03B8)}
\defUniStr{TU}{Don \u\EURO Story "\u03B1 cos(\u03B8)"}
\makeatletter
% Define two new keys udefault and uvalue to take big-endian values
\define@key{Field}{udefault}{%
\def\Fld@udefault{#1}%
}
\define@key{Field}{uvalue}{%
\Hy@pdfstringdef\Fld@uvalue{#1}%
}
\let\Fld@udefault\ltx@empty
\let\Fld@uvalue\@empty
\def\PDFForm@Text{%
/Subtype/Widget%
\Fld@annotflags
\Fld@pageobjref
\Fld@annotnames
/FT/Tx%
\Fld@flags
/Q \Fld@align
/BS<</W \Fld@borderwidth\space /S /\Fld@borderstyle>>%
\ifcase0\ifnum\Fld@rotation=\z@ \else 1\fi
\ifx\Fld@bordercolor\relax\else 1\fi
\ifx\Fld@bcolor\relax \else 1\fi
\space
\else
/MK<<%
\ifnum\Fld@rotation=\z@
\else
/R \Fld@rotation
\fi
\ifx\Fld@bordercolor\relax
\else
/BC[\Fld@bordercolor]%
\fi
\ifx\Fld@bcolor\relax
\else
/BG[\Fld@bcolor]%
\fi
>>%
\fi
/DA(/Helv \strip@pt\Fld@charsize\space Tf%
\ifx\Fld@color\@empty\else\space\Fld@color\fi)%
% Determine which key to used based on uvalue and udefault
\ifx\Fld@udefault\ltx@empty
/DV(\Hy@escapestring{\Fld@default})\else
/DV<\Hy@escapestring{\Fld@udefault}>\fi
\ifx\Fld@uvalue\@empty
/V(\Hy@escapestring{\Fld@value})\else
/V<\Hy@escapestring{\Fld@uvalue}>\fi
\Fld@additionalactions
\ifnum\Fld@maxlen>\z@/MaxLen \Fld@maxlen \fi
}
\makeatother
\def\cs#1{\texttt{\char`\\#1}}
\let\pkg\textsf
\parindent0pt \parskip6pt
\begin{document}
\begin{Form}
The \pkg{hyperref} package does not support initializing form fields with big-endian, but it is possible
to modify some \pkg{hyperref} core code to get the desired result. The maintainer can take this example
and generalize it to all appropriate form fields and properties, it there is a demand.
\def\LayoutTextField#1#2{#2}
\TextField[uvalue={\unicodeStr(VDV)},udefault={\unicodeStr(VDV)}]{textfield}
\end{Form}
\end{document}
|