Page 1 of 1

PDFLib Question!

Posted: Wed Oct 10, 2007 5:19 pm
by andrewthorp
Ok, I am not new to PHP, but I am not as comfortable with PDFLib, and I am aware that I am probably just doing something stupid, but this has really been bugging me!

Code: Select all

pdf_moveto($this->pdf, $this->baseX, $this->baseY);
pdf_lineto($this->pdf, $this->baseX+710, $this->baseY);
pdf_stroke($this->pdf);
My baseX = 0, and baseY is irrelevant.

For some reason, the line that it draws is 727 pixels long, even though 0 + 710 is stated.

Why is this happening? Any thoughts?

Posted: Wed Oct 10, 2007 5:22 pm
by feyd
I'm fairly sure the units aren't in pixels, but points.

Posted: Wed Oct 10, 2007 5:45 pm
by andrewthorp
if that is the case, would it not make sense to do this.

Say you are imposing for print, and the document is 8' x 11'.

Does it not make sense to say:

Code: Select all

pdf_moveto($pdf,0,0);
pdf_lineto($pdf,8*72,0);
pdf_stroke($pdf);

pdf_moveto($pdf,8*72,0);
pdf_lineto($pdf,8*72,11*72);
pdf_stroke($pdf);
Is this not how you impose by the inch?

Posted: Wed Oct 10, 2007 6:48 pm
by feyd
It may be at a different scale than 72. I don't use the PDFLib extension. I either use fpdf or ezpdf, depending on circumstances. Typically everything swings toward using ezpdf.