Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
File_PDF: Link tests
3
--FILE--
4
<?php
5
 
6
require_once dirname(__FILE__) . '/../PDF.php';
7
 
8
// Set up the pdf object.
9
$pdf = &File_PDF::factory(array('orientation' => 'P', 'format' => 'A4'));
10
// Start the document.
11
$pdf->open();
12
// Deactivate compression.
13
$pdf->setCompression(false);
14
// Start a page.
15
$pdf->addPage();
16
// Set font to Helvetica 12 pt.
17
$pdf->setFont('Helvetica', 'U', 12);
18
// Write linked text.
19
$pdf->write(15, 'Horde', 'http://www.horde.org');
20
// Add line break.
21
$pdf->write(15, "\n");
22
// Write linked text.
23
$link = $pdf->addLink();
24
$pdf->write(15, 'here', $link);
25
// Start next page.
26
$pdf->addPage();
27
// Add link anchor.
28
$pdf->setLink($link);
29
// Create linked image.
30
$pdf->image(dirname(__FILE__) . '/horde-power1.png', 15, 15, 0, 0, '', 'http://pear.horde.org/');
31
// Print the generated file.
32
echo $pdf->getOutput();
33
 
34
?>
35
--EXPECTF--
36
%PDF-1.3
37
3 0 obj
38
<</Type /Page
39
/Parent 1 0 R
40
/Resources 2 0 R
41
/Annots [<</Type /Annot /Subtype /Link /Rect [31.19 798.28 63.86 786.28] /Border [0 0 0] /A <</S /URI /URI (http://www.horde.org)>>>><</Type /Annot /Subtype /Link /Rect [31.19 755.76 55.20 743.76] /Border [0 0 0] /Dest [5 0 R /XYZ 0 841.89 null]>>]
42
/Contents 4 0 R>>
43
endobj
44
4 0 obj
45
<</Length 155>>
46
stream
47
2 J
48
0.57 w
49
BT /F1 12.00 Tf ET
50
BT 31.19 788.68 Td (Horde) Tj ET 31.19 787.48 32.68 -0.60 re f
51
BT 31.19 746.16 Td (here) Tj ET 31.19 744.96 24.01 -0.60 re f
52
 
53
endstream
54
endobj
55
5 0 obj
56
<</Type /Page
57
/Parent 1 0 R
58
/Resources 2 0 R
59
/Annots [<</Type /Annot /Subtype /Link /Rect [42.52 799.37 126.52 768.37] /Border [0 0 0] /A <</S /URI /URI (http://pear.horde.org/)>>>>]
60
/Contents 6 0 R>>
61
endobj
62
6 0 obj
63
<</Length 73>>
64
stream
65
2 J
66
0.57 w
67
BT /F1 12.00 Tf ET
68
q 84.00 0 0 31.00 42.52 768.37 cm /I1 Do Q
69
 
70
endstream
71
endobj
72
1 0 obj
73
<</Type /Pages
74
/Kids [3 0 R 5 0 R ]
75
/Count 2
76
/MediaBox [0 0 595.28 841.89]
77
>>
78
endobj
79
7 0 obj
80
<</Type /Font
81
/BaseFont /Helvetica
82
/Subtype /Type1
83
/Encoding /WinAnsiEncoding
84
>>
85
endobj
86
8 0 obj
87
<</Type /XObject
88
/Subtype /Image
89
/Width 84
90
/Height 31
91
/ColorSpace /DeviceRGB
92
/BitsPerComponent 8
93
/Filter /FlateDecode
94
/DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 84>>
95
/Length 2202>>
96
stream
97
%s
98
%s
99
%s
100
%s
101
%s
102
%s
103
%s
104
%s
105
%s
106
endstream
107
endobj
108
2 0 obj
109
<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
110
/Font <<
111
/F1 7 0 R
112
>>
113
/XObject <<
114
/I1 8 0 R
115
>>
116
>>
117
endobj
118
9 0 obj
119
<<
120
/Producer (Horde PDF)
121
/CreationDate (D:%d)
122
>>
123
endobj
124
10 0 obj
125
<<
126
/Type /Catalog
127
/Pages 1 0 R
128
/OpenAction [3 0 R /FitH null]
129
/PageLayout /OneColumn
130
>>
131
endobj
132
xref
133
 
134
0000000000 65535 f
135
0000000877 00000 n
136
0000003507 00000 n
137
0000000009 00000 n
138
0000000336 00000 n
139
0000000540 00000 n
140
0000000756 00000 n
141
0000000970 00000 n
142
0000001066 00000 n
143
0000003620 00000 n
144
0000003696 00000 n
145
trailer
146
<<
147
/Size 11
148
/Root 10 0 R
149
/Info 9 0 R
150
>>
151
startxref
152
3800
153
%%EOF