'different pdf views on different softwares: vs studio code, chrome and acrobat reader, after imagemagick tif -> pdf convertion

I'm converting a tif file to pdf with imagemagick:

Imagemagick version: 7.1.0-13

Imagemagick command: magick convert -density 80 -page a4 -limit map 3GB -limit memory 3GB tiff:- pdf:-

This has been working good until meeting this guy: https://drive.google.com/file/d/1AJjN8F2RoKViE56ZE7I9XDYTJ-HefUaA/view

Which converted it to this pdf: https://drive.google.com/file/d/1C3Dfd7fGvgJFqJwKbOoLPB-om80gc3PP/view

Now if you view the result on a browser, like chrome, you see multiple empty pages: enter image description here

However opening the file with adobe reader I get this instead:

enter image description here

And what it's weird, with vs studio, the file looks good: enter image description here

For viewing the pdf on visual studio I'm using this extension: enter image description here

Now the question is, how do I fix this?

[edited] Even after upgrading the library it doesn't work, maybe missing dependency? OP: debian

DockerFile building the image:

FROM debian
WORKDIR /usr/src/app
RUN apt-get update -qq &&\
  apt-get install -y -qq \
  chrpath debhelper dh-exec dpkg-dev g++ ghostscript gsfonts libbz2-dev \
  libdjvulibre-dev libexif-dev libfftw3-dev libfontconfig1-dev libfreetype6-dev \
  libjpeg-dev liblcms2-dev liblqr-1-0-dev libltdl-dev liblzma-dev libopenexr-dev \
  libpango1.0-dev libperl-dev libpng-dev librsvg2-bin librsvg2-dev libtiff-dev libwebp-dev \
  libwmf-dev libx11-dev libxext-dev libxml2-dev libxt-dev pkg-config pkg-kde-tools zlib1g-dev
RUN apt-get install wget 
# Install ImageMagick Platform-independent build dependencies
RUN apt-get update -qq &&\
  apt-get install -y -qq \
  doxygen doxygen-latex graphviz jdupes libxml2-utils xsltproc
# Install and Configure ImageMagick
RUN wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.0-28.tar.gz -P /opt
RUN tar xvf /opt/7.1.0-28.tar.gz -C /opt
RUN /opt/ImageMagick-7.1.0-28/configure --with-modules --enable-shared
RUN make -j 2 /opt/ImageMagick-7.1.0-28
RUN make install /opt/ImageMagick-7.1.0-28/
RUN make distclean
RUN ldconfig /usr/local/lib
RUN rm /opt/7.1.0-28.tar.gz

[edited 2] libtiff version: 4.2.0-1 enter image description here



Solution 1:[1]

In IM 7, use magick not magick convert. Add +repage after reading the TIFF

magick input2.tif[0] +repage -density 80 -page a4 input2.pdf

works fine for me on IM 7.1.0.28 Q16 Mac OSX Sierra.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 fmw42