Print HTML to PDF via Konqueror

Ryo Furue furue at hawaii.edu
Fri Dec 26 23:42:59 GMT 2008


Dotan,

| > Can't you just open the HTML page in a browser and then print it?
| >
| > KDE (and most GUI UIs) are designed to print from applications (except
| > for PS files) so trying to print without using an app isn't really an
| > easy thing to do.
| >
| 
| No, this is being used in a script.

I've been watching this thread with interest because I also like to do
things like that.  I've been looking around and seen some potential
solutions.  The general theme I'm pursuing is, how to script
applications?

One possibility (though I haven't confirmed that it works) is to use
the plugin "iMacros" on FireFox.  For example, the framework includes
a command to print the current webpage:

   http://wiki.imacros.net/Demo-Print

I suppose you can edit your macro locally.
It also seems that macros can be run via URLs:

   http://wiki.imacros.net/iMacros_for_Firefox

So, basically, I guess you can use them from the command line as

  #!/bin/sh
  macro=.firefox/iMacros/print-url.iim
  sed -i s[URL-TO-PRINT][http://url.com/to/print/index.html] $macro
  firefox -new-window "http://your.macro.host.net/print-url.iim"

I'm afraid I don't know how easy or hard this is (or even
whether it's really possible).

Another possibility is XUL, which seems to be a general
framework of controlling existing applications through scripting.
For example, mozilla-xremote-client seems to be using this
framework.  But, this is very speculative on my part.  I may
be totally wrong.

On a related note, I want this kind of stuff (controlling apps
through scripting) to be more readily available on Linux.
I heard that Microsoft applications can be controlled from
Visual Basic, like so

  Set xlObj = CreateObject("Excel.application")
  xlObj.Workbooks.Open "C:\somefile.xls"
  xlObj.Do things . . .
  xlObj.Quit

(taken from some website).  I also heard that Mac apps can
be controlled form Apple Script or Objective C or something.
How nice.

Regards,
Ryo
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list