I am try to take multiple pdfs documents with various page sizes and
orientations and make one new pdf document with all of the pages in the same
orientation (Portait) 8.5 x 11.  I need to do this so that the result can be
bound in a book.


SUDO code below

loop over documents and pages

mysourcepage =  mywriter.getImportedPage(myreader,PDFSOURCEPAGENUMBER)          
        
gets 1 page
myrotationsourcepage = 
myreader.getPageSizeWithRotation(PDFSOURCEPAGENUMBER)    get rectangle of
page size
temp = NewDocument.newPage()                                 add page to
writer
CBtext = mywriter.getDirectContent()                      create a place to 
store page
before writing
NewDocument.setPageSize(rec)>                           set page size
CBtext.addTemplate(mysourcepage,WidthScale,rot_3,rot_4,HeightScale,adjusted_x_start,adjusted_y_start)



End loop


In the last line I have to scale the pages to fit when 11x17 or 11x14 etc
page occur
I also move the placement of the page around to acomadate headers footer and
page numbers, addtional scaling is required when header footers or page
number are used.

Depending on how the original documents are created effects my final
document.
For instance if some where to scan a document in landscape format the page
would be 11x8.5 by orientation would be 0
but its also possble that it was scanned as Portait then rotated 90 degrees. 
The end result is the same when looking at the pdf but not when copying and
writing the pages.

when I use the rotation parameter in addtemple (rot_3,rot_4 above)  with a 1
and -1 the page is skewed on an angle.  if I don't use the rotation the
original page is placed on portait page in landsacpe orientation. ( see
example)

Would appreciate any help


http://old.nabble.com/file/p28029103/testcolor.pdf testcolor.pdf 
-- 
View this message in context: 
http://old.nabble.com/Rotatating-Pages-tp28029103p28029103.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to