Discussion:
[iText-questions] Fwd: detect pdf rotation angle
eliran glob
2015-10-03 08:53:58 UTC
Permalink
support help,

1.
is it possible to get with c# ItextSharp, or other tool , the actual (real)
rotation angle
of PDF text page (not an image)?

2. I tried to get the angle with the method:
var rotate = reader.GetPageRotation(page)
but it always gives rotate=0, even the page text is rotated in 90 degree
clockwise.

any help ,link or code example will be appreciated.

regards,
EL
iText mailing list
2015-10-08 07:14:44 UTC
Permalink
Hello,
Post by eliran glob
support help,
However, you didn't mail to support.

1. You mailed to a mailing-list address that is being discontinued. Only
a single person is monitoring the mailing-list. You should use the
proper channel for questions, see http://itextpdf.com/support
2. You mailed to a mailing-list that requires subscription. You were not
subscribed to the mailing list, hence somebody had to manually approve
your question. Only a single person approves questions (and as this is a
cumbersome work, genuine questions risk to be deleted).
Post by eliran glob
1.
is it possible to get with c# ItextSharp, or other tool , the actual
(real) rotation angle
of PDF text page (not an image)?
This is done like this: reader.GetPageRotation(page)
Only 4 values are possible (as explained in ISO-32000-1): 0, 90, 180, 270
(OK, OK, values such as 360, 450,... are also possible, but they don't
make much sense, do they?)
Post by eliran glob
var rotate = reader.GetPageRotation(page)
but it always gives rotate=0, even the page text is rotated in 90
degree clockwise.
If rotate = 0, then the page isn't rotated. It's as simple as that.

I think that you are confusing page dimensions and rotation.

Let's consider a page of size A4. This page is 595 user units wide and
842 user units high if you look at it in portrait.

There are two ways to present this page in landscape.
1. You can define the page by keeping the width 595 and the height 842
and introducing a rotation of 90 degrees.
2. You can define the page by keeping the rotation 0 and defining the
width as 842 and the height as 595.

My guess is that you encountered a page that was created by switching
the values of the width and the height.
In that case, it is only normal that the rotation is 0.

PLEASE DO NOT REPLY TO THIS MAIL. THE 1T3XT.INFO ADDRESS ISN'T USED
FREQUENTLY.
PLEASE USE THE PROPER CHANNEL FOR POSTING QUESTIONS:
http://itextpdf.com/support

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Loading...