I'm doing some low-level extracting of images directly out of a PDF file with PHP, since GhostScript is too slow, and I'm doing pretty well. But the problem is that I can't figure out where it says which page an image belongs to. I have no problem getting the images out of the PDF, but I'm having trouble figuring out the order of them.
Where in the PDF data does it say what page an image is supposed to be displayed on?