printing labels on continuous paper

344 views
Skip to first unread message

tim dekkers

unread,
Sep 16, 2010, 6:15:22 AM9/16/10
to dompdf
Hi,

i tried fpdf, but it seems too limited to print labels in the way i
wanted which is
on a continuous paper with a width of 60mm.

Each label is 110mm height. So i need to print 3 lines of text exactly
in the middle of the label.
The paper size is most important. ( font type is irrelevant )

I have seen a set_paper in one of the docs but i am unfamiliar how to
use them.

Any one can give me a head start, how to start out.
Some sample of php code would be helpful.

regards
tim

Fabien Ménager

unread,
Sep 16, 2010, 4:31:59 PM9/16/10
to dompdf
Hello,
The set_paper takes two arguments : an array consisting of for float
numbers : x, y, width and height abd a second one, optional, with the
orientation of the paper.
I don't know what is the use for x and y, but width and height are
what you want.
They are expressed in Postscript points : http://en.wikipedia.org/wiki/Point_%28typography%29
For example, 110mm in points is :

110 / 0.3527 = 311.879785pt

so you'll have :

$dompdf = new DOMPDF();
$dompdf->set_paper(array(0,0,311.88,311.88));

and you'll have a PDF of 110mm x 110mm
Reply all
Reply to author
Forward
0 new messages