Print Page | Close Window

Help with FitTextBox

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=877
Printed Date: 15 May 24 at 10:24AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Help with FitTextBox
Posted By: swtie831
Subject: Help with FitTextBox
Date Posted: 14 Mar 08 at 3:31PM

I am using iSedQuickPDF version 5.11 and am trying to use FitTextBox to change the font of a line of text if it is too long.  However, I don't understand what is meant by

"If 100 is added to these values long words will not be split up, the font size will be reduced until the longest word fits into the available width."
 
I've tried everything I can think of, but nothing seems to be working.  Please help.



Replies:
Posted By: Ingo
Date Posted: 14 Mar 08 at 4:41PM
Hi!
 
Perhaps it's not your call "FitTextBox" but some other code prevent this call from working?
Perhaps you can post the relevant routine here?
 
Best regards,
Ingo
  


Posted By: swtie831
Date Posted: 17 Mar 08 at 11:29AM
Thank you for helping me out on this.  Here is the just of what I'm trying to do:
 
 
procedure TForm1.SampleCode(Sender: TObject);
  var
    QP : TiSEDQuickPDF;
    s0 : String;
    fntCour : Integer;
  begin
    QP := TiSEDQuickPDF.Create;
    QP.UnlockKey('CODE');
    QP.NewDocument();
    QP.SetOrigin(1);
    QP.SetMeasurementUnits(1);
    QP.SetPageSize('Letter');
    fntCour := QP.AddStandardFont(0);
    QP.SelectFont(fntCour);
    QP.SetTextSize(10);
    s0 := 'STRINGjt10doejtwen20fieothir30ieufnfor40doejtfif50afi55six60ieuseven70doejeigh80fieanine90ieuhund100ieufnah110doehtwe120fiehthi130ieufhfo140doejhfi150afivhsi160iehseve170doeheig180fiehnin190iethund200';
    QP.FitTextBox(30,40.25,127.0,3.0,s0,0); 
    // I want this to shrink s0 to fit the text box, but instead it just cuts off s0 after '...70d'
    QP.CompressContent;
    QP.SaveToFile('C:\File.PDF');
    QP.RemoveDocument(QP.SelectedDocument);
    QP.Free;
  end;


Posted By: swtie831
Date Posted: 17 Mar 08 at 2:06PM
Thank you for your help.  I got it to work now.


Posted By: FKirch
Date Posted: 18 Mar 08 at 11:50PM
Will you please show us your solution?



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