3

I created a LaTeX document using Overleaf and a diagram I made in Numbers and exported in PDF format. I included it into Latex like so:

\documentclass[12pt,a4paper]{article}
\usepackage{fullpage}
\usepackage[bottom]{footmisc}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{float}
\usepackage{caption}
\begin{document}
    \begin{figure}[h!]
        \begin{center}
            \includegraphics[width=15cm, trim=1.8cm 11.9cm 2.5cm 1.7cm, clip]{Diagram.pdf}
        \end{center}
    \end{figure}
\end{document}

And it is being displayed correctly by overleaf: Diagram on Overleaf

However, when exporting it as a PDF on Overleaf and printing it, I get this: Diagram on Preview or Printed

This is a link to the PDF used: https://www.dropbox.com/s/kyku3gxe6b9utj8/Gegevens.pdf?dl=0

How do I get these lines to work?

Martijn
  • 133
  • 1
    This won't solve the problem, but you should use \centering instead of \begin{center}...\end{center}. http://tex.stackexchange.com/q/2651/32374 Welcome to TeX.SX! – darthbith Feb 08 '15 at 16:18
  • @darthbith You think that is the issue? – Martijn Feb 08 '15 at 17:18
  • No, I don't think that is the issue, but simply a piece of advice :-) It would be better if you could provide a link to the PDF of the figure (e.g. from Dropbox or something) so we can try it here – darthbith Feb 08 '15 at 17:52
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Martin Schröder Feb 09 '15 at 12:34
  • @MartinSchröder Will do! – Martijn Feb 09 '15 at 16:40
  • @darthbith Added a link to the PDF! – Martijn Feb 09 '15 at 16:45
  • I can not reproduce this with pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014). – Martin Schröder Feb 09 '15 at 22:37
  • @MartinSchröder It only occurs for me when I change the width of the figure to something less than the original width. – Martijn Feb 10 '15 at 06:38

1 Answers1

3

The PDF produced by Numbers in combination with LaTeX generates a PDF that is rendered incorrectly by certain PDF-viewers like Preview.app and Skim (Adobe Acrobat seems to render it correctly).1

In order to fix this, you can use ghostscript to recode your PDF:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=new-file.pdf original-file.pdf   

enter image description here


  1. Doing a quick preflight on the original PDF generated by Numbers reveals some syntax errors and compatibility with PDF version 1.4 although the file reports version 1.3
DG'
  • 21,727
  • Why do you think the PDF is incompatible with pdfTeX? – Martin Schröder Feb 09 '15 at 22:38
  • 1
    You are right, it is not the PDF itself that is incompatible. It is the combination of the PDF generated by Numbers + LaTeX + certain PDF-viewers like Preview.app and Skim (but nor Adobe Acrobat). I will amend my answer accordingly. – DG' Feb 10 '15 at 09:44