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!
DrawTextBox and GetPageText |
Post Reply |
Author | |
haka
Beginner Joined: 16 Jun 11 Status: Offline Points: 7 |
Post Options
Thanks(0)
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
haka
Beginner Joined: 16 Jun 11 Status: Offline Points: 7 |
Post Options
Thanks(0)
|
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 |
|
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