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 - Replacing Text in multipage document
  FAQ FAQ  Forum Search   Register Register  Login Login

Replacing Text in multipage document

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


Joined: 17 Apr 12
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote AusMike Quote  Post ReplyReply Direct Link To This Post Topic: Replacing Text in multipage document
    Posted: 17 Apr 12 at 1:47AM
I am hoping someone can tell me what I am missing?
 
I need to create two large multipage documents that take several minutes to produce.  The documents are identical except for a couple of pieces of text.  To speed the whole system up, I am trying to create the document with a placeholder for my text, then replace it with he correct text for each file.
 
ie
after I have created the document:
 
quickpdf.CombineContentStreams;

workstring := quickpdf.savetostring;

Newstring := stringreplace(workstring,’@placeholder@’,’new data’,[rfrepalceall]);

i := Quickpdf.loadfromstring(newstring,'');

if = 1 then

begin

      QuickPDf.CompressContent;

     QuickPDf.SaveToFile(filename1);

End;

Newstring := stringreplace(workstring,’@placeholder@’,’alternate data’,[rfrepalceall]);

i := Quickpdf.loadfromstring(newstring,'');

if = 1 then

begin

      QuickPDf.CompressContent;

     QuickPDf.SaveToFile(Filename2);

End;

The saved files have the correct number of pages, but no content (font description,etc is there). 

Is there something else I need to do to get this to work?

I tried looping though the pages and using the page routines (replacetag or getpagecontenttostring), but that only works for the first document.

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: 17 Apr 12 at 1:48PM
You probably need to make sure the strings you are replacing are the same length.

Another option is to create the initial document with out the text place holders and then use DrawText later if you know where the text should be drawn.

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