Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Is there a way to detect landscape pages? |
Post Reply |
Author | |
ExchangeViews
Team Player Joined: 13 Mar 12 Status: Offline Points: 38 |
Post Options
Thanks(0)
Posted: 18 May 12 at 10:02AM |
DrawRotatedText function is not working perfectly for landscape pages. Lib auto convert landscape pages to portrait and them use DrawRotatedText(....) and finally save as landscape. Can anybody help me in detecting landscape pages to set different angle for those pages?
|
|
edvoigt
Senior Member Joined: 26 Mar 11 Location: Berlin, Germany Status: Offline Points: 111 |
Post Options
Thanks(0)
|
Hi,
I think, you are wrong. It seems, as you are working on existing PDF which contains inside a rotate-command. For solution look at the end of my post: http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8885.html?KW=rotate+edvoigt#8885 Remark: Landscape or portrait is first a question of relation between pagewidth and pageheigt, not of rotation. Cheers, Werner Edited by edvoigt - 18 May 12 at 12:56PM |
|
ExchangeViews
Team Player Joined: 13 Mar 12 Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Dear Werner, you are right, i am working on existing PDF which contains inside a rotate-command. So I used:
rotation := QP.PageRotation; if (rotation<>0) then begin Angle:=Angle+rotation; (for angle 0 to 270) end; and the code is working for landscape pages. Thanks for your help!!!! |
|
edvoigt
Senior Member Joined: 26 Mar 11 Location: Berlin, Germany Status: Offline Points: 111 |
Post Options
Thanks(0)
|
Hi,
here a small remark. Because on some place an anglevalue only from 0, 90, 180, 270 is accepted, use better: Angle:= (Angle+rotation) mod 360; // sure inside 0..359 So at RotatePage the Reference Guide says: PageRotation The number of degrees to rotate the page by. Must be a multiple of 90 degrees (90, 180 or 270) So with mod you are more on sure side. Cheers again, Werner |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
It sounds like you may need to use QP.NormalizePage(0) to allow you to use the DrawText and DrawRotatedText. QP.LoadFromFile("page.pdf"); for (int i=1;i<=QP.PageCount();i++) { QP.SelectPage(i); QP.NormalizePage(0); } Andrew.
|
|
ExchangeViews
Team Player Joined: 13 Mar 12 Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Dear Andrew, Thanks. It is working perfectly for rotated pages but when I use the above code to draw text beneath the page content as below, it display just a blank page. If i comment QP.NormalizePage(0) function, program works fine but another issue occurs for rotated pages. http://www.quickpdf.org/forum/settextmode-function-is-not-working-for-me-why_topic2261.html QP.LoadFromFile("page.pdf"); for (int i=1;i<=QP.PageCount();i++) { QP.CapturePage QP.SelectPage(i); QP.NormalizePage(0); QP.SaveState; QP.SetTextMode(2) Watermark; QP.LoadState; // as it was QP.DrawCaptured; } Edited by ExchangeViews - 22 May 12 at 9:45AM |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
I am just guessing but try this
QP.LoadFromFile("page.pdf");
for (int i=1;i<=QP.PageCount();i++) { QP.SelectPage(i); QP.NormalizePage(0); QP.CapturePage QP.SaveState; QP.SetTextMode(2)Watermark; QP.LoadState; // as it was QP.DrawCaptured; } |
|
ExchangeViews
Team Player Joined: 13 Mar 12 Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Thanks a lot. Your idea is working fine. I am sorry to bother you. It was so easy.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions 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 |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store