[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Konqueror: Save HTML page as PDF
From:       Albert Cervera i Areny <albert () nan-tic ! com>
Date:       2007-10-16 22:33:42
Message-ID: 200710170033.43387.albert () nan-tic ! com
[Download RAW message or body]

Hi Kaspar, I'd suggest you something similar to what Volker was looking for.
I attach a shell script that should do the trick. Unfortunately I can't make 
it work as cups complains that no printer has been selected. Maybe somebody 
else can tell us why this doesn't work.

Another problem is how you know a page has been fully loaded. You can look 
with dcop to see if there is any way to ask konqueror.

Hope that helps!

A Dimarts 16 Octubre 2007, Kaspar Fischer va escriure:
> Dear all,
>
> I need to archive webpages for a library and for this need to save
> HTML as PDF files. If possible, the page background and the layout
> should be retained (of course, it will get resized to A4 and be split
> into several pages - that's all fine).
>
> What would be the best approach to accomplish something like this?
> A script (in bash or whatever) is what I need in the end.
>
> Is DCOP and kprinter a good starting point?
> Or can Konqueror be called from the command line with appropriate
> options?
>
> I have never used DCOP so am a little at a loss how to get started.
>
> Many thanks for any pointers!
> Kaspar



-- 
Albert Cervera i Areny
http://www.NaN-tic.com

["konqui.sh" (application/x-shellscript)]

#!/bin/bash

if [[ -z "$1" || -z "$2" ]]; then
	echo "usage: konqui.sh url printer"
	exit
fi

export PRINTER="$2"
konqueror "$1" &
sleep 8
pid=$!

ref=$(dcop konqueror-$pid konqueror-mainwindow#1 currentView)
ref=$(dcop "$ref" part)
dcop "$ref" print true




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic