Converting HTML to doc(x) and / or PDF [closed]

2019-04-02 14:00发布

问题:

I have to convert html to the doc(x) and pdf format.

I found aspose, but this tool can do a lot of more work than i need, and thats why it isn't really cheap.

Are there similar tools, which can just do this conversion ?

I need this on a Desktopapplication where no word / office is installed

*Just for Info Finally bought asponse words. all other options weren't as good as this tool

回答1:

Assuming that these are essentially “documents” and not fancy graphical web pages (i.e. you'd like them to be legible, but aren't deeply concerned with the minutiæ of web layout formatting), you can use LibreOffice to convert them; either manually (open, export as…) or using the "headless" mode, e.g.:

soffice -headless -convert-to pdf -outdir pdfs/ *.html
soffice -headless -convert-to doc -outdir docs/ *.html

Free, cross-platform, but a bit of a hefty install. (I think it's nearing the half-gigabyte mark for the full suite with all the plug-ins installed, but you should only need the Writer component)



回答2:

Maybe this http://kitpdf.com might help. I tried it, it's free and really easy to use.



回答3:

You can use ABCPdf:

http://www.websupergoo.com/products.htm



回答4:

I can't speak for docx format, but you might look into DocRaptor to convert HTML to PDF format. It definitely handles CSS styling better than comparable programs, and doesn't just give you an image like creating a PDF with Photoshop.



回答5:

If the webpage is or can be hosted then you can download an extension for Google Chrome called Screen Capture, this allows you to take a full screen grab of the webpage then you can paste it into Photoshop and Save As a .pdf (that is assuming you have Photoshop that is)