473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

TIFF to PDF

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
8 6488
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robin Becker | last post by:
Has anyone done transparency with PIL & TIFF? I'm using PIL to generate a preview TIFF for embedding into an eps file and am being asked for the TIFF to support transparency. -- Robin Becker
2
by: Al Reid | last post by:
Is it possible to display an image that is stored on the server as a TIFF image, on an ASP.Net page without the use of an add-in viewer? If so, could someone tell me how to do it? TIA -- Al...
0
by: Will Arrowsmith | last post by:
Hi All, I am trying to create a .tiff file to fax using the windows fax service FAXCOMLib. I have created an array of images (bitmaps) and converted them to 1pbb format in order to allow...
0
by: Will Arrowsmith | last post by:
Hi All, I am aiming to create a multiframe Tiff file that I can fax using the windows fax service FAXCOMLib. I have created an array of Bitmaps (pages I want in my fax doc) and succesfully...
5
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a...
6
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On...
1
by: amit gupta | last post by:
Hello, I am using QuarkXPress on Macintosh to generate EPS Files with Tiff Preview embedded in it. I have written some C code to extract Tiff Preview from EPS files generated which works pretty...
7
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
10
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi, Please help me to write a dll in C# , that will read each pages of a tiff image from a file and a memory stream object ( need two ways) and creatre a new tiff image object.The dll should...
3
by: GiJeet | last post by:
Hello, we have an app that scans documents into TIFF format and we need to transfer them over the internet. If anyone knows of a SDK we can use that can compress TIFFs on the fly or even if it can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.