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!
Is there a replace text function in QuickPdf |
Post Reply |
Author | |
JMLM
Team Player Joined: 26 Mar 13 Status: Offline Points: 40 |
Post Options
Thanks(0)
Posted: 23 May 13 at 8:19AM |
hi,
Is there a replace text function in QuickPDF (with Dll and Dylib version). Change a short word or a tag. Cheers Jim.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3527 |
Post Options
Thanks(0)
|
Hi Jim!
There isn't a replace text function. Changing the free text content isn't easy stuff for such a light weight library. Tag data (like meta data) you can change easily. Please have a look in the online reference... Cheers, Ingo |
|
JMLM
Team Player Joined: 26 Mar 13 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
ok thanks Ingo for your support.
Jim
|
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Jim, QPL has hundreds of functions and even ones I have need seen before. There is a QP.ReplaceTag function that searches for text within the content stream an replaces the text with a new value. This may or may not work as expected based on the complexity of the document including fonts and the uniqueness of the tag. Text will not be rewrapped and spacing of other text elements may or may not be affected. QP.LoadFromFile("99pages.pdf", ""); QP.ReplaceText("Page 19", "Page 99") // This shouldn't cause too many problems. QP.SaveToFile("out.pdf"); Andrew
|
|
mandriospo
Beginner Joined: 16 Dec 21 Status: Offline Points: 9 |
Post Options
Thanks(0)
|
your sample code is wrong, there is no such a ReplaceText function, you mean ReplaceTag?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3527 |
Post Options
Thanks(0)
|
Inside the post of AndrewC (R.I.P.) he has written ReplaceTag and that's the correct function:
https://www.debenu.com/docs/pdf_library_reference/ReplaceTag.php First you have to do a SelectPage for positioning because without this only the current page will be examined: https://www.debenu.com/docs/pdf_library_reference/SelectPage.php Please keep in mind that this functionality doesn't work on all pdf-documents. It won't work for example on documents with LZW-compression. If your documents are encrypted then the text you're looking for is encrypted, too. In this case you have to decrypt the document first before you can use ReplaceTag: If QP.EncriptionStatus > 0 Then QP.Decrypt; It should be clear that after ReplaceTag you've to do a save and new load to see the differences. Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
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