Nomad
June 6, 2024, 5:53pm
1
Hi,
I am trying to find a way to convert a .TIF document to .PDF without any compression whatsoever.
So far I have tried libreoffice draw and there is compression even though I select ‘lossless’ which is bizarre. Then I tried ‘imagemagick’ and ‘graphicsmagick’ and failed with both of those as well.
Anyone know how to accomplish this task? I don’t want to use online websites for this because it’s a sensitive document.
Have you tried Gimp, Krita, or Inkscape? All three can open .TIF
files.
EDIT: But only Gimp and Inkscape can export .PDFs
.
I would try Imagemagick. Not sure if simply this does it
magick x.tif -quality 100 x.pdf
2 Likes
vlkon
June 6, 2024, 6:15pm
4
Or evince
.
Or you may compile and older version of libtiff which provides tiff2pdf
- see this related topic .
Nomad
June 6, 2024, 6:18pm
5
Tried both. It compresses the PDF.
Nomad
June 6, 2024, 6:19pm
6
I mentioned I tried imagemagick. It kept giving me a blank PDF document output file.
You didn’t mention how you tried imagemagick? What was your command exactly?
Nomad
June 6, 2024, 6:25pm
8
i ran:
convert input.tif output.pdf
it gives me the error:
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF’ @ error/constitute.c/IsCoderAuthorized/426.
Interesting. It worked fine for me but my test tif was not in some “security state” or whatever this is.
What does file x.tif
show?
Nomad
June 6, 2024, 6:27pm
10
sample.tif: TIFF image data, little-endian, direntries=15, height=1090, bps=18754, compression=none, PhotometricInterpretation=RGB, orientation=upper-left, width=846
The .TIF file was created in GIMP
Strange.
Perhaps add a line
<policy domain="coder" rights="read|write" pattern="PDF" />
in /etc/ImageMagick-7/policy.xml
and then try again.
2 Likes
Nomad
June 6, 2024, 6:35pm
12
I actually tried changing the “rights” to read|write before making this post, and it kept giving the same error. Let me try once more by adding a line rather than editing the existing line.
Nomad
June 6, 2024, 6:42pm
13
It worked, but it compresses it despite adding the -quality 100
Also, the file’s thumbnail looks odd too.
Everything I try compresses one way or another. It’s driving me nuts lol
Interesting. Nevertheless, I don’t understand why I could convert a tif without adding this line on my system.
How do you prove that it does compressing?
Nomad
June 6, 2024, 6:44pm
15
I stand corrected. It didn’t compress it. I overlooked an error I made on my end.
Thanks!
I was just thinking if -compress none
would be better but if it works now, that’s great.
1 Like
system
Closed
June 8, 2024, 6:53pm
17
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.