PDFLib Question!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
andrewthorp
Forum Newbie
Posts: 2
Joined: Wed Oct 10, 2007 5:18 pm

PDFLib Question!

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm fairly sure the units aren't in pixels, but points.
andrewthorp
Forum Newbie
Posts: 2
Joined: Wed Oct 10, 2007 5:18 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply