mPDF Example File
The front cover can also be produced like this:
/* ALTERNATIVE PHP METHOD */
$mpdf->Image('clematis.jpg',0,0,210,297,'jpg','',true, false);
// the last "false" allows a full page picture
$mpdf->y = 70;
$mpdf->Shaded_box('mPDF Example File', 'Trebuchet', '', 28, '70%', 'DF', 3, '#FFFFFF',
'#000044', 10);
CONTENTS
HTML Markup 1 ..........................................................................................................................................
HTML Markup 1 ..........................................................................................................................................
HTML Markup 1 ..........................................................................................................................................
Hyphenation 4 .............................................................................................................................................
Lists 6 ..........................................................................................................................................................
Tables 8 ........................................................................................................................................................
Forms 17 ......................................................................................................................................................
Annotations 18 .............................................................................................................................................
Barcode 19 ...................................................................................................................................................
FIGURES
Full size image & Barcode 19 ......................................................................................................................
TABLES
Basic table 3 ................................................................................................................................................
Tables - general 8 ........................................................................................................................................
Table styles 8 ...............................................................................................................................................
Lists in a table 10 ........................................................................................................................................
Automatic column width 10 .........................................................................................................................
Column span 10 ...........................................................................................................................................
Header rows 10 ...........................................................................................................................................
Autosizing tables 11 .....................................................................................................................................
Rotated table 13 ..........................................................................................................................................
Rotated text in table 14 ...............................................................................................................................
Nested tables 15 ..........................................................................................................................................
mPDF Example File
(H1) mPDF
(H2) Section 1
(H3) HTML Markup
Heading 4
Heading 5
Heading 6
P: Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at
ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet
erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id
euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus.
Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien.
Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus
luctus euismod. Donec et nulla. Sed quis orci.
DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet.
Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi
lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed
vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam
porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim.
DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet.
Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi
lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed
vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam
porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim.
Blockquote: Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce
mollis. Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus.
Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce mollis.
Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus.
Address: Vestibulum feugiat, orci at imperdiet tincidunt, mauris erat facilisis urna, sagittis ultricies dui
nisl et lectus. Sed lacinia, lectus vitae dictum sodales, elit ipsum ultrices orci, non euismod arcu diam
non metus.
PRE: Cum sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. In suscipit turpis vitae odio. Integer convallis
dui at metus. Fusce magna. Sed sed lectus vitae enim tempor cursus. Cras
sed, posuere et, urna. Quisque ut leo. Aliquam interdum hendrerit tortor.
Vestibulum elit. Vestibulum et arcu at diam mattis commodo. Nam ipsum sem,
ultricies at, rutrum sit amet, posuere nec, velit. Sed molestie mollis dui.
Hyperlink (<a>)
Styles - tt(teletype) italic bold big small emphasis strong
mPDF Example File 1/22
mPDF Example File
new lines
code sample keyboard variable citation abbr. ACRONYM
sup
sub
strike strike-s underline delete insert To
be or not to be font changing face, size and color
Paragraph using the in-line style to determine the font-size (15pt) and
colour
Testing BIG, SMALL, UNDERLINE, STRIKETHROUGH, FONT color, ACRONYM,
SUPERSCRIPT and SUBSCRIPT
This is strikethrough in block and small strikethrough in small span and big strikethrough in big span
and then underline and strikethrough and
sup
but out of span again but blue font and ACRONYM text
This is a green reference
32-47
and underlined reference
32-47
then reference
32-47
and underlined reference
32-47
then Strikethrough reference
32-47
and strikethrough reference
32-47
Repeated in BIG: This is reference
32-47
and underlined reference
32-47
then reference
32-47
and
underlined reference
32-47
but out of span again but blue font and ACRONYM text
Repeated in small: This is reference
32-47
and underlined reference
32-47
then reference
32-47
and underlined reference
32-47
but out of
span again but blue font and ACRONYM text
The above repeated, but starting with a paragraph with font-size specified (7pt)
This is strikethrough in block and small strikethrough in small span and then underline but out of span again but blue font and ACRONYM text
This is strikethrough in block and big strikethrough in big span and then underline but out of span again but blue font and ACRONYM text
This is reference
32-47
and underlined reference
32-47
then reference
32-47
and underlined reference
32-47
then Strikethrough reference
32-47
and strikethrough
reference
32-47
This tests underline and strikethrough when they are used together as they both use text-decoration
Repeated in small: This is reference
32-47
and underlined reference
32-47
then reference
32-47
and underlined reference
32-47
but out of
span again but blue font and ACRONYM text
Repeated in BIG but with font-size set to 7pt by in-line css: This is reference
32-47
and underlined reference
32-47
then reference
32-47
and underlined reference
32-47
but out of span again but blue font and ACRONYM text
Item 11)
Item 2
32
2)
Item 33)
Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae,4)
magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet
vulputate. Donec luctus. Cras euismod tellus vel leo.
Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae,
magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet
vulputate. Donec luctus. Cras euismod tellus vel leo.
Subitem 2
Level 3 subitem
Item 55)
Sed bibendum. Nunc eleifend ornare velit. Sed consectetuer urna in erat. Class aptent taciti sociosqu ad
litora torquent per conubia nostra, per inceptos hymenaeos. Mauris sodales semper metus. Maecenas
justo libero, pretium at, malesuada eu, mollis et, arcu. Ut suscipit pede in nulla. Praesent elementum,
dolor ac fringilla posuere, elit libero rutrum massa, vel tincidunt dui tellus a ante. Sed aliquet euismod
2/22 mPDF Example File 3-05-2017
mPDF Example File
dolor. Vestibulum sed dui. Duis lobortis hendrerit quam. Donec tempus orci ut libero. Pellentesque
suscipit malesuada nisi.
Data Data Data
Data
2nd line
More Data More Data More Data Data
2nd line
Data Data Data Data
2nd line
Data Data Data Data
2nd line
This paragraph has border-radius and background-gradient set. Minimum padding is recommended as
1/3rd of the border-radius. Or can use $mpdf->autoPadding.
Sed bibendum. Nunc eleifend ornare velit. Sed consectetuer urna in erat. Class aptent taciti
sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Mauris sodales semper
metus. Maecenas justo libero, pretium at, malesuada eu, mollis et, arcu. Ut suscipit pede in nulla.
Praesent elementum, dolor ac fringilla posuere, elit libero rutrum massa, vel tincidunt dui tellus a
ante. Sed aliquet euismod dolor. Vestibulum sed dui. Duis lobortis hendrerit quam. Donec tempus
orci ut libero. Pellentesque suscipit malesuada nisi.
mPDF Example File 3/22
mPDF Example File
Hyphenation
Little Women - Chapter One - Playing Pilgrims
Christmas won't be
Christmas without any
presents, grumbled Jo,
lying on the rug.
It's so dreadful to be
poor! sighed Meg,
looking down at her
old dress.
I don't think it's fair for
some girls to have
plenty of pretty things,
and other girls nothing
at all, added little Amy,
with an injured sniff.
We've got Father and
Mother, and each
other, said Beth
contentedly from her
corner.
The four young faces
on which the firelight
shone brightened at
the cheerful words, but
darkened again as Jo
said sadly, We haven't
got Father, and shall
not have him for a long
time. She didn't say
perhaps never, but
each silently added it,
thinking of Father far
away, where the
fighting was.
Nobody spoke for a
minute; then Meg said
in an altered tone, You
know the reason
Mother proposed not
having any presents
this Christmas was
because it is going to
be a hard winter for
everyone; and she
thinks we ought not to
spend money for
pleasure, when our
men are suffering so in
the army. We can't do
much, but we can
make our little
sacrifices, and ought
to do it gladly. But I
am afraid I don't And
Meg shook her head,
as she thought
regretfully of all the
pretty things she
wanted.
But I don't think the
little we should spend
would do any good.
We've each got a
dollar, and the army
wouldn't be much
helped by our giving
that. I agree not to
expect anything from
Mother or you, but I do
want to buy UNDINE
AND SINTRAM for
myself. I've wanted it
so long, said Jo, who
was a bookworm.
I planned to spend
mine in new music,
said Beth, with a little
sigh, which no one
heard but the hearth
brush and kettle
holder.
I shall get a nice box of
Faber's drawing
pencils. I really need
them, said Amy
decidedly.
Mother didn't say
anything about our
money, and she won't
wish us to give up
everything. Let's each
buy what we want, and
have a little fun. I'm
sure we work hard
enough to earn it,
cried Jo, examining the
heels of her shoes in a
gentlemanly manner.
I know I do—teaching
those tiresome
children nearly all day,
when I'm longing to
enjoy myself at home,
began Meg, in the
complaining tone
again.
You don't have half
such a hard time as I
do, said Jo. How would
you like to be shut up
for hours with a
nervous, fussy old
lady, who keeps you
trotting, is never
satisfied, and worries
you till you you're
ready to fly out the
window or cry?
It's naughty to fret, but
I do think washing
dishes and keeping
things tidy is the worst
work in the world. It
makes me cross, and
my hands get so stiff, I
can't practice well at
all. And Beth looked at
her rough hands with a
sigh that any one
could hear that time.
I don't believe any of
you suffer as I do,
cried Amy, for you
don't have to go to
school with
impertinent girls, who
plague you if you don't
know your lessons,
and laugh at your
dresses, and label your
father if he isn't rich,
and insult you when
your nose isn't nice.
If you mean libel, I'd
say so, and not talk
about labels, as if Papa
was a pickle bottle,
advised Jo, laughing.
I know what I mean,
and you needn't be
satirical about it. It's
proper to use good
words, and improve
your vocabulary,
returned Amy, with
dignity.
Don't peck at one
another, children.
Don't you wish we had
the money Papa lost
when we were little,
Jo? Dear me! How
happy and good we'd
be, if we had no
worries! said Meg, who
could remember better
times.
You said the other day
you thought we were a
deal happier than the
King children, for they
were fighting and
fretting all the time, in
spite of their money.
So I did, Beth. Well, I
think we are. For
though we do have to
work, we make fun of
ourselves, and are a
pretty jolly set, as Jo
would say.
Jo does use such slang
words! observed Amy,
with a reproving look
at the long figure
stretched on the rug.
Jo immediately sat up,
put her hands in her
pockets, and began to
whistle.
Don't, Jo. It's so
boyish!
That's why I do it.
I detest rude,
unladylike girls!
I hate affected, niminy-
piminy chits!
4/22 mPDF Example File 3-05-2017
mPDF Example File
Birds in their little
nests agree, sang
Beth, the peacemaker,
with such a funny face
that both sharp voices
softened to a laugh,
and the pecking ended
for that time.
Really, girls, you are
both to be blamed,
said Meg, beginning to
lecture in her elder-
sisterly fashion. You
are old enough to
leave off boyish tricks,
and to behave better,
Josephine. It didn't
matter so much when
you were a little girl,
but now you are so
tall, and turn up your
hair, you should
remember that you are
a young lady.
I'm not! And if turning
up my hair makes me
one, I'll wear it in two
tails till I'm twenty,
cried Jo, pulling off her
net, and shaking down
a chestnut mane. I
hate to think I've got
to grow up, and be
Miss March, and wear
long gowns, and look
as prim as a China
Aster! It's bad enough
to be a girl, anyway,
when I like boy's
games and work and
manners! I can't get
over my
disappointment in not
being a boy. And it's
worse than ever now,
for I'm dying to go and
fight with Papa. And I
can only stay home
and knit, like a poky
old woman!
And Jo shook the blue
army sock till the
needles rattled like
castanets, and her ball
bounded across the
room.
Poor Jo! It's too bad,
but it can't be helped.
So you must try to be
contented with making
your name boyish, and
playing brother to us
girls, said Beth,
stroking the rough
head with a hand that
all the dish washing
and dusting in the
world could not make
ungentle in its touch.
As for you, Amy,
continued Meg, you
are altogether to
particular and prim.
Your airs are funny
now, but you'll grow up
an affected little
goose, if you don't
take care. I I like your
nice manners and
refined ways of
speaking, when you
don't try to be elegant.
But your absurd words
are as bad as Jo's
slang.
If Jo is a tomboy and
Amy a goose, what am
I, please? asked Beth,
ready to share the
lecture.
You're a dear, and
nothing else, answered
Meg warmly, and no
one contradicted her,
for the 'Mouse' was the
pet of the family.
mPDF Example File 5/22
mPDF Example File
Lists
Text here lorem ipsum ibisque totum.I)
Text here lorem ipsum ibisque totum.II)
Text here lorem ipsum ibisque totum.III)
Text here lorem ipsum ibisque totum. Text here lorem ipsum ibisque totum. Text here lorem ipsumIV)
ibisque totum. Text here lorem ipsum ibisque totum. Text here lorem ipsum ibisque totum. Text
here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.V)
Text here lorem ipsum ibisque totum.VI)
Text here lorem ipsum ibisque totum.1)
Text here lorem ipsum ibisque totum.2)
Text here lorem ipsum ibisque totum.3)
Text here lorem ipsum ibisque totum.4)
Text here lorem ipsum ibisque totum.5)
Text here lorem ipsum ibisque totum.6)
Big text indent 25mm: Text here lorem ipsum ibisque totum.A)
Text here lorem ipsum ibisque totum.B)
Text here lorem ipsum ibisque totum.C)
Text here lorem ipsum ibisque totum.a)
Text here lorem ipsum ibisque totum.b)
Text here lorem ipsum ibisque totum.c)
Text here lorem ipsum ibisque totum.d)
Text here lorem ipsum ibisque totum.e)
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.f)
Text here lorem ipsum ibisque totum.g)
Text here lorem ipsum ibisque totum.h)
Text here lorem ipsum ibisque totum.i)
Text here lorem ipsum ibisque totum.D)
Text here lorem ipsum ibisque totum.7)
Text here lorem ipsum ibisque totum.8)
Text here lorem ipsum ibisque totum.9)
Text here lorem ipsum ibisque totum.10)
Text here lorem ipsum ibisque totum.VII)
Text here lorem ipsum ibisque totum.VIII)
Big text indent 25mm: Text here lorem ipsum ibisque totum.A)
Text here lorem ipsum ibisque totum.B)
6/22 mPDF Example File 3-05-2017
mPDF Example File
Text here lorem ipsum ibisque totum.C)
Text here lorem ipsum ibisque totum.a)
Text here lorem ipsum ibisque totum.b)
Text here lorem ipsum ibisque totum.c)
Text here lorem ipsum ibisque totum.d)
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.
Text here lorem ipsum ibisque totum.e)
Text here lorem ipsum ibisque totum.f)
Text here lorem ipsum ibisque totum.g)
No class specified. Text here lorem ipsum ibisque totum.1)
Text here lorem ipsum ibisque totum.2)
Text here lorem ipsum ibisque totum.3)
Text here lorem ipsum ibisque totum.4)
Text here lorem ipsum ibisque totum.5)
Text here lorem ipsum ibisque totum.IX)
Text here lorem ipsum ibisque totum.X)
Text here lorem ipsum ibisque totum.XI)
Text here lorem ipsum ibisque totum.XII)
Text here lorem ipsum ibisque totum.XIII)
Text here lorem ipsum ibisque totum.XIV)
Text here lorem ipsum ibisque totum.XV)
mPDF Example File 7/22
mPDF Example File
Tables
mPDF supports all in-line properties inside tables.
Row 1 This is data This is data
Row 2 This is data p
This is data out of p
This is bold data p
This is bold data out of p
This is normal data after br
Heading 3 inside a table
Text here lorem ipsum ibisque totum.
32
This is data div
This is data out of div
This is data div (bold)
This is data out of div
Also data
This table has padding-top and -bottom set to 3mm i.e. padding within the cells. Also background-,
border colour and style, font family and size are set by in-line CSS.
Row 1 This is data This is data
Row 2 This is data p More data
Row 3 This is long data This is data
Tables
The style sheet used for these examples shows some of the table styles I use on my website. The
property 'topntail' defined by a border-type definition e.g. "1px solid #880000" puts a border at the top
and bottom of the table, and also below a header row (thead) if defined. Note also that <thead> will
automatically turn on the header-repeat i.e. reproduce the header row at the top of each page.
bpmTopic Class
Row 1 This is data This is data
Row 2 This is data p More data
Row 3 This is long data This is data
Row 4 <td> cell This is data This is data
Row 5 Also data Also data
Row 6 Also data Also data
Row 7 Also data Also data
Row 8 Also data Also data
bpmTopicC Class (centered) Odd and Even rows
Col/Row Header Second column header p Third column header
Row header 1 This is data This is data
Row header 2 This is data p This is data
Row header 3 This is long data This is data
Row header 4
<th> cell acting as header
This is data This is data
8/22 mPDF Example File 3-05-2017
mPDF Example File
Col/Row Header Second column header p Third column header
Row header 5 Also data Also data
Row header 6 Also data Also data
Row header 7 Also data Also data
Row header 8 Also data Also data
bpmTopnTail Class
Row 1 This is data This is data
Row 2 This is data p This is data
Row 3 This is long data This is data
Row 4 <td> cell This is data This is data
Row 5 Also data Also data
Row 6 Also data Also data
Row 7 Also data Also data
Row 8 Also data Also data
bpmTopnTailC Class (centered) Odd and Even rows
Col/Row Header Second column header p Third column header
Row header 1 This is data This is data
Row header 2 This is data p This is data
Row header 3 This is long data This is data
Row header 4
<th> cell acting as header
This is data This is data
Row header 5 Also data Also data
Row header 6 Also data Also data
Row header 7 Also data Also data
Row header 8 Also data Also data
TopnTail Class
Col and Row Header
Second
column
Top right align
Row header 1 p This is data This is data
Row header 2
Bottom right align
This is data. Can use
bold italic
sub
or
sup
text
Bottom right align
This is data. This cell
uses Cell Styles to set
the borders.
All borders are collapsible
in mPDF.
This is data
Row header 4 This is data p More data
Row header 5 Also data merged and centered
mPDF Example File 9/22
mPDF Example File
Lists in a Table
Col and Row Header
Second
column
Top right align
Row header 1 p This is data This is data
Row header 2 1) Item 1
2) Item 2
1) Subitem of ordered list
2) Subitem 2
1) Level 3 subitem
2) Level 3 subitem
3) Item 3
4) Another Item
5) Subitem
1) Level 3 subitem
6) Another Item
Unordered list:
• Item 1
• Item 2
⚬ Subitem of unordered list
⚬ Subitem 2
▪ Level 3 subitem
▪ Level 3 subitem
▪ Level 3 subitem
• Item 3
Automatic Column Width
Causes Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit.
Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.
Suspendisse potenti
Mechanisms Ut magna ipsum, tempus in, condimentum at, rutrum et, nisl. Vestibulum interdum luctus sapien.
Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim
tempus dictum. Maecenas consectetuer eros quis massa. Mauris semper velit vehicula purus. Duis
lacus. Aenean pretium consectetuer mauris. Ut purus sem, consequat ut, fermentum sit amet,
ornare sit amet, ipsum. Donec non nunc. Maecenas fringilla. Curabitur libero. In dui massa,
malesuada sit amet, hendrerit vitae, viverra nec, tortor. Donec varius. Ut ut dolor et tellus
adipiscing adipiscing.
Column span
Causes Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit.
Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.
Suspendisse potenti
Mechanisms Fusce eleifend neque sit amet erat.
Donec mattis, nisi id euismod auctor, neque
metus pellentesque risus, at eleifend lacus
sapien et risus.
Mauris ante pede, auctor ac, suscipit quis,
malesuada sed, nulla.
Phasellus feugiat, lectus ac aliquam molestie,
leo lacus tincidunt turpis, vel aliquam quam
odio et sapien.
Header & Footer Rows
A table using a header or footer row should repeat the header/footer row across pages:
bpmTopicC Class
Col and Row Header Second column header Third column header
Row header 1 This is data This is data
Row header 2 This is data This is data
Row header 3 This is data This is data
Row header 4 This is data This is data
Row header 5 Also data Also data
Row header 6 Also data Also data
Row header 7 Also data Also data
10/22 mPDF Example File 3-05-2017
mPDF Example File
Col and Row Header Second column header Third column header
Row header 8 Also data Also data
Row header 9 Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Another Row header Also data Also data
Col and Row Footer Second column footer Third column footer
Autosizing Tables
Periodic Table of elements. Tables are set by default to reduce font size if complete words will not fit
inside each cell, to a maximum of 1/1.4 * the set font-size. This value can be changed by setting $mpdf-
>shrink_tables_to_fit=1.8 or using html attribute <table autosize="1.8">.
mPDF Example File 11/22
mPDF Example File
Periodic Table
1A 2A 3B 4B 5B 6B 7B 8B 8B 8B 1B 2B 3A 4A 5A 6A 7A 8A
H He
Li Be B C N O F Ne
Na Mg Al Si P S Cl Ar
K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr
Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe
Cs Ba La Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn
Fr Ra Ac
Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu
Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr
12/22 mPDF Example File 3-05-2017
mPDF Example File
Rotated Tables
This is set to rotate -90 degrees (counterclockwise).
Periodic Table
1A 2A 3B 4B 5B 6B 7B 8B 8B 8B 1B 2B 3A 4A 5A 6A 7A 8A
H He
Li Be B C N O F Ne
Na Mg Al Si P S Cl Ar
K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr
Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe
Cs Ba La Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn
Fr Ra Ac
Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu
Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr
mPDF Example File 13/22
mPDF Example File
Rotated text in Tables
Periodic Table
Element type 1A Second line
Element type longer 2A
Element type 3B
Element type 4B
Element type 5B
Element type 6B
7B
8B
Element type 8B R
8B
Element type 1B
2B
Element type 3A
Element type 4A
Element type 5A
Element type 6A
7A
Element type 8A
H He
Li Be B C N O F Ne
Na Mg Al Si P S Cl Ar
K
Ca
Sc
Ti
Va
Cr
Mn
Fe
Co
Ni
Cu
Zn
Ga
Ge
As
Se
Br
Kr
Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe
Cs Ba La Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn
Fr Ra Ac
Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu
Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr
14/22 mPDF Example File 3-05-2017
mPDF Example File
Nested Tables
Text before table
This is
data
This is
data
Row A A2 A3 A4
Row B B2 B3 B4
Row C C2 Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas
feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar
dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus
metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede,
auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci.
C4
Row D D2 D3 D4
This is
data
This is
data
This is
data
Row A A2 A3 A4
Row B B2 B3 B4
Row C C2 Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas
feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar
dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus
metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede,
auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci.
C4
Row D D2 D3 D4
This is
data
This is
data
This is
data
Row A A2 A3 A4
Row B B2 B3 B4
Row C C2 Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas
feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar
dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus
metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede,
auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci.
C4
Row D D2 D3 D4
This is
data
This is
data
This is
data
Row A A2 A3 A4
Row B B2 B3 B4
Row C C2 Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas
feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar
dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus
metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede,
auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci.
C4
Row D D2 D3 D4
This is
data
This is
data
This is
data
This is data This is
data
This is
data
This is data This is
data
This is
data
This is
data
This is data This is
data
mPDF Example File 15/22
mPDF Example File
Text before table
Row
1
This is data Text before table
Row AA2A3A4
Row BB2B3B4
Row CC2C3C4
Row DD2D3D4
Text after table
This
is
data
Row
2
This is data This is data This
is
data
Row
3
Row
A
A2A3 A4
Row
B
B2 B4
Row
C
C2
F1 F2
Nulla felis erat,
imperdiet eu, ullamcorper
non, nonummy quis, elit.
Suspendisse potenti. Ut a
eros at ligula vehicula
pretium. Maecenas feugiat
pede vel risus. Nulla et
lectus. Fusce eleifend
neque sit amet erat.
Integer consectetuer
nulla non orci. Morbi
feugiat pulvinar dolor.
Cras odio. Donec et
nulla. Sed quis orci.
G2
C4
Row
D
D2D3 D4
Row AA2A3A4
Row BB2B3B4
Row CC2C3C4
Row DD2D3D4
This
is
data
Row
4
This is data
Row
A
A2A3 A4
Row
B
B2 B4
Row
C
C2
F1 F2
Nulla felis erat, imperdiet
eu, ullamcorper non, nonummy
quis, elit. Suspendisse
potenti. Ut a eros at ligula
vehicula pretium. Maecenas
feugiat pede vel risus. Nulla
et lectus. Fusce eleifend
neque sit amet erat. Integer
consectetuer nulla non orci.
Morbi feugiat pulvinar dolor.
Cras odio. Donec et nulla.
Sed quis orci.
G2
C4
Row
D
D2D3 D4
This
is
data
16/22 mPDF Example File 3-05-2017
mPDF Example File
Forms
Textarea
Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet
ipsum id enim tempus dictum. Quisque viverra.
Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim
tempus dictum. Quisque viverra. Etiam id libero at magna pellentesque aliquet.
Nulla sit amet ipsum id enim tempus dictum. Quisque viverra. Etiam id liber...
Select followed by text
Incomplete record - pending
Input Radio No Keep Choice
Input Text
10.1258/jrsm.100.5.211
Input Password
******
Checkboxes
Not selected
Disabled
Selected
Submit Button Reset
mPDF Example File 17/22
mPDF Example File
Annotations
Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna.
Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec
luctus. Cras euismod tellus vel leo. Cras tellus. Fusce aliquet. Curabitur tincidunt viverra ligula. Fusce
eget erat. Donec pede. Vestibulum id felis. Phasellus tincidunt ligula non pede. Morbi turpis. In vitae dui
non erat placerat malesuada. Mauris adipiscing congue ante. Proin at erat. Aliquam mattis.
P: Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at
ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet
erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id
euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus.
Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien.
Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus
luctus euismod. Donec et nulla. Sed quis orci.
18/22 mPDF Example File 3-05-2017
mPDF Example File
Full Images & Barcode
On the first and last page of this document, an image is reproduced full page size by placing it inside a
DIV element with CSS "position:absolute". In all other situations, images are constrained to the width
and height of the printable page (i.e. inside the margins). The image on the back page has CSS
"opacity:0.5".
/* ALTERNATIVE PHP METHOD */
$mpdf->SetAlpha(0.5);
$mpdf->Image('clematis.jpg',0,0,210,297,'jpg','',true, false);
// the last "false" allows a full page picture
$mpdf->SetAlpha(1);
The back cover also has an ISBN barcode
/* ALTERNATIVE PHP METHOD */
$mpdf->writeBarcode('978-0-9542246-0-8', 1, 130, 230, 1,0, 3,3,4,4);
But next is inserted the Index, which can also be done like this:
/* ALTERNATIVE PHP METHOD */
$mpdf->AddPage('',NEXT-ODD'','','','','','','','','','','','','','',-1,-1,-1,-1);
$mpdf->WriteHTML('<h2>Index<bookmark content="Index" /></h2>');
$mpdf->WriteHTML('<indexinsert cols="2" font="serif" div-font="sans-serif" links="on" />');
mPDF Example File 19/22
mPDF Example File
20/22 mPDF Example File 3-05-2017
Index
A
Annotations 18
B
Barcode 19
F
Forms 17
H
HTML Markup 1
Hyphenation 4
I
Image, full-size 19
L
Lists 6
T
Table, automatic column width 10
Table, autosizing 11
Table, column span 10
Table, header rows 10
Table, lists inside 10
Table, nested 15
Table, rotated 13
Table, rotated text 14
Table, styles 8
Tables 8
ISBN 978-0-9542246-0-8
9 780954 224608 >