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!
SetPageDimensions |
Post Reply |
Author | |
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
Posted: 15 Feb 07 at 5:07PM |
Hi!
I've trouble with the function SetPageDimensions. I want to convert an image to pdf. The imagesize should be the same in pdf. So i take imagewidth and height and convert it to double fields 'cause this is necessary for SetPageDimensions. I want a border (bddou), too. QP.SetPageDimensions(mmwd + bddou,mmhd + bddou); In mmwd is 2500, in bddou is 50, in mmhd is 1500. When i'm calling PageWidth now i get only 612 - i've thought i get 2500 ;-) What's wrong? What have i forget? Best regards, Ingo --- here's the code --- var border : LongInt; pleft, ptop, mmwd, mmhd, iwd, ihd, bddou : Double; mmw, mmh, iw, ih, bdstr : String; iw := IntToStr(QP.ImageWidth); // is 2500 ih := IntToStr(QP.ImageHeight); // is 1500 iwd := StrToFloat(iw); ihd := StrToFloat(ih); bdstr := IntToStr(border); // border is 50 bddou := StrToFloat(bdstr); QP.SetPageDimensions(mmwd + bddou,mmhd + bddou); // pagewidth shall be 2500 now ShowMessage(FloatToStr(QP.PageWidth)); // <--- here is 612 now! Edited by Ingo - 15 Feb 07 at 5:24PM |
|
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
Ingo,
I tested it on my system (5.21) and here it works fine. But some questions on your code: 1) Why that complicated (and unnecessary) Int -> Float conversion? 2) you are using MMHD and MMWS but never set it before. Shouldn't this be IWD and IHD? try this to test:
HTH, Ulrich |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Uli!
What you're writing was my first try ... and it doesn't work. ImageWidth is integer and the attributes of SetPageDimensions are double so i've thought change integer to double and then it will work. But ... ;-) Thanks a lot ... I'll try again. Best regards, Ingo |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Uli!
I've solved it ... I want to convert very large images to pdf. When i'm doing SetPageDimension and immediately a DrawImage behind i never got the correct aspect ratio. Now i save the new file first with the new dimensions... then load it again doing DrawImage and it works with the correct aspect ratio. Best regards, Ingo |
|
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