By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,035 Members | 1,408 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,035 IT Pros & Developers. It's quick & easy.

TIFF to PDF

P: n/a
Hello,

I'm looking for :
1/ the best method to convert tiff files to PDF.
2/ and I want to merge these pdf files.

thank you for your help

May 20 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
In <11*********************@z24g2000prd.googlegroups. com>, revuesbio
wrote:
I'm looking for :
1/ the best method to convert tiff files to PDF.
2/ and I want to merge these pdf files.
If it doesn't need to be done in pure Python I would use the
command line tools from libtiff: `tiffcp` to copy several tiffs into one
multipage tiff and `tiff2pdf` to convert it into PDF.

Ciao,
Marc 'BlackJack' Rintsch
May 20 '07 #2

P: n/a
I'm trying to use tifflib but i have some problems.
When i use direct command line like
"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf C:
\test.TIF
the pdf file is ok.

but when i try to launch command line via python the pdf file doesn't
create.

import os
os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

where is the problem ?

May 21 '07 #3

P: n/a
I'm trying to use tifflib but i have some problems :

when i use direct command line :
"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf C:
\test.TIF

the pdf is ok.

but when i try to launch command line via python the pdf file is not
created.
where is the problem ?
import os
os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

thank you

May 21 '07 #4

P: n/a
En Mon, 21 May 2007 07:42:21 -0300, revuesbio <re*******@gmail.com>
escribió:
os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')
\ is used as a escape character in strings.
Use either \\ or a raw string, that is:

os.system('"C:\\Program Files\\GnuWin32\\bin\\tiff2pdf.exe" -o
C:\\test.pdf C:\\test.TIF')
os.system(r'"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

(This should be added to the Python FAQ - the most related entry is about
raw strings ending in \)

--
Gabriel Genellina

May 21 '07 #5

P: n/a
On 21 mai, 13:01, "Gabriel Genellina" <gagsl-...@yahoo.com.arwrote:
En Mon, 21 May 2007 07:42:21 -0300, revuesbio <revues...@gmail.com>
escribió:
os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

\ is used as a escape character in strings.
Use either \\ or a raw string, that is:

os.system('"C:\\Program Files\\GnuWin32\\bin\\tiff2pdf.exe" -o
C:\\test.pdf C:\\test.TIF')
os.system(r'"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

(This should be added to the Python FAQ - the most related entry is about
raw strings ending in \)

--
Gabriel Genellina
Thank you very much,
all is ok!

May 21 '07 #6

P: n/a
Gabriel Genellina said unto the world upon 05/21/2007 07:01 AM:
En Mon, 21 May 2007 07:42:21 -0300, revuesbio <re*******@gmail.com>
escribió:
>os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

\ is used as a escape character in strings.
Use either \\ or a raw string, that is:

os.system('"C:\\Program Files\\GnuWin32\\bin\\tiff2pdf.exe" -o
C:\\test.pdf C:\\test.TIF')
os.system(r'"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

(This should be added to the Python FAQ - the most related entry is about
raw strings ending in \)
Better still, use / as the path separator. That works fine on both
windows and *nixes.

Best,

Brian vdB
May 21 '07 #7

P: n/a
En Mon, 21 May 2007 10:53:08 -0300, Brian van den Broek
<br***@cc.umanitoba.caescribió:
Gabriel Genellina said unto the world upon 05/21/2007 07:01 AM:
>En Mon, 21 May 2007 07:42:21 -0300, revuesbio <re*******@gmail.com>
escribió:
>>os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')

\ is used as a escape character in strings.
Use either \\ or a raw string, that is:
Better still, use / as the path separator. That works fine on both
windows and *nixes.
But unfortunately / does not always work, specially for arguments to
internal commands:

pyos.system("type c:/windows/win.ini")
La sintaxis del comando no es correcta. [invalid syntax]
1
pyos.system(r"type c:\windows\win.ini")
[Compatibility]
_3DPC=0x00400000
_BNOTES=0x224000
....

--
Gabriel Genellina

May 21 '07 #8

P: n/a
Gabriel Genellina said unto the world upon 05/21/2007 10:12 AM:
En Mon, 21 May 2007 10:53:08 -0300, Brian van den Broek
<br***@cc.umanitoba.caescribió:
>Gabriel Genellina said unto the world upon 05/21/2007 07:01 AM:
>>En Mon, 21 May 2007 07:42:21 -0300, revuesbio <re*******@gmail.com>
escribió:

os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
C:\test.TIF')
\ is used as a escape character in strings.
Use either \\ or a raw string, that is:
Better still, use / as the path separator. That works fine on both
windows and *nixes.

But unfortunately / does not always work, specially for arguments to
internal commands:

pyos.system("type c:/windows/win.ini")
La sintaxis del comando no es correcta. [invalid syntax]
1
pyos.system(r"type c:\windows\win.ini")
[Compatibility]
_3DPC=0x00400000
_BNOTES=0x224000
...
Thanks for the catch then, Gabriel. Windows is but a bitter memory for
me, and / worked in every context in which I ever used it---I didn't
know that the support was only partial.

Best,

Brian vdB
May 21 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.