Page Layoutincludegraphics/includepdf pdf

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

includegraphics/includepdf pdf

Post by NinV »

Hi,

I would like to include a pdf page into my document.

I tried the package pdfpages but I've got a lot of error because of the images I use, I think.

I've read that it is possible to use the command \includegraphics, but when I compile the document (->DVI) I get the following error message
Error: /undefined in obj
Operand stack:
1 0
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1893 1 3 %oparray_pop 1892 1 3 %oparray_pop 1876 1 3 %oparray_pop 1755 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1155/1684(ro)(G)-- --dict:0/20(G)-- --dict:81/200(L)-- --dict:175/300(L)-- --dict:42/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
MiKTeX GPL Ghostscript 8.60: Unrecoverable error, exit code 1
Here it is a minimal example:

Code: Select all

\documentclass[
paper=a5,
fontsize=10pt,
DIV=calc,
headsepline,
footsepline,
titlepage,
headings=normal,
version=last,
twoside=true,           % prova eliminazione geometry
headinclude=true,
footinclude=true,
mpinclude=true,
BCOR=1.8cm
]{scrbook}

%%%%%%%%%%%%%%%%%%%%%%%%%%
% PACCHETTI
%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[arabic,italian]{babel}
\usepackage{psbao} % per i diagrammi di Bao
\usepackage{array}
\usepackage{url}
\usepackage{float}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{scrpage2} %\invece di usepackage{fancyhdr}?
\usepackage{times}
\usepackage{lettrine}
\usepackage{indentfirst}
\usepackage{savefnmark}
\usepackage{makeidx,titletoc}
\usepackage{rotating}
\usepackage{eso-pic}
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{inputenc}
\usepackage[tiling]{pst-fill}
\usepackage{pst-text,pst-grad,pst-plot}
\usepackage{natbib}
\usepackage{supertabular}
\usepackage{xspace}
\usepackage{ifthen}
\usepackage[thref]{ntheorem}
%\usepackage[backref]{hyperref} % Serve per i riferimenti alla bibliografia
\usepackage{marginnote}
\usepackage{mparhack}
\usepackage{showkeys}

\begin{document}

\includegraphics{ifa.pdf}

\end{document}
Ifa.pdf is attached.

Thank you in advance for any help.

Nino
Attachments
ifa.pdf
(107.31 KiB) Downloaded 317 times
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: includegraphics/includepdf pdf

Post by meho_r »

Images must be in .eps format to be included in a DVI file. If you want to use PDF, JPG, PNG and similar images, compile your document with pdflatex instead of latex (you'll get PDF output instead of DVI).

BTW, most of the packages in your MWE have nothing to do with this issue, so they should be omitted.
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

includegraphics/includepdf pdf

Post by NinV »

meho_r wrote:Images must be in .eps format to be included in a DVI file. If you want to use PDF, JPG, PNG and similar images, compile your document with pdflatex instead of latex (you'll get PDF output instead of DVI).
If I compile with pdflatex I'll lost all images :(

Do you know another method? I did browse internet, but I didn't succeed to get a solution.
meho_r wrote:BTW, most of the packages in your MWE have nothing to do with this issue, so they should be omitted.
Yes, I know. I've just taken them from my original document...

Thanks for your attention.
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

includegraphics/includepdf pdf

Post by frabjous »

If I compile with pdflatex I'll lost all images :(
What kinds of images does your document contain? It should be easy enough to convert them a format compatible with pdflatex in most cases, perhaps even on the fly.
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

includegraphics/includepdf pdf

Post by NinV »

frabjous wrote:What kinds of images does your document contain?
JPG/EPS
It should be easy enough to convert them a format compatible with pdflatex in most cases, perhaps even on the fly.
How?

BTW, I converted the pdf page to image and inserted it as jpg.

Many thanks for your help.


Ciao,
Nino

PS Sorry for "I'll lost" instead of "I'll lose" :oops:
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

includegraphics/includepdf pdf

Post by meho_r »

Well, if you are not obliged to provide your document in a DVI file, I'll recommend that you use pdflatex. However, pdflatex doesn't support EPS images, so they must be converted to another format (preferably PDF). The conversion may be done using epstopdf program on Linux.

BTW, I wouldn't convert PDF to JPG if I don't have a good reason for that. JPG is a lossy bitmap format, while PDF encapsulates complete description of a document including vectors, bitmaps, fonts etc. This means that, if you have a vector file (e.g. EPS) and then convert it to PDF, you still have a vector file. But when you convert it to JPG, vectors are converted to dots (bitmap) and lose their quality, which is especially noticeable when the image is scaled. Beside that, vectors always result in a much smaller file size than bitmaps.
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

Re: includegraphics/includepdf pdf

Post by NinV »

Thanks, meho_r!

I didn't know all that... well I don't know a lot of things!

Thank you very much.

Nino
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

includegraphics/includepdf pdf

Post by frabjous »

You can also try using the epstopdf package to convert on the fly.
Post Reply