Print Page | Close Window

Howto transform existing pdf landscape2portrait?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1659
Printed Date: 04 Apr 26 at 7:52PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Howto transform existing pdf landscape2portrait?
Posted By: Giuseppe
Subject: Howto transform existing pdf landscape2portrait?
Date Posted: 29 Nov 10 at 10:59AM
I've a pdf file, i want trasform landscape to portrait, can i recognize this problem?



Replies:
Posted By: Ingo
Date Posted: 29 Nov 10 at 11:28AM
Hi!

It's not a problem - If the author used landscape, he wants landscape?
Have a look in the online reference guide.
There are functions to set and get the document dimensions/-formats.
You'll have problems if there are large images.
From landscape to portrait you have to capture,...
making smaller,... try to fit it on portrait,...
not an easy job.

Cheers, Ingo


Posted By: Vankir
Date Posted: 30 Nov 10 at 7:15AM
Hi,
Not sure if it will be helpful for you bit some PDF pages can be rotated and have Rotation attribute in PDF. In this case Adobe Acrobat shows them correctly (it applies rotation when render page as far as I understand). I use following code to Render such pages correctly.

long nDPI = _Module.GetDriverSettings()->GetPDFRenderResolution();
double dWidth = GetPDFLibrary()->DAGetPageWidth(m_nPDFFileRef, m_nPDFPageRef);
double dHeight = GetPDFLibrary()->DAGetPageHeight(m_nPDFFileRef, m_nPDFPageRef);
long nRotation = GetPDFLibrary()->DAPageRotation(m_nPDFFileRef, m_nPDFPageRef);

//change height and width if page is rotated
if(nRotation == 90 || nRotation == 270)
{
            double dTmp = dWidth;
            dWidth = dHeight;
            dHeight = dTmp;
 }
 //transform width and height to inches and after that to pixels
 dWidth = dWidth*nDPI/72;
 dHeight = dHeight*nDPI/72;

Best regards,
Kirill



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk