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!
the end of text |
Post Reply |
Author | |
liveny
Beginner Joined: 19 Jul 13 Location: Russia Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 19 Jul 13 at 5:19AM |
Hi, guys! I need to add a signature to the end of text. But I don't know the length of the text in advance. Is it possible to determine the end programmatically? |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(1)
|
Hi Liveny!
Why not try this one: You can add a signature to a file and it doesn't matter where your textcontent is. The length of your text you can determine while using the textextraction counting the characters. Cheers and welcome here, Ingo |
|
liveny
Beginner Joined: 19 Jul 13 Location: Russia Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Hi! thx for your answer. May be I didn't make myself clear. The point is I don't need a DIGITAL signature. I want to add facsimile. =)
|
|
liveny
Beginner Joined: 19 Jul 13 Location: Russia Status: Offline Points: 5 |
Post Options
Thanks(0)
|
In short, I want to add text to the end of the document.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
So do it ... ;-)
Automatically it will be added to the end. |
|
liveny
Beginner Joined: 19 Jul 13 Location: Russia Status: Offline Points: 5 |
Post Options
Thanks(0)
|
;-) Thx, but in my case, text added in the end of PAGE no matter what I used. Eventually I solved this problem by using GetPageText(3) - I just calculate the y-coordinate of the last line. If there is another way to do it, so, would you please.. ^.^
|
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
liveny, The method you have used is the only real method. A PDF file doesn't contain paragraphs and word positions in the way that MS Word would. A PDF is made up of jigsaw pieces and each piece has a location of where it goes on the page. GetPageText finds all the pieces and tries to group them together into words and lines but it is not always perfect as it is not an exact science. For a simple letter it is more than adequate and the only real method to use. Your code might be a little simpler if you use the Text Blocks functions. He is some simple sample code. QP.LoadFromFile("aaa.pdf", ""); for (int i = 1;i<=QP.PageCount();i++) { QP.SelectPage(i); int id = QP.ExtractPageTextBlocks(3); for (int w=1;w<=QP.GetTextBlockCount(id);w++) { double size = QP.GetTextBlockFontSize(id, w); MessageBox.Show("Page :" + i.ToString() + " Word:" + w.ToString() + "'" + QP.GetTextBlockText(id, w) + "'"); } QP.ReleaseTextBlocks(id); } Andrew.
|
|
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