Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Change / Replace a word at Quads
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Change / Replace a word at Quads

 Post Reply Post Reply
Author
mhoney View Drop Down
New Member
New Member


Joined: 17 Dec 2013
Location: Australia
Points: 34
Post Options Post Options   Quote mhoney Quote  Post ReplyReply Direct Link To This Post Topic: Change / Replace a word at Quads
    Posted: 27 May 2014 at 8:59am
Hi,

For quite a few months now I have been writing scripts for some Accounting projects which have worked extremely well (with some great tips from this forum).

I have been using getPageNthWordQuads and getPageNthWord methods to obtain all words in a pdf / manipulating the data using arrays and then writing out a data object .csv .txt for uploading into an Accounting Information System.   All works great!

What I would like to do now is somewhat work in reverse.  Is it possible to replace or change a word if you know the Quads for a word.  I want to basically loop through all the words / get all quads and then change specific words based on their quards.

If you have some tips I would appreciate it so much.  Java Script is quite addictive and very very useful with Acrobat.Smile

Thanks.

Michael. 


Edited by mhoney - 27 May 2014 at 9:00am
Michael.
Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1116
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2014 at 10:16am
With Javascript you can't change words.
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4115
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2014 at 6:46pm
You can only use the redaction to replace the words subject to lots of limitations.
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2014 at 11:53pm
Or you can overlay a field (or an annotation) on top of the old word and place the new one. Of course, if they have different lengths it will look out of place. Plus, you need to know in advance what font was used because you don't have access to that information with JS...
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
mhoney View Drop Down
New Member
New Member


Joined: 17 Dec 2013
Location: Australia
Points: 34
Post Options Post Options   Quote mhoney Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2014 at 4:17am
Thanks for your advice I will have a go at this and see if I can get it work work effectively.  

Generally the geometry of the files I will be working with will always be the same.  They are pdf's that are from automated systems etc  which hopefully should make it a bit easier.

You both are very knowledgable.

Michael.
Michael.
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2014 at 10:11pm
Bear in mind that if you cover the words, and someone exports text or copy/pastes they may get both sets of words, or more commonly only the original set. The overlay technique is really only suitable if the only applicable use of the edited file is printing.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.