Where is pdf image rotation information stored?

I am trying to extract images stored in a PDF as a stream. Although I can do this easily, I cannot get accurate information about image rotation. I am looking for specific information such as MediaBox, Rotate and Landscape / Portrait mode.

When I extract the image, its alignment does not match what the end user sees with the PDF reader.

I binary compared two PDF files (when the image was rotated 90 in the first, and 270 was rotated in the same image), and I found a difference in the specific stream object. However, I cannot understand what stream information is.

Here are two documents that I'm talking about:

http://bit.ly/eQZGKJ http://bit.ly/g43Whb

+5
source share
4 answers

The position, size and orientation of the image when displayed on the page is determined by the current transformation matrix (CTM). You must run the entire stream of page content to determine the CTM that is in place when the image is displayed. It’s like virtual rendering of a PDF page.

+4
source

For almost every image, the so-called CTM (current transformation matrix) is used. This gives the reader information about the position, rotation and distortion of the image.

+1
source

cm , pdf- " (CTM), (. 4.2.1" "). , , ". PDF-:

  • rotated1.pdf "0 550.08 -743.04 0 743.04 0 "
  • rotated2.pdf "0 -550.08 743.04 0 0 550.08 "

So we can say that your image rotates 90 degrees clockwise or 90 degrees in the opposite direction. (and translated)

+1
source

It may also have a clip so that you can only see part of the image. MediaBox and rotation apply to the entire page.

0
source

All Articles