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 > General Discussion
  New Posts New Posts RSS Feed - Is there a replace text function in QuickPdf
  FAQ FAQ  Forum Search   Register Register  Login Login

Is there a replace text function in QuickPdf

 Post Reply Post Reply
Author
Message
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Topic: Is there a replace text function in QuickPdf
    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.
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: 23 May 13 at 9:05AM
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
 
Back to Top
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 13 at 10:17AM
ok thanks Ingo for your support.
Jim
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 13 at 12:32PM
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
Back to Top
mandriospo View Drop Down
Beginner
Beginner


Joined: 16 Dec 21
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote mandriospo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Apr 23 at 8:01AM
Originally posted by AndrewC AndrewC wrote:

QP.LoadFromFile("99pages.pdf", "");
QP.ReplaceText("Page 19", "Page 99")  // This shouldn't cause too many problems.
QP.SaveToFile("out.pdf");

your sample code is wrong, there is no such a ReplaceText function, you mean ReplaceTag?
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: 05 Apr 23 at 7:42PM
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

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