LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-14-2005, 11:28 PM   #1
bhar0761
Member
 
Registered: Jul 2005
Location: San Francisco
Distribution: Fedora Core 6
Posts: 64

Rep: Reputation: 15
html2ps multiple files


I would like convert multiple html files to ps. Does anyone know how to do this?
The reason why is because i have a script that watches a folder and when something is in that folder i would like to print it. Since i can't print html files using lp or lpr i have to convert them first to ps and then print them. I will not now the name of the files that are in the folder at any given time.

Last edited by bhar0761; 08-16-2005 at 05:48 PM.
 
Old 08-15-2005, 12:21 AM   #2
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Have you tried html2ps...? http://user.it.uu.se/~jan/html2ps.html

It does exactly what you think it should
Code:
#!/bin/bash
for f in *.html; do
    html2ps $f > $f.ps
done
Cheers,

mj
 
Old 08-15-2005, 12:31 AM   #3
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
Quote:
Originally posted by mjrich

#!/bin/bash
for f in *.html; do
html2ps $f > $f.ps
done[/code]
Cheers,
mj
or:

#!/bin/bash
for i in $(ls -1 *.html | cut -d"." -f1); do
if [ -f $i.ps ]; then
echo "$i.ps exists! skipping..."
continue
else
html2ps $i > $i.ps"
fi
done

which will check if the target output already exisits, skip it and then process the
next html file (if html2ps has this facility, ignore my post. )

hth.
 
Old 11-08-2009, 12:01 PM   #4
fellipe
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
Hi!
I found this information very usefull, but it did't work for me.
The script you post only converted a few files, 65 of 227. It seems there is a problem with the files with spaces.
I also tried doing a nautilus script which didn't work too:
Code:
#!/usr/bin/env python
# -*- coding: latin-1 -*-

import sys, os

sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),".."))
import Process

if Process.verifyCommands("html2ps")==False:
	sys.exit()

Process.ProcessFiles(
	"html2ps $FILE$ > $NAME$.ps", # comando a ejecutar
	"", # tipo de archivos
	"") # mensaje final
Well, I need your help people, I didn't find a solution after hours. I have over 1000 html to convert, so I expect to have the script to do so.

Thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
untar multiple files redhax8 Linux - Software 2 10-18-2004 01:13 AM
Moving multiple files krazykow Linux - Software 3 09-03-2004 05:20 PM
multiple files in VIM james.farrow Linux - Newbie 3 07-09-2004 05:46 AM
Help I need help tarring multiple files in multiple directories VisionZ Linux - Newbie 28 03-25-2004 05:25 PM
Untarring multiple files? chup Linux - General 7 10-16-2003 09:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration