Postponed
Project:
PDF-IDcard
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2007 at 15:16 UTC
Updated:
17 Apr 2008 at 06:39 UTC
I've created a 300dpi A4 image, but when uploaded i've seen in the .module the pdf class is instanced without dimensions.
So i've overridden calling the method by my own.
To get background image filling the entire page you just should call the method with that arguments:
$pdf->image(string[uploadedFile] , int [x coord. = 0 ] ,[y coord = 0], int[width=297], int[height=210]);
If no width or height is passed, it's defaultly stretch image to 72dpi and go outside pdf page.
Comments
Comment #1
jredding commentedYou're right the function
does not set a width/height for the image as those are automatically calculated by the object IF the image is at 72dpi. You're image, however, is at 300dpi so the width/height are off compared to the PDF document.
The solution you propose, however, isn't very good because while it works great for you it won't work for others as its a hardset width/height.
Fortunately this is why I make these functions overrideable.
How do you currently have the template setup? Is it to an A4 page or to image?
I could easily modify the module so that the width/height settings are applied even if the settings aren't set to "image". This would at least make it easier to work with.
What are your suggestions on modifying the module to handle non-72 dpi images? (as TCPDF is set to work at 72dpi)
Comment #2
jredding commentedChanging this to a feature request, changing the title and setting as postponed as there are no plans to support anything other than 72 DPI.