I’m using a script that takes some values from a form then creates a pdf report using FPDF (www.fpdf.org). It was originally used to do a quick analysis on a website ie title, meta keywords, meta descriptions, links, alexa ranking, etc. However, I didn’t need all those features for my purpose so I’m not using them.
I slightly modified the script to just take a few values that are inputed by the user and use that to create a pdf. It works fine, however I need a few quick tweaks.
I need the following done:
1) Add images in pdf and make sure they are placed exactly where I want them and also the correct size. There are 5 images needed with the except of 1 type of image having about 30 of the same type of image (logos). There is an admin panel for this script so you can either code in the feature to upload images or to allow embedding of the image locations.
2) Remove spacing from a form value that gets printed in the pdf. It’s one single space and I believe the php function ltrim can be used here. I’ve tried but the code is using fpdf so I don’t know how to get it to work.
3) Allow links in the pdf to use anchor text. For example, right now all links appear as http://somelinkhere.com whereas I would need to be able to use <a href=http://somelinkhere.com>Some Link Here</a> which would only display the “Some Link Here” in the pdf but still link to http://somelinkhere.com
4) Clean up some code that isn’t used. For example there are some lines of code that grab info from google, yahoo, alexa. I’ve commented some of these lines out but I would like to remove them and any other code that I am not using. Since this pdf report generator was initiall used for another purpose those features are not need. Just make sure the values from the forms are still used if possible since it’s those values that get used for content to be printed in the resulting pdf.
I have a sample pdf report that the script generates and I have a desired pdf report of what I need. So visually you’ll see exactly what I need done.