Welcome Guest Search | Active Topics | Sign In | Register

Problem with PDF rotation in meta-data Options
eseric
Posted: Monday, June 12, 2017 3:54:33 PM
Rank: Newbie
Groups: Member

Joined: 6/12/2017
Posts: 2
Hello,

We are adding some drawing (mostly text and rectangles) to user a uploaded pdf. We have been experiencing a problem when the pdf meta-data indicates the page should be rotated 90 degrees. As a result, the text we add, for instance, appears vertically instead of horizontally.

An example of the meta-data on one of the problem pages, extracted using a tool:

Pages: 1
Encrypted: no
Page size: 612 x 792 pts (letter) (rotated 90 degrees)
File size: 113389 bytes
Optimized: yes
PDF version: 1.4

The code we are using for drawing is something along these lines:

Code: C#
var textLayer = new PdfTextLayer
            {
                Font = new PdfFont("Arial", fontSize, FontStyle.Regular),             
            };

            var textContent = new PdfTextContent(text)
            {
                PositionMode = PdfTextPositionMode.Offset                
            };

            textLayer.Contents.Add(textContent);            
            page.Contents.Add(textLayer);


Is there a property to make EO account for this rotation, so that gets rendered looks similar to what was drawn, or anything we can do differently?

If not, is there a property in PdfDocument or any other object where we can check the meta-data and determine if the page will be rotated?

Thanks for your help!
eo_support
Posted: Monday, June 12, 2017 6:37:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

If you use the low level content API, then it will not count rotation automatically. However if you use the ACM interface, then it will. So you can try to replace your PdfTextLayer/PdfTextContent with AcmText and it should work for you. Internally AcmText will render the necessary PdfTextLayer/PdfTextContent together with any rotation needed.

Thanks!
eseric
Posted: Tuesday, June 13, 2017 8:58:21 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2017
Posts: 2
Thanks, I will give that a try instead.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.