Dynamic HTML to PDF [closed] - html

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I need to be able to convert dynamic HTML (html that is rendered on page load by javascript) to a PDF. I know there are plenty of HTML to PDF converters but none of the ones I have found thus far cope with dynamic HTML.
The given tool should be able to successfully convert the following page - http://www.simile-widgets.org/timeline/
Cheers
Anthony
UPDATE:
I don't need the JavaScript functionality here... i.e. i don't need to be able to interact screen... I just want the finial rendering of the screen to be captured in the PDF - like taking a photo after the page is loaded. And in the example I provided the javascript is only rendering divs to the screen so its nothing that it shouldn't be able to handle as long as it "lets" the "page" render first.

There is no way it can be done. The interfaces available for scripts in PDF are extremely limited compared to the full DOM and BOM access you enjoy in a web browser. Such interaction as you can achieve in PDF is not readily translatable from how it works in a browser and would almost certainly need hand authoring.
Your example page has many effects that PDF, as an essentially static document layout format, simply cannot reproduce at all.
Edit:
I just want the finial rendering of the screen to be captured in the PDF
Ah, OK, that's a far easier and more common problem then.
In that case you'll have to use and automate a real web browser (like Firefox), or a toolkit that provides all the logic of a web browser (like WebKit), then either:
export to PDF, either using built-in tools like ‘Print to file’ in Firefox (with background images/colours turned on) or one of the PDF export add-ons, or
take a image snapsnot of the browser (and include the image in a PDF if you have to)
See these questions for some discussion of browser snapshotting.

The fact that it uses any JavaScript at all means a lot of converters won't work. The JavaScript may be simple, but you still need an interpreter to handle it.
I haven't used it for myself, but you might try wkhtmltopdf. It uses the webkit rendering engine, and I believe it includes full javascript support. You would need to be able to install the software and run the executable, but otherwise it should be fairly straightforward.

You could use a javascript URI to alert the current DOM. eg:
javascript:alert("<html>" + document.documentElement.innerHTML + "</html>")
Copy the HTML and save to a file.
Then run it through the HTML2PDF converter.

dynamic-html-pdf
This is best library for node js convert dynamic html to pdf.
https://www.npmjs.com/package/dynamic-html-pdf

You can probably use PhantomJS or headless chrome.

Try xhtml2pdf. Here's the project page at python.org.

Related

How to embed PDF in a web page without javascript [duplicate]

This question already has answers here:
Recommended way to embed PDF in HTML?
(30 answers)
Closed 9 years ago.
I want to show pdfs in certain pages on my site. I've experimented with google's viewer api and it works great but I dont want to depend on a third party api call. I also want it to be as robust and reliable as possible, so I'm trying to avoid javascript. I see some indication that it can be done with just HTML using either or tags, but there appears to be disagreement as to the browser support: Recommended way to embed PDF in HTML?
Is there a definitive way to do this?
I need to support IE8+ and the site will be responsive, so the solution has to be able to accommodate smaller screen sizes.
Attention duplicate police: The entire basis for this question is to figure out what is specifically NOT answered in the other question. I even linked to that question in my ow
If you don't want to use JavaScript -- no, there is not.
Even if there is a good enough solution for some OS with something like Acrobat Reader installed (maybe you get lucky with Windows), all the other OSes still don't support it.
So, if you want your site to be seen more or less the same way by everybody, you'll have to go with Javascript base things and their not so robust and reliable support -- they are pretty portable, that's a great thing on the web.
Related:
Open Source Javascript PDF viewer
Why Use a Javascript PDF Viewer

Convert pdf, doc, ppt to html5 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've googled (without any luck) for open source software that can convert doc, ppt, and pdf to HTML5. (Exactly what Scribd does) Are there open source equivalents to the type of conversion Scribd does?
If anyone knows of a paid service, that would also work. Scribd has an API, but that's for use with the flash viewer. Also, I would like to host my own content as I need further control over converted html document.
You're unlikely to find a single offering that does all this, especially in the open source world. It's more likely that you'll end up relying on a mishmash of things, and may even need to chain some converters in order to get to HTML. (Eg PDF -> ps -> HTML)
OpenOffice supports conversion to HTML, and can be called from the command line.
http://pdftohtml.sourceforge.net/ looks reasonably good at converting pdf to html.
For Doc that is Word ML or OpenXML format it's conceivable that you could use XSLT transforms since both input and output formats are XML. I've seen some stylesheets floating around the net that do this, but YMMV.
Incidentally, why is there a specific requirement for open source? MS Powerpoint already supports save-as-HTML for example.
Open Office will convert pdf to html but you'll take a hit to design quality.
I suggest either: Crocodoc as a paid service (It provides different flavours for different platforms such as Python,Ruby,Java,PHP Developers are allowed to work on their APIs.) or waiting for an official Adobe tool (it's in the works).
For PDF to HTML conversion, pdf2htmlEX seems like a pretty good tool (looking at all the examples/samples):
https://github.com/coolwanglu/pdf2htmlEX
For pdf there is an open source project started by mozilla and it's very good: https://github.com/mozilla/pdf.js/
You can see a hello world example : https://github.com/mozilla/pdf.js/tree/master/examples/helloworld
For the rest of document types I think LibreOffice said that are planning to build something in html5, but so far there isn't anything done.
http://wvware.sourceforge.net/
wvHtml: convert your Word document
into HTML4.0.
Possibly:
http://www.abisource.com/
but in this case it looks like "open doc" > "export html" manually, maybe plugins help. Not sure, what do you mean: "source software that can convert".
Or this:
http://www.zope.org/Members/sf/NuxDocument
Also the pdftohtml will give you an html page output.But you will have to work upon its graphical interface.Since it doesn't seems to be very interactive.
I know the question is bit old however I have found new Open source tool called flaxpaper http://flexpaper.devaldi.com/

about HTML code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
What editor or IDE can I use to write html code?
I mean that I write my C++ code in Visual Studio, for example...
so where can I write HTML code?
Have a look at Notepad++ - it's not an IDE but a great editor with syntax highlighting for many languages (such as HTML).
I'm deploying Aptana Studio. Makes a very nice and professional cross-platform developer tool with code hinting not only for (X)HTML but JavaScript/jQuery as well. Very pleased with it.
I can't state the same about Dreamweaver though.
I would suggest using an editor such as Adobe Dreamweaver to begin. However, to answer your question you can write HTML in notepad or any text editor. Simply save the file with a .htm or .html extension, and your file will be executed with any browser.
You can write HTML with any text editor.
But you might want to have a look at Looking for a simple HTML text editor for Windows.
If you want to learn HTML, you should avoid WYSIWYG-editors such as Dreamweaver.
You could use a normal text editor. Powerful editors such as VEDIT have syntax highlighting for HTML and CSS, help entering HTML tags with specific buttons, menu items and snippets, and even have complex functionality for manipulating tables etc.
The advantage of using text editor is that you can use the same tool for all your editing, including programming, so the tool is familiar for you. (However, that may not be your case since you use Visual Studio.)
If you do not use a text editor for other purposes, the best option is to get a dedicated HTML editor, such as HTML Kit. It is a freeware editor specifically created for editing HTML, and it contains lots of useful toos, such as HTML Tidy. But you are still editing the HTML code instead of trying to do "desktop publishing" with WYSIWYG.
More HTML editors can be found from the Wikipedia page Comparison of HTML editors (but that includes WYSIWYG-editors, too).
Read http://www.w3schools.com/html/default.asp for information on HTML
You can write it in whatever texteditor you want, try Aptana Studio for instance. Just save the file with a .HTML or .HTM extension and open the file in you browser.
As Sev says, Dreamweaver is certainly a good tool for beginners.
If you just want to play around in HTML, you can also use an online WYSIWYG editor such as
http://htmledit.squarefree.com/
http://www.online-html-editor.org/
If your goal is to make a website, I would install a CMS such as Wordpress or Joomla. Then you can edit the HTML directly when it is necessary for advanced features, but you don't have to.
You can write HTML in Visual Studio, for example. However, you would usually make a web application in Visual Studio, not just a single HTML page.
I use Notepad to write single HTML pages. It has nothing special that helps you to write HTML, but on the other hand it's as simple as it gets, so nothing gets in your way.
If you write HTML code in Notepad, you have to write everything manually. If you use a software product designed for web development such as Adobe Dreamweaver and MS Expression Web, it will create code for you as you drag and drop controls. You can also look at the code file and edit it when you want.
I do all my web development in gVim. It is hands down the best syntax highlighter/autoindenter I've found, and has tons of little shortcuts that make editing text files very quick.
If you're not doing a ton of development, though, maybe you should just stick to Notepad, as it's something almost everyone is quite familiar with.
Check out w3schools.com for some great tips on getting started with HTML and all the other joyous languages you might want to learn as well.

HTML online minimizer/compressor? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Does anyone know of a good online generator to take the source code of an HTML page and compress/minimize the entire page.
Meaning, compress/minimize all embedded CSS, JavaScript and obviously the HTML of that web page while also removing unneeded HTML/CSS/JavaScript comments, spaces, tabs, etc?
Juriy Zaytsev wrote an HTML minifier in JavaScript, which you can use online on this page: http://kangax.github.com/html-minifier/
As the warning says, it’s still an early alpha, so there might be bugs. Use with caution!
http://prettydiff.com/ - This is written in JavaScript so you can use it instantly in your browser.
There's an online compressor that does minimize all embedded CSS and JavaScript blocks and also the HTML. It produces a single line output code which renders as the original and respects the document structure.
It uses Yahoo YUI Compressor and Google Closure compiler for JavaScript.
Check it here: HTMLcompressor.com
This is the best minifier I found till date.
Check it here: Html, Javascript as well as CSS minifier
A duplicate of https://stackoverflow.com/questions/728260/html-minification ?
And if you do not really need an ON-Line tool, then PageSpeed plugin for Firefox and the Yahho compressor are both really good minifiers. Also the PageSpeed tool can give you hints what to change, and which change will give the biggest change in speed/size.
I came across a script that will minify your HTML, Inline CSS, Inline Javascript On The Fly.
Check here Dynamic Website Compressor
I recommend you to try WebMarkupMin Online.
These are the perfect minifiers:
For Javascript http://javascript-minifier.com/
For CSS http://cssminifier.com/
For PNG http://pngcrush.com/
For JPEG http://jpgoptimiser.com/
I use HTML JavaScript CSS Minifier for minify the entire HTML code (including CSS and Javascript).
You can also encrypt the Javascript parts on Javascript minifier encryptor to make it less readable but it increase the size of your file.

Delphi - Is there a suitable WYSIWYG HTML Editor Component for VCL/FMX app? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I need a WYSIWYG editor Component that I can use in the Delphi application to create the body of the email in HTML.
We've used TRichView just recently to do HTML email functionality and found it quite adequate. We did evaluate WpTools and it does do exactly what we wanted however for our needs it was just too expensive especially when we always try and purchase site licences.
One thing we did find with WpTools is that it did implement a visual component or set of visual components that you could drop onto a form that implement the whole WYSIWYG UI (e.g. toolbars and such). It took a bit longer with TRichView to achieve the same thing.
Regarding conversion from/to html - TRichView can export html natively, however requires third-party libraries to import html which unfortunately (for us) are not commercially backed (i.e. community driven). So we've resorted to storing all content in RichText natively and only when sending the email do we convert it to html. WpTools has the ability to import/export to html natively.
I have been looking for this as well for several years now.
The best solution I found, until now, is WpTools from WpCubed. It's not an exact Html editor, but an advanced word processing component which offers a copy mode to and from html. I am currently working on using this component in my Sitestepper web creation software (in the StepEdit html-editor to offer wysiwyg possibility). I think that certainly for email editing this could be used (although maybe a bit pricy for what you are looking for). I know the author is working an a better exchange to and from html.
But to be honest, I don't think you will find anything if you need a Delphi component.
I used to use HtmlEdit from Purposesoft, but I think this product has got his limitations and it's not fully supported anymore. But maybe for your purpose it's ok.
I've used EmbeddedWB from bsalsa. Basically it is the same as Delphi's TWebBrowser, but you have access to more features of the IE automation object. In the browser I loaded an HTML which looks like:
<html>
<head>
<title>Edit description</title>
</head>
<body contenteditable="true">
</body>
</html>
Marking an element by IE specific attribute "contenteditable", the IE implementation let's you edit the element's inner HTML in a WYSIWYG manner. You can get the content by automation calls (check bsalsa.com to see how to read the edited content). If you get the basics it is pretty simple to create a full blown HTML editor.
Good luck!
My answer using Bsalsa Web Browser Components - very easy complete HTML editor/viewer.
delphi-how-do-i-make-a-basic-wysiwyg-html-editor-using-delphi
If using IE COM based components is not a problem then you can use this free product
http://bsalsa.com/product.html
I have just recently needed a free HTML WYSIWYG editor and I thinks this is the only thing out there. For me it works fine, but I don't need complicated elements. They can be done, but will a little more work.