Welcome Joleen.
If you want something like
khtml2png but restricted to a section of your page, then you'll need more than just GD.
Those fancy html-to-image converters all use a browser or a browser library to open you page and take a screen capture of the result.
I guess the converter should be able to get the coordinates of your "DIV" from the browser (javascript can do that). Then your script could use GD to crop the image based on those coordinates. I have not yet seen a converter that does that "out of the box".
Another idea is to modify the page to add some kind of way for GD to identify the section you want to crop... for instance a thick border of some arbitrary color (you can do that using CSS). Then you can use any converter to convert your page to an image. Finally, you can use GD to identify the region that needs to be cropped and crop it (don't ask me for the exact code). This is not a perfectly reliable method, but at least it won't require you to modify the converter. You can also try using CSS to absolutely-position your "DIV" at the top-left of the page. This will make it easier for your GD code to identify the region that needs to be cropped, but, depending on context, it might also modify the width of your "DIV" and you'll need to set a non-transparent background on your "DIV".
For better advice, we'll need to know exactly what you are trying to do.
Do you have control on those pages or do they come from a third-party website?
I guess your converter does not have to be 100% generic, since you need to identify the "given DIV".
BTW, how do you identify that "given DIV"? By ID?
Cheers.