Thanks to all of you for your help. I have coded my solution and it's
working great.
Joe
On 3/15/07, Paulo Soares <[EMAIL PROTECTED]> wrote:
You do it in PdfReader:
PdfReader r = ...
PdfDictionary dic = r.getPageN(1);
dic.put(PdfName.ROTATION, new PdfNumber(0));
And then output the reader with PdfStamper.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Joe Maldonado
> Sent: Thursday, March 15, 2007 4:44 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Rotating PDF pages
>
> Thanks,
>
> I have not tried the former approach of converting the pages
> to images yet, I do not see a reader which takes a Document
> object as the input, the pdf files I'm manipulating are
> generated in the application then transmitted to the faxing
> service hence there is no file intermediary.
>
> I did try the latter by setting the ROTATION key in the
> dictionary via the writer. Setting it page by page would
> require me to walk the document after it is created. I
> apologize for my current ignorance of the product since I've
> only been at this for a few hours now, but is there a way to
> walk the pages of a Document object and manipulate the contents?
>
> Again Thanks,
>
> Joe
>
>
> On 3/15/07, Paulo Soares <[EMAIL PROTECTED]> wrote:
>
> That's too complicated, just change/delete the /Rotate
> key in the page
> dictionary.
>
> Paulo
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> > Behalf Of Stuart Jansen
> > Sent: Thursday, March 15, 2007 2:47 PM
> > To: Post all your questions about iText here
> > Subject: Re: [iText-questions] Rotating PDF pages
> >
> > On Thu, 2007-03-15 at 09:50 -0400, Joe Maldonado wrote:
> > > Is there a way to reorient the document after it
> has been laid out
> > > with iText?
> >
> > Here's one possible solution:
> >
> > -----
> > PdfReader pdfReader = new PdfReader("original.pdf");
> > Document document = new Document();
> > PdfWriter pdfWriter = PdfWriter.getInstance (document,
> > new FileOutputStream("rotate90.pdf"));
> > pdfWriter.setStrictImageSequence(true);
> > Rectangle pageSize = pdfReader.getPageSizeWithRotation(1);
> > document.setPageSize (pageSize.rotate());
> > document.open();
> > int pageCount = pdfReader.getNumberOfPages();
> > for (int i = 1; i <= pageCount; i++) {
> > document.newPage();
> > PdfImportedPage page =
> > pdfWriter.getImportedPage(pdfReader, i);
> > Image image = Image.getInstance(page);
> > image.setRotationDegrees(90);
> > image.setAbsolutePosition(0, 0);
> > document.add (image);
> > }
> > document.close();
> > -----
> >
> >
> > --
> > Stuart Jansen <[EMAIL PROTECTED]>
> > Guru Labs, L.C.
> >
>
>
> Aviso Legal:
> Esta mensagem é destinada exclusivamente ao
> destinatário. Pode conter informação confidencial ou
> legalmente protegida. A incorrecta transmissão desta mensagem
> não significa a perca de confidencialidade. Se esta mensagem
> for recebida por engano, por favor envie-a de volta para o
> remetente e apague-a do seu sistema de imediato. É proibido a
> qualquer pessoa que não o destinatário de usar, revelar ou
> distribuir qualquer parte desta mensagem.
>
> Disclaimer:
> This message is destined exclusively to the intended
> receiver. It may contain confidential or legally protected
> information. The incorrect transmission of this message does
> not mean the loss of its confidentiality. If this message is
> received by mistake, please send it back to the sender and
> delete it from your system immediately. It is forbidden to
> any person who is not the intended receiver to use,
> distribute or copy any part of this message.
>
>
>
>
> --------------------------------------------------------------
> -----------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the
> chance to share your
> opinions on IT & business topics through brief
> surveys-and earn cash
>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
> &CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> [email protected]
>
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> <https://lists.sourceforge.net/lists/listinfo/itext-questions>
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>
>
>
>
>
> --
> Joe Maldonado
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão
desta mensagem não significa a perca de confidencialidade. Se esta mensagem
for recebida por engano, por favor envie-a de volta para o remetente e
apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o
destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may
contain confidential or legally protected information. The incorrect
transmission of this message does not mean the loss of its confidentiality.
If this message is received by mistake, please send it back to the sender
and delete it from your system immediately. It is forbidden to any person
who is not the intended receiver to use, distribute or copy any part of this
message.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
--
Joe Maldonado
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/