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 - DrawTextBox and GetPageText
  FAQ FAQ  Forum Search   Register Register  Login Login

DrawTextBox and GetPageText

 Post Reply Post Reply
Author
Message
haka View Drop Down
Beginner
Beginner
Avatar

Joined: 16 Jun 11
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote haka Quote  Post ReplyReply Direct Link To This Post Topic: DrawTextBox and GetPageText
    Posted: 17 Jun 11 at 9:08PM
Hallo.
A text that is stored with DrawTextBox can not be read by GetPageText.

procedure TForm15.Button1Click(Sender: TObject);
var LPDF: TQuickPDF;
    s   : string;
begin
  LPDF := TQuickPDF.Create;
  try
    LPDF.UnlockKey(QuickPdfSN);
    LPDF.SetPageSize('A4');
    // Store OCR-Text...
    LPDF.DrawTextBox(50, LPDF.PageHeight-50,  LPDF.PageWidth-10, LPDF.PageHeight-70, 'DrawTextBox', 1);
    LPDF.DrawText   (50, LPDF.PageHeight-100, 'DrawText');
    // Read Text...
    s := UTF8ToAnsi(LPDF.GetPageText(0));
    ShowMessage(s);
  finally
    LPDF.Free;
  end;
end;

Variable s only contains "DrawText". Is this a bug?
I'm using QuickPDF 7.25 and Delphi 2009.

Greetings, Harald
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: 17 Jun 11 at 9:34PM
Hi!

Try to change the two lines.
First DrawText then the other one...
New result?
What are the settings regarding font heighs and so on?
Is the box big enough for "DrawTextBox"?
You should deal a bit more with the settings.
I had been wondered that you could ever extract text before save it to disk ;-)

Cheers and welcome here,
Ingo
Back to Top
haka View Drop Down
Beginner
Beginner
Avatar

Joined: 16 Jun 11
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote haka Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jun 11 at 11:59AM
Hallo Ingo.

I tried many things. There seems to be a problem with DrawTextBox.
Code example:

procedure TForm15.BtnSaveClick(Sender: TObject);
begin
  with TQuickPDF.Create do
  try
    UnlockKey(QuickPdfSN);
    SetPageSize('A4');
    DrawTextBox(50, PageHeight-50,  PageWidth-10, PageHeight-70, 'My text (DrawTextBox)', 1);
//  DrawText   (50, PageHeight-100, 'DrawText');
    SaveToFile('C:\Temp\quickpdf-drwatextbox.pdf')
  finally
    Free;
  end;
end;

procedure TForm15.BtnReadClick(Sender: TObject);
var s: string;
begin
  with TQuickPDF.Create do
  try
    UnlockKey(QuickPdfSN);
    LoadFromFile('C:\Temp\quickpdf-drwatextbox.pdf');
    s := UTF8ToAnsi(GetPageText(0));
    ShowMessage(s);
  finally
    Free;
  end;
end;

And the example PDF: http://www.officemanager.de/tmp/foren/quickpdf-drwatextbox.pdf

You can not read the text with GetPageText.

Thanks, Harald
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