Subhrajyoti Moitra wrote:
> Hello,
> I want to shrink all the contents (including forms, links, annotations.. 
> ) into a standard page size and then add footer and headers to this 
> document.

That's very difficult. It isn't sufficient to:
> "cm=>Modify the current transformation matrix (CTM) by concatenating the 
> specified matrix (see 8.3.2, "Coordinate Spaces"). Although the operands 
> specify a matrix, they shall be written as six separate numbers, not as 
> an array."

You'll also have to redefine the positions of the the annotations;
they are independent of the content stream.

> Am i looking for the right thing given the problem context?

Yes, but you'll see that only the content is shrunk.

> I have THE book, in section 14.1.2 Defining Page boundaries, there is a 
> discussion about different types of boxes and their details.
> I am not sure if/how to relate these 2 things together(if at all it will 
> help in solving the issues) and have a working solution, to shrink pages 
> with all content into a standard page size.

You'll have to update those boxes too (maybe you only have the MediaBox 
in your PDFs).

>  i will continue to dig into the specs for more about 'cm'. Please help 

I think your best shot, is to create a new document using PdfReader, 
PdfWriter, PdfImportedPage (wrap it in an Image and scale it). That will 
shrink to content. That way you don't have to worry about the "cm".
Then deal with the annotations separately on the lowest level. In table 
164, you see that you'll need to change the /Rect key (The annotation 
rectangle, defining the location of the annotation on the page in 
default user space units) and shrink the appearance of the annotation. 
(Links and form fields are just special types of annotations.)
O, and don't forget to adapt the destinations, for instance in the 
outline tree.

If you ask me for my honest opinion, I'd say that your work is too 
difficult and too pointless to spend any energy on. In Belgium, we have 
a special touristic tour where you can visit "les grand travaux 
inutiles". It's a tour showing how the Belgian government wasted the tax 
payers' money on useless constructional works (such as an elevator to 
bring a boat from one river to another).
See also: http://fr.wikipedia.org/wiki/Grands_travaux_inutiles

As PDF is a vector format, perfectly scalable in Adobe Readder (you can 
set the scaling to fit the page), there is no reason whatsoever why you 
would want to shrink an entire PDF.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to