Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Print to PDF with lpr

1,364 views
Skip to first unread message

Dotan Cohen

unread,
Mar 15, 2009, 5:50:12 PM3/15/09
to
I just noticed that I can in fact print PDF files this way, so the
problem is that I am trying to print an ODT file. How can I convert
that ODT to PDF on the command line? I have googled that before and
could not figure it out, even after installing OOo scripts and other
nasties.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü

Dotan Cohen

unread,
Mar 15, 2009, 5:50:10 PM3/15/09
to
I am trying to print to PDF with lpr:
$ lpr -P PDF todo.odt

I see that the file is put in the PDF jobs (using KDE's Kjobviewer)
but it doesn't get written anywhere. The $HOME/PDF directory exists,
in fact, I can print to PDF from Firefox with no problems. Any ideas
why this is not working from the command line? Thanks!

Tzafrir Cohen

unread,
Mar 15, 2009, 6:10:16 PM3/15/09
to
On Sun, Mar 15, 2009 at 11:47:43PM +0200, Dotan Cohen wrote:
> I just noticed that I can in fact print PDF files this way, so the
> problem is that I am trying to print an ODT file. How can I convert
> that ODT to PDF on the command line? I have googled that before and
> could not figure it out, even after installing OOo scripts and other
> nasties.

As mentioned in previous threads: abirod should be able to do that.

--
Tzafrir Cohen | tza...@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tza...@cohens.org.il | | best
ICQ# 16849754 | | friend


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Dotan Cohen

unread,
Mar 15, 2009, 6:30:15 PM3/15/09
to
> As mentioned in previous threads: abirod should be able to do that.
>

Thanks, Tzafrir. I had STFW, but I obviously did not STFA.

Michael Wagner

unread,
Mar 16, 2009, 5:40:11 PM3/16/09
to
* Tzafrir Cohen <tza...@cohens.org.il> 15.03.2009

> On Sun, Mar 15, 2009 at 11:47:43PM +0200, Dotan Cohen wrote:
> > I just noticed that I can in fact print PDF files this way, so the
> > problem is that I am trying to print an ODT file. How can I convert
> > that ODT to PDF on the command line? I have googled that before and
> > could not figure it out, even after installing OOo scripts and other
> > nasties.
>
> As mentioned in previous threads: abirod should be able to do that.

Or you can use the "cups-pdf" package.

-------------------------------------------------------------------------+
Package: cups-pdf |
Priority: optional |
Version: 2.5.0-1 |
Depends: ghostscript, libpaper-utils, cups-client, libc6 (>= 2.7-1) |
Pre-Depends: cups (>= 1.1.15) |
Suggests: system-config-printer-gnome | system-config-printer-kde | \ |
system-config-printer |
Description: PDF printer for CUPS |
CUPS-PDF provides a PDF Writer backend to CUPS. This can be used as a |
virtual printer in a paperless network or to perform testing on CUPS. |
. |
Documents are written to a configurable directory (by default to ~/PDF) |
or can be further manipulated by a post-processing command. |
. |
Homepage: http://www.cups-pdf.de |
Enhances: cups |
Tag: role::app-data, use::converting, use::printing, works-with::text, |
works-with-format::pdf |
-------------------------------------------------------------------------+

With this package you can make a PDF in every application.

Hth Michael

--
UNIX always presumes you know what you're doing.
You're the human being, after all, and it is a mere operating system.

signature.asc

Dotan Cohen

unread,
Mar 16, 2009, 6:00:15 PM3/16/09
to
> Or you can use the "cups-pdf" package.
>

That's what I am using. However, it appears that cups cannot accept an
ODF file as input. I suppose that OOo is internally converting the ODF
to PS for printing.

Matthew Smith

unread,
Mar 16, 2009, 6:50:13 PM3/16/09
to
Quoth Dotan Cohen at 2009-03-17 08:24...

>> Or you can use the "cups-pdf" package.
>>
> That's what I am using. However, it appears that cups cannot accept an
> ODF file as input. I suppose that OOo is internally converting the ODF
> to PS for printing.

Think there is a little confusion here that needs to be cleared up:

ODF if not supposed to be a printable format. It is the native format
used by OOo to store its working files for editing, not printing - it is
NOT a page description language like PDF or PostScript.

To print ODF, it needs to be rendered as a page description language
such as PDF, PostScript, etcetera. This is what happens when you select
'Export to PDF' in OOo.

Trying to think of a good analogy to clarify this. The best that
springs to mind is HTML. If you print an HTML file, you just get the
page source printed. If you print it from your browser, however, the
HTML, CSS, images, etcetera, are rendered in the familiar form that you
see when visiting a web page.

It would certainly be possible to write a command-line application to
convert ODF to PostScript, PDF etcetera. The document format is open so
there is nothing stopping anyone from cobbling something together with,
say Perl and XSLT. If nobody has done this and you don't fancy writing
it yourself, I'm afraid that you will still need to use OOo to render to
a printable format.

Hope this makes sense.

Cheers

M

--
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business: http://www.smiffytech.com/
Blog/personal: http://www.smiffysplace.com/
LinkedIn: http://www.linkedin.com/in/smiffy
Skype: msmiffy
Twitter: @smiffytech

randall

unread,
Mar 16, 2009, 7:00:25 PM3/16/09
to
Matthew Smith wrote:
>
> It would certainly be possible to write a command-line application to
> convert ODF to PostScript, PDF etcetera. The document format is open
> so there is nothing stopping anyone from cobbling something together
> with, say Perl and XSLT. If nobody has done this and you don't fancy
> writing it yourself, I'm afraid that you will still need to use OOo to
> render to a printable format.

i've never done it myself and can provide very little useful tips but i
know that you can run openoffice "headless" to do exactly that and
several folks do. i think you can google for several examples for the
needed scripts.

>
>


--

www.songshu.org
Just another collection of nuts

Dotan Cohen

unread,
Mar 16, 2009, 7:10:09 PM3/16/09
to
> Think there is a little confusion here that needs to be cleared up:
>
> ODF if not supposed to be a printable format.  It is the native format used
> by OOo to store its working files for editing, not printing - it is NOT a
> page description language like PDF or PostScript.
>

I now know that. But I didn't just a day ago!

> To print ODF, it needs to be rendered as a page description language such as
> PDF, PostScript, etcetera.  This is what happens when you select 'Export to
> PDF' in OOo.
>
> Trying to think of a good analogy to clarify this.  The best that springs to
> mind is HTML.  If you print an HTML file, you just get the page source
> printed.  If you print it from your browser, however, the HTML, CSS, images,
> etcetera, are rendered in the familiar form that you see when visiting a web
> page.
>
> It would certainly be possible to write a command-line application to
> convert ODF to PostScript, PDF etcetera.  The document format is open so
> there is nothing stopping anyone from cobbling something together with, say
> Perl and XSLT.  If nobody has done this and you don't fancy writing it
> yourself, I'm afraid that you will still need to use OOo to render to a
> printable format.
>
> Hope this makes sense.
>

Thanks, Matthew. The problem with ODF is that there is no reference
implementation. Not all programs will display it as OOo. But I just
discovered this OOo extension which allows the user to save the
document as PDF with the ODF file embedded for editing:
http://extensions.services.openoffice.org/project/pdfimport

This is, in my opinion, the perfect document format. The only thing
missing from the extension is better save support, as the user
currently must be careful to export (not save) as a Hybrid PDF file.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü

Johannes Wiedersich

unread,
Mar 17, 2009, 8:00:10 AM3/17/09
to
Dotan Cohen wrote:
> But I just
> discovered this OOo extension which allows the user to save the
> document as PDF with the ODF file embedded for editing:
> http://extensions.services.openoffice.org/project/pdfimport
>
> This is, in my opinion, the perfect document format. The only thing
> missing from the extension is better save support, as the user
> currently must be careful to export (not save) as a Hybrid PDF file.

>From that page:
> It is the perfect solution for changing dates, numbers or small
> portions of text.

I don't think that this practicable, if you continue to work with your
document for repeated 'edit, print' cycles.

For batch conversion (and printing) look at
$ aptitude show unoconv
[...]
Description: converter between OpenOffice.org document formats
This package provides a commandline utility which can convert from any
document format that OpenOffice can import to any
document format it can export. It uses OpenOffice's UNO bindings for
non-interactive conversion of documents.

Supported document formats include Open Document format, MS Word, MS
Office Open/MS OOXML, PDF, HTML, XHTML, RTF, Docbook,
and more.
Homepage: http://dag.wieers.com/home-made/unoconv/

(I haven't tried it myself.)

Cheers,
Johannes

Dotan Cohen

unread,
Mar 17, 2009, 8:20:10 AM3/17/09
to
> >From that page:
>> It is the perfect solution for changing dates, numbers or small
>> portions of text.
>
> I don't think that this practicable, if you continue to work with your
> document for repeated 'edit, print' cycles.
>

In my experiments so far it's worked fine, but I will have to look at
the more advanced functions to know.

> For batch conversion (and printing) look at
> $ aptitude show unoconv
> [...]
> Description: converter between OpenOffice.org document formats
>  This package provides a commandline utility which can convert from any
> document format that OpenOffice can import to any
>  document format it can export. It uses OpenOffice's UNO bindings for
> non-interactive conversion of documents.
>
>  Supported document formats include Open Document format, MS Word, MS
> Office Open/MS OOXML, PDF, HTML, XHTML, RTF, Docbook,
>  and more.
> Homepage: http://dag.wieers.com/home-made/unoconv/
>
> (I haven't tried it myself.)
>
> Cheers,
> Johannes
>

I have looked at unoconv and I will look into it again now with a
clear head. Thanks.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü

0 new messages