Generate PDF From Rendered Web Page (HTML and Flash)
I am trying to generate a PDF from a web page (or series of web pages开发者_StackOverflow中文版). The pages contain, not only HTML/Javascript, but also Flash images (graphs/charts/etc). I have been searching diligently for a library (.NET), but I have still to come up with something that works. (Note: I did find Winnovative's solution, but that has a different problem.) The killer for all these apps tends to be Flash requirement. The library can be FOSS/purchased/etc - I'm open to all suggestions at the moment.
Does anybody have any other options? Again, the Flash is what is causing the most problems. Thanks.
You may want to look at HTML2PDF. I just used their online demo against Joe Cartoon and it captured the flash. It is a service, not a library, but it seems to work.
A possible solution that seems to have worked is the FireShot API. I appreciate the other solutions, but they suffered from many of the same problems I had with the original solutions I tried.
Thanks again!
If you're so inclined you can give our EasyPDF SDK tool a try (disclaimer: I am on the engineering team that creates it). There's an evaluation copy available from pdfonline.com. It doesn't convert SWF files to PDF but it can capture Flash images that are embedded in Web pages. Some Flash images take longer to load than the rest of the webpage, so if you decide to try it, pay particular attention to a property called WaitTimeAfterPageIsLoaded which determines how long to wait for the page to load before beginning the conversion. The WaitTimeAfterPageIsLoaded property exists on both of the HTML conversions classes, IEPrintJob and IEExtendedPrintJob. As you can see we're fans of long descriptive class names :)
Anyhow I can't tell you with 100% certainty that it'll work without knowing more about your webpages, but it's worth a look if you're still looking for something. Cheers
There are several free solutions available, each with its own drawbacks. Most have very primitive HTML support, and won't render Flash content.
Prince XML, although expensive, is probably the best overall HTML-to-PDF solution out there, although even it probably doesn't support Flash.
There are also a few which use rendering engines from web browsers, which might support Flash. Take a look at wkhtmltopdf and wpdf.
精彩评论