2

I've seen How can I crop included PDF documents? - but it doesn't quite address my problem.

Let me illustrate with MWE - this is test1.tex, which you can compile with pdflatex test1.tex, which generates the "image" test1.pdf:

\documentclass[12pt,a4paper]{article}

\title{A special source document for testing}
\author{Ego Myself}
\date{\today}

\usepackage{lipsum}

\begin{document}

\maketitle

\lipsum[1-3]

\end{document}

And here is test2.tex, which you can compile with pdflatex test2.tex, which is the "main" document, that includes test1.pdf as an image:

\documentclass[12pt,a4paper]{article}

\title{A normal document}
\author{Else Someone}
\date{\today}

\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\maketitle

\lipsum[11]

% [trim=left bottom right top]
\begin{figure}[!h]
  \centering
  \fbox{\includegraphics[width=.5\linewidth,page=1,trim=1.20in 6in 2.5in 1.1in,clip]{test1.pdf}}
  \caption{Excerpt from special source document}
  \label{figure:spec-source}
\end{figure}

\lipsum[4]

\end{document}

The PDF result of test2.pdf looks like this in evince, Ubuntu 14.04:

test2_1.png

All looks good, actually - until I decide to drag around with the mouse in the document to select stuff - then I can see:

test2_2.png

Ouch - actually ALL of the original vectors in the PDF that is included as image, are also present (meaning, eating away file size/disk space for nothing) in the main document - even if they are made invisible by the trim/clip!

Any way to actually remove these vectors that are made invisible by trim/clip (so they are not present as data at all in the "main" document, and thus would not be "selectable" even if invisible)?

sdaau
  • 17,079
  • 2
    The is normal PDF behavior, not specific to TEX. The "cropped" material is still there, just not visible. Ever form a frame with your hands, to visualize how an outdoor scene would look in a picture? That doesn't make anything dematerialize, it just blocks the view. Same with PDF. There may (repeat, may) be some techniques for removing at least some of the blocked material, but I only know how to do that with professional software. –  Mar 28 '18 at 22:19
  • Thanks for that, @RobtAll - feel free to post this as an answer, I'll accept it – sdaau Mar 28 '18 at 22:44
  • 1
    Just a comment, not an answer. Some of the TeXperts might know of a way to minimize the effect, so let them have their say. –  Mar 28 '18 at 23:15
  • 1
    Afterthought: This is a serious issue in "the real world." Some law firm or political office creates a PDF, in which sensitive material is "omitted." But it's still there in the PDF, and you don't need a secret decoder to see it. Oops. So, there is professional software (maybe even free stuff) that will locate and remove material not intended to be seen. But I don't know how good it is, in terms of removing partial material; I believe that any individual vector object (including a text letter) is all-or-nothing. –  Mar 28 '18 at 23:31

0 Answers0