How to convert .TIF file to .PDF with zero compression?

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

Or evince.
Or you may compile and older version of libtiff which provides tiff2pdf - see this related topic.

Tried both. It compresses the PDF.

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?

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?

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

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.

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?

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

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.