I converted my original image to pdf with ImageMagick. If viewed independently, the pdf image looks perfectly normal.
sample.ms :
.PDFPIC Figure_1.pdf
Once I try to compile my .ms document with the following command:
groff -ms sample.ms -U -T pdf > sample.pdf
I get the following error from groff:
troff: sample.ms:1: division by zero
The document does compile but it looks like this: image is way to the right of the page to the point its sometimes almost completely out of the page.
I was having the same problem and it seems like the PDFs
convert
generates are corrupt in some way.I ended up using
convert img.png img.tiff
and thentiff2pdf img.tiff > img.pdf
. Includingimg.pdf
then worked just fine.I used
tiff2pdf
just because that's what I had installed, but any other program should work too if it generates valid PDF.