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 > I need help - I can help
  New Posts New Posts RSS Feed - ReplaceTag
  FAQ FAQ  Forum Search   Register Register  Login Login

ReplaceTag

 Post Reply Post Reply
Author
Message
dejan61 View Drop Down
Beginner
Beginner


Joined: 16 Apr 09
Location: Slovenia
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote dejan61 Quote  Post ReplyReply Direct Link To This Post Topic: ReplaceTag
    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 !
 
 
 
 
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: 16 Apr 09 at 6:05AM
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
Back to Top
dejan61 View Drop Down
Beginner
Beginner


Joined: 16 Apr 09
Location: Slovenia
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote dejan61 Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 09 at 6:55AM
I can't found "Encrypted" and "Unecrypt"
I found "EncriptionStatus" and "Decrypt". Is that the same ?
 
MfG, Dejan
 
 
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: 16 Apr 09 at 7:36AM
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
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 09 at 7:47AM
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.
Back to Top
dejan61 View Drop Down
Beginner
Beginner


Joined: 16 Apr 09
Location: Slovenia
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote dejan61 Quote  Post ReplyReply Direct Link To This Post Posted: 17 Apr 09 at 2:52AM
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
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: 17 Apr 09 at 3:25AM
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
Back to Top
dejan61 View Drop Down
Beginner
Beginner


Joined: 16 Apr 09
Location: Slovenia
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote dejan61 Quote  Post ReplyReply Direct Link To This Post Posted: 17 Apr 09 at 6:38AM

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 ?
 
 
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: 17 Apr 09 at 7:18AM
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
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