• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

HTML/CSS to PDF?

Ka0t1x

Golden Member
Is there an easy/free way to take a rendered HTML/CSS file to a PDF? I know of HTMLDoc and PDFLib but that's kinda poorly supported in the ways of CSS.

I see this XHTML2PDF but $500 is pretty steep.
 
I guess I should have specified, creating a pdf from HTML as in, click a link, presented with the current page as PDF.
 
Prince probably has the best CSS support of anything you will find (perhaps not a coincidence that the fellow that originally proposed CSS is the company's director...), but you won't like its price any better.

The only other option I'm really familiar with is HTMLDOC, which as you say has its limitations.

If nothing else, at least my post serves as a bump for the thread 🙂
 
Yeah that seems to be the best, a client wants a similar feature in a webapp I'm working on so I guess an extra $500 goes on the quote.
 
There are some solutions to be found free (off the top of my head, I remember seeing something before, called "HTML2PDF" or something like that, a freebie written in PHP).

Unfortunately, I also remember being rather unimpressed (actually downright disappointed) with these solutions. They all pretty much weren't worth the trouble, pretty hit or miss. If you are working on something for a client, then it will be much better to tell him that his particular feature request will cost $500 due to necessary software acquisition.
 
It seems like there should be some way to automate Internet Explorer to load the page and print to CutePDF, probably with VBScript, and maybe without even displaying the page on any server screen. But I haven't done anything like that in a long time.
 
The System.Windows.Forms.WebBrowser .NET control would let you render the page. It has a Print method you could leverage to send to a PDF.

You could probably script it using PowerShell, although I don't know enough about it to offer guidance as to how.
 
This will be for a varied environment, which is why I offered up HTMLDoc and PDFlib as examples. The service runs on the server, which processes the PDF and then sends it to the client as a download. Client OS/Browser has no affect in how the PDF is presented/rendered.

I'm kind of thinking about a webkit solution (DIY) but for $500 and coding up some XML for Prince, I might just go that route. The client will be needing a whole web server to be setup (intranet), so an extra software package purchase like that shouldn't be a problem.

If it is, I already have code for HTMLDoc, and they can have simple printed pages.
 
Last edited:
Back
Top