bruckerrlb Posted November 30, 2009 Share Posted November 30, 2009 I'm using fpdf to generate pdf's on the fly here, basically how it works is I have my variables print out directly on an image using the text() function. The text function has a few paramaters, directly from the fpdf website Parameters x Abscissa of the origin. y Ordinate of the origin. txt String to print. I'm having a problem finding the "origin". I'm using graphclick to find these two parameters, but I'm wondering if anyone can recommend an application or another method for finding this (app can be mac or windows) Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/ Share on other sites More sharing options...
Mchl Posted November 30, 2009 Share Posted November 30, 2009 origin is top left corner of given pdf page. Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/#findComment-968171 Share on other sites More sharing options...
bruckerrlb Posted November 30, 2009 Author Share Posted November 30, 2009 Thanks, do you know a program or method that could be used for finding the points from the origin? I know this belongs in a math forum but if you had to find the coordinates for this, how would you go about doing that? Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/#findComment-968198 Share on other sites More sharing options...
Mchl Posted November 30, 2009 Share Posted November 30, 2009 I just set up my unit to mm and position everything using dimensions in mm. Perhaps if you could be a bit more specific in describing your problem? Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/#findComment-968301 Share on other sites More sharing options...
bruckerrlb Posted November 30, 2009 Author Share Posted November 30, 2009 Sure, my problem is I'm trying to identify the points where I want my variables to print. Basically there's an unfinished project and I'm trying to finish it, in order to finish it, I have to make more pdf's on the fly. I'm using his example to turn an image into a PDF, and printing variables on the image, which will then be turned into the pdf. The main problem here is I can't figure out how he got his coordinates. Like when you say you used dimensions in mm, what program did you use to find out how far away in mm what your looking for was. $pdf->Text(16,32,"$City, $Zip"); Here's an example of something getting printed out, the parameters 16 and 32 are the x and y, and the two variables are what it's going to print out, I'm using mm also, but just don't see how he came to the conclusion that it was 16mm horizontal and 32mm vertically, I"m looking for a way I can figure out what the x and y value will be. I've been trying to get the values with graphclick, but it's giving me plots in some unit of measurement that isn't mm, or I"m using it completely wrong. I don't want to just "guess" because this will take years lol, but am running out of other options since I just can't seem to find a way to plot two points Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/#findComment-968367 Share on other sites More sharing options...
Mchl Posted November 30, 2009 Share Posted November 30, 2009 Assuming I know what format I'm generating (A4 usually) I know (by heart actually) it's dimensions in are 210mmx297mm. So whenever I create a new PDF script, I know roughly where I want to put my objects, and I use these rough dimensions. Then I generate PDF and do fine tuning until I (or my boss) are satisfied. graphclick is probably giving you domensions in pixels. Knowing pictures resolution in dpi (you can check it with IrfanView for example) you can calculate how many pixels are there per one mm of your picture. For example, 72dpi picture has 72 pixels per inch (way too little to look good when printed out). 1inch = 25,4mm so you have 72/25.4 = (approx) 2.83pixels per mm. For 300dpi picture it's more like 11.8 pixels per mm. Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/#findComment-968383 Share on other sites More sharing options...
bruckerrlb Posted December 1, 2009 Author Share Posted December 1, 2009 This is a great tutorial here, I appreciate it! Graphclick was giving me dimensions in pixels. I'm trying to take the example you gave me and use the formula to convert pixels to mm (working with an A4 and 300 DPI), but it's just adding up for me, so I'm going to do some fine tuning like you said you do, at least to get the first point to figure out wtf is going on here. I appreciate your explanation, and I"m sure I'll be using it as a reference here for while I'm doing the fine tuning. Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/#findComment-968969 Share on other sites More sharing options...
bruckerrlb Posted December 14, 2009 Author Share Posted December 14, 2009 Turns out I could find the coordinates in photoshop, I just needed to find the first one, and then could move my image to be based off that one point and it works great! Quote Link to comment https://forums.phpfreaks.com/topic/183423-fpdf-finding-the-abscissa-and-ordinate/#findComment-977152 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.