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 (Portrait) 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 formats occur.
I also move the placement of the page around to accommodate headers footer and 
page numbers, additional 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 possible that it was scanned as Portrait then rotated 90 degrees 
after the fact inside of acrobat.  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 portrait page in landscape orientation. 
Would appreciate any help


Geoffrey C. Barth
[email protected]
212-340-0669
------------------------------------------------------------------------------
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
[email protected]
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