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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - DrawText and FontSize
  FAQ FAQ  Forum Search   Register Register  Login Login

DrawText and FontSize

 Post Reply Post Reply
Author
Message
carlos.albert View Drop Down
Beginner
Beginner


Joined: 17 Apr 07
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote carlos.albert Quote  Post ReplyReply Direct Link To This Post Topic: DrawText and FontSize
    Posted: 31 May 07 at 1:51PM
Hello, we have an existing PDF document merged from various pdfs of diferent origins (PDF Printer, FastReport Renderized, etc) we want to write some text in the bottom of each page, the problem is the size of the text is not the same in all pages, the font size changes depend on the merged pdf. For example two pdf files with one page every one, we merge them and then apply the text with drawtext on each page, in the first page the font has a size and in the other the font has a diferent size. The code we use is:

     QP:= TiSEDQuickPDF.Create; 
     try
          QP.UnlockKey('XXXXXXXXXXXXXXXXX');
          QP.LoadFromFile(FilePDF);
          //I have seen this in the forum
          QP.UseUnsafeLayers(1);

          // Stablish the font, the same if we stablish the font in each page
          QP.SetTextSize(20);

          for x := 1 to QP.PageCount do
          begin
               QP.SelectPage(x);
                // I have seen this in the forum
               QP.SetPageContent('q'#13#10 + Trim(QP.GetPageContent) + #13#10'Q'#13#10);

               QP.DrawText(10, 10, SuReferencia);
               QP.CompressPage;
          end;

          QP.CompressContent;
          QP.SaveToFile(FilePDF);


     finally
          QP.Free;
     end;

Please, some idea???

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 07 at 2:09PM
Hi Carlos!

I don't know if it helps ... but i have few ideas ;-)
Put "QP.SetTextSize(20);" directly after "QP.SelectPage(x);".
I don't know if "UseUnsafeLayers" and "SetPageContent" is necessary ... but if you use it i will place both after "SelectPage" to make sure that it works for the actual page.

Best regards,
Ingo

Back to Top
carlos.albert View Drop Down
Beginner
Beginner


Joined: 17 Apr 07
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote carlos.albert Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jun 07 at 2:29AM
Hi Ingo,

>Put "QP.SetTextSize(20);" directly after "QP.SelectPage(x);".

I had tried it before but same results.

>I don't know if "UseUnsafeLayers" and "SetPageContent" is necessary ... but if you use it i will place both after "SelectPage" to make sure that it works for the actual page.

I use it because of a post of Marian (I saw in the forum) regarding about draw text and position, I try to put it after selectPage too but no results.

Thanks for your help.
Back to Top
carlos.albert View Drop Down
Beginner
Beginner


Joined: 17 Apr 07
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote carlos.albert Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jun 07 at 3:09AM
Hi Ingo and Hi all,
I have resolved it calculating the size of the font in function of the size of the page, I have noticed than the size of the page is diferent so it is normal that the same size of text appears larger or smaller in pages of diferent size because the size goes in pixels and when you print it reescales to the size of the A4.
Back to Top
carlos.albert View Drop Down
Beginner
Beginner


Joined: 17 Apr 07
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote carlos.albert Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jun 07 at 3:09AM
Thans for all
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store