FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PHPWord/samples/Sample_05_Multicolumn.php at develop · ynphp/PHPWord · GitHub
ynphp
PHPWord
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PHPWord
/
samples
/
Sample_05_Multicolumn.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (41 loc) · 1.39 KB
Breadcrumbs
PHPWord
/
samples
/
Sample_05_Multicolumn.php
Copy path
File metadata and controls
48 lines (41 loc) · 1.39 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
include_once
'
Sample_Header.php
'
;
// New Word Document
echo
date
(
'
H:i:s
'
),
'
Create new PhpWord object
'
,
EOL
;
$
phpWord
=
new
\
PhpOffice
\
PhpWord
\
PhpWord
();
$
filler
=
'
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
'
.
'
Nulla fermentum, tortor id adipiscing adipiscing, tortor turpis commodo.
'
.
'
Donec vulputate iaculis metus, vel luctus dolor hendrerit ac.
'
.
'
Suspendisse congue congue leo sed pellentesque.
'
;
// Normal
$
section
=
$
phpWord
->
addSection
();
$
section
->
addText
(
"
Normal paragraph.
{
$
filler
}"
);
// Two columns
$
section
=
$
phpWord
->
addSection
(
array
(
'
colsNum
'
=>
2
,
'
colsSpace
'
=>
1440
,
'
breakType
'
=>
'
continuous
'
,
)
);
$
section
->
addText
(
"
Two columns, one inch (1440 twips) spacing.
{
$
filler
}"
);
// Normal
$
section
=
$
phpWord
->
addSection
(
array
(
'
breakType
'
=>
'
continuous
'
));
$
section
->
addText
(
"
Normal paragraph again.
{
$
filler
}"
);
// Three columns
$
section
=
$
phpWord
->
addSection
(
array
(
'
colsNum
'
=>
3
,
'
colsSpace
'
=>
720
,
'
breakType
'
=>
'
continuous
'
,
)
);
$
section
->
addText
(
"
Three columns, half inch (720 twips) spacing.
{
$
filler
}"
);
// Normal
$
section
=
$
phpWord
->
addSection
(
array
(
'
breakType
'
=>
'
continuous
'
));
$
section
->
addText
(
"
Normal paragraph again.
{
$
filler
}"
);
// Save file
echo
write
(
$
phpWord
,
basename
(
__FILE__
,
'
.php
'
),
$
writers
);
if
(!
CLI
) {
include_once
'
Sample_Footer.php
'
;
}
Back
|
FazBrowse Home
|
New Git URL