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!
ReplaceTag |
Post Reply |
Author | |
dejan61
Beginner Joined: 16 Apr 09 Location: Slovenia Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 16 Apr 09 at 5:32AM |
ReplaceTag doestn work.
I tried this with many diferent documents. It never worked.
I must replace one text with another. Perhaps is the ReplaceTag wrong function to do that. I'm using Delphi 6
LoadFromFile('file name') --> returns 1
ReplaceTag('something','something else') --> returns 0 although string
'something' exists in source document.
Please help !
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi!
What you wanna do you can do with ReplaceTag but ... 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 encrypt the document before you're using ReplaceTag: If QP.Encrypted > 0 Then QP.Unencrypt; It should be clear that after ReplaceTag you've done a save and new load? Cheers, Ingo Edited by Ingo - 16 Apr 09 at 6:08AM |
|
dejan61
Beginner Joined: 16 Apr 09 Location: Slovenia Status: Offline Points: 4 |
Post Options
Thanks(0)
|
I can't found "Encrypted" and "Unecrypt"
I found "EncriptionStatus" and "Decrypt". Is that the same ?
MfG, Dejan
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Dejan!
You're "eagle eye" ;-) It seems to me that Debenu has forgotten these important two functions while rewriting the new documentation. They are reading here, too - so i'm pretty sure that there's a new documentation available soon. Here's a part of the old documentation: Encrypted ========= Description ----------- Determines the encryption status of the selected document. Definition ---------- Function Encrypted() As Long Parameters ---------- N/A Returns ------- 0 The selected document is not encrypted. 1 The document is encrypted with Adobe "Standard" encryption. 2 The document is encrypted with an unknown encryption Unencrypt ========= Description ----------- Attempts to decrypt the selected document. If the document is encrypted and the user password has been set, then the SetPassword function must be called before this function. Definition ---------- Function Unencrypt() As Long Parameters ---------- N/A Returns ------- 0 The document could not be decrypted. 1 The document was decrypted successfully. Cheers, Ingo Edited by Ingo - 16 Apr 09 at 7:38AM |
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
Hi Guys,
Sorry for the confusion -- but the two functions, Encrypted and Unencrypt, were renamed in version 7.12 to be EncryptionStatus and Decrypt. The new function names provide a more accurate description of the functionality. A full list of renamed functions can be found here: http://www.quickpdflibrary.com/help/quickpdf/RenamedFunctions.php Cheers, - Rowan. |
|
dejan61
Beginner Joined: 16 Apr 09 Location: Slovenia Status: Offline Points: 4 |
Post Options
Thanks(0)
|
This doesn't work:
with PDFLibrary1 do begin
LoadFromFile('c:\test.pdf'); if EncryptionStatus > 0 then begin Decrypt; end; ReplaceTag('R','P'); SaveToFile('c:\changed.pdf'); end;
file is not encripted (EncriptStatus = 0)
What am I doing wrong ?
I must replace some variables in PDF file with data from database.
Is there another way to do it ? Edited by dejan61 - 17 Apr 09 at 2:53AM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi!
What do you mean with "replace variables"? If you want to change values from formfields then you should use the functions from the section "form fields". Cheers, Ingo |
|
dejan61
Beginner Joined: 16 Apr 09 Location: Slovenia Status: Offline Points: 4 |
Post Options
Thanks(0)
|
I must insert data from databes into pdf document: Tekst in PDF document: Name: <Name>
The program must replace the text <Name> with the data from database.
Result will be: Name: Dejan
How can I do this the other way ?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Dejan!
What you wanna do is like closing the eyes to the options the pdf-specs are offering to you ;-) You should create a normal pdf-template with formfields. This formfields you can fill then without any problem and after you've flatten the values they'll stay in the pdf. So my advice: Forget the way you wanna go and do it with formfields. That's the better (standard) way. 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