posted 14 years ago
The short answer is: it can't be done.
The long answer is: Check out the PDFRenderer library. Since it can render PDFs on screen, it must somehow be able to extract formatting information. Since it's open source, you can study it to find out how it does it. Once you have the formatting information, you can generate CSS from it. I'd estimate it to be a week's worth of time before this works for even simple documents, much less for random documents.