f



Embedding PDF into PDF ?

I have read from websearching that it is possible to embed a smaller PDF 
into a main PDF, but cannot find out how this is done.

Would I have to open the PDF as a text file and have my program locate a 
certain PDF command, then literally just stream the raw smaller PDF into it 
?

Any links or info would be very much aprpeciated

Thanks

Paul
0
paul
7/14/2004 2:05:29 PM
comp.text.pdf 5600 articles. 0 followers. ramon (1518) is leader. Post Follow

5 Replies
1646 Views

Similar Articles

[PageSpeed] 3

On Wed, 14 Jul 2004, Paul Champan wrote:

> I have read from websearching that it is possible to embed a smaller PDF
> into a main PDF, but cannot find out how this is done.

Do you want to merge 2 pdf files or "place" pdf files into a new
document?

> Would I have to open the PDF as a text file and have my program locate a
> certain PDF command, then literally just stream the raw smaller PDF into it
> ?

It is more involved than that.

> Any links or info would be very much aprpeciated

There was a proposal for "encapsulated" PDF format of this sort of
thing.  In practice, the main requirement is to arrange to get
the right MediaBox value into your

pdftex can embed pdf files.  Sources are readily available from CTAN if 
you want to study how it is done, but there are macro packages
(pdfpages) and other tools (ConTeXt's texexec) that handle common
situations.

--
George N. White III  <aa056@chebucto.ns.ca>
   Head of St. Margarets Bay, Nova Scotia, Canada
0
George
7/14/2004 2:21:18 PM
Acrobat can do this, or at least the *effect* of doing this, with the
object tool.  Select what you want from one PDF and paste it into
another.

So can Thomas Merz's pdflib:  www.pdflib.com, by building a new PDF
out of  two source ones.  Maybe the latest version has even more
functionality here, I haven't checked in awhile.

Lots of other tools out there too I'm sure, but these are the two I've
used.

--arne

"Paul Champan" <paul.chapman@capnetwork.co.uk> wrote in message
news:95269F1A8paulccapemapcouk@130.133.1.4...
> I have read from websearching that it is possible to embed a smaller
PDF
> into a main PDF, but cannot find out how this is done.
>
> Would I have to open the PDF as a text file and have my program
locate a
> certain PDF command, then literally just stream the raw smaller PDF
into it
> ?
>
> Any links or info would be very much aprpeciated
>
> Thanks
>
> Paul


0
arne
7/14/2004 5:05:21 PM
Thanks for the info guys. 
I want to embed 'many' small PDF's into a single larger PDF, and the reason 
for this is described in an earlier thread of mine 'Sub Standard Bitmapped 
Images'

Basically my software outputs lots of text, its a printed publication which 
lists car prices. This is generated by my program and consists of fonts 
rather than images, which consequently scale nicely. 
What Im trying to achieve is the graphical adverts which are scattered 
throughout the book. 
My software can only render these if they have been rasterised first, and 
then when they are rasterised they tend to look poor in the PDF.

I figured if I could produce a master PDF from my software, and then convert 
all the EPS to PDF's I could then embed those mini PDF's into the one 
generated by my software, and the result would be vectored adverts.

Ill look into the tools but I think if embedding one PDF into the other 
requires a new PDF to be rewritten then this will be unfeasible for me (I 
have to merge 200 adverts into one PDF, and the main PDF is 1300 pages long)

Thanks

Paul


"arne thormodsen" <arneDOTthormodsen@REMOVE.hp.com> wrote in <lJdJc.5836
$sg2.585@news.cpqcorp.net>:

>Acrobat can do this, or at least the *effect* of doing this, with the
>object tool.  Select what you want from one PDF and paste it into
>another.
>
>So can Thomas Merz's pdflib:  www.pdflib.com, by building a new PDF
>out of  two source ones.  Maybe the latest version has even more
>functionality here, I haven't checked in awhile.
>
>Lots of other tools out there too I'm sure, but these are the two I've
>used.
>
>--arne
>
>"Paul Champan" <paul.chapman@capnetwork.co.uk> wrote in message
>news:95269F1A8paulccapemapcouk@130.133.1.4...
>> I have read from websearching that it is possible to embed a smaller
>PDF
>> into a main PDF, but cannot find out how this is done.
>>
>> Would I have to open the PDF as a text file and have my program
>locate a
>> certain PDF command, then literally just stream the raw smaller PDF
>into it
>> ?
>>
>> Any links or info would be very much aprpeciated
>>
>> Thanks
>>
>> Paul
>
>
>

0
chappy
7/14/2004 6:57:53 PM
> I figured if I could produce a master PDF from my software, and then
convert
> all the EPS to PDF's I could then embed those mini PDF's into the one
> generated by my software, and the result would be vectored adverts.
>
> Ill look into the tools but I think if embedding one PDF into the other
> requires a new PDF to be rewritten then this will be unfeasible for me (I
> have to merge 200 adverts into one PDF, and the main PDF is 1300 pages
long)

Paul,

Maybe PDFMeld can do the job.
Checkout http://www.fytek.com/products.php?pg=pdfmeld

GreetZ

TheFrenZ


0
TheFrenZ
7/14/2004 8:30:18 PM
Paul Champan schrieb:
> Thanks for the info guys. 
> I want to embed 'many' small PDF's into a single larger PDF, and the reason 
> for this is described in an earlier thread of mine 'Sub Standard Bitmapped 
> Images'
> 
> Basically my software outputs lots of text, its a printed publication which 
> lists car prices. This is generated by my program and consists of fonts 
> rather than images, which consequently scale nicely. 
> What Im trying to achieve is the graphical adverts which are scattered 
> throughout the book. 
> My software can only render these if they have been rasterised first, and 
> then when they are rasterised they tend to look poor in the PDF.
> 
> I figured if I could produce a master PDF from my software, and then convert 
> all the EPS to PDF's I could then embed those mini PDF's into the one 
> generated by my software, and the result would be vectored adverts.

Use epstopdf for EPS->PDF, see my other posting for details. Then 
proceed exactly as you have in mind now.

> Ill look into the tools but I think if embedding one PDF into the other 
> requires a new PDF to be rewritten then this will be unfeasible for me (I 
> have to merge 200 adverts into one PDF, and the main PDF is 1300 pages long)

This is an easy job for pdfLaTeX and friends, even for this size of 
documents. pdfLaTeX will embed all the small PDFs into the big one in 
one go. The whole thing should not take longer than say 20-30 seconds, 
depending on the documents and the machine you run it on.

I provide a full set of files as an examplary solution to your problem 
on my web site:

http://www-user.tu-chemnitz.de/~ralk/latex/pdfoverlay.php

Requirements:

* a TeX-Installation with pdflatex
* special packages: pdfpages, eso-pic

There are a couple of files:

* master.pdf = your master catalog with the text
   (I chose a random black and white text document I found.)
* ad1.pdf, ad2.pdf, ad3.pdf are advertisements with vector PDF content.
   (I chose random pdf files I found on my hard disk.)
* final.tex is the input file for pdfLaTeX.
* final.pdf is the result, the complete catalog with text and images.

In final.tex you have to fiddle around with positioning to get the small 
images to appear at the right spots. You can also temporarily overlay 
the master page with a grid to help you with this job.

The required command to build final.pdf from final.tex looks like this:

$ pdflatex final.tex


================== start of final.tex ===========================

\documentclass[a4paper]{article}

\usepackage{graphicx}
% package for general graphics inclusion
% used commands: \includegraphics

\usepackage{eso-pic}
% \usepackage[grid]{eso-pic} % turn the grid on for easier positioning
% package for adding overlay images to a page
% used commands: \AddToShipOutPicture*

% this package can include pages from existig pdf files
% used commands: \includepdf
\usepackage{pdfpages}

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Here starts page 1
%
% tell latex to overlay this page with the following two ads
%
\AddToShipoutPicture*{
	\setlength\unitlength{1mm}
	% this is the first advertisement on page 1
         % position of the lower left corner in mm (millimeters)
	\put(150,230){\includegraphics[height=5cm]{ad1}}
	% this is the second advertisement on page 1
	\put(80,60){\includegraphics[height=5cm]{ad2}}
}

% this is the background page on page 1 with the text
\includepdf[pages={1}]{master.pdf}

% End of page 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Here starts page 2

\AddToShipoutPicture*{
	\setlength\unitlength{1mm}
	% this is the first ad on page 2
	\put(120,120){\includegraphics[height=10cm]{ad3}}
}

% this is the background page on page 2 with the text
\includepdf[pages={2}]{master.pdf}

% End of page 2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% and so on

% you could also define macros for the stuff mentioned
% so that you could use custom commands

\end{document}

================== end of final.tex ===========================

Ralf

-- 
Ralf Koenig, Professur Rechnernetze und verteilte Systeme
TU Chemnitz, Zi. 1/B320, Tel. 0371-531-1532

0
Ralf
7/14/2004 11:53:32 PM
Reply: