Search & replace text programmatically in pdf file

I need to search & replace text programmatically (preferably in .NET c#) in existing pdf file.
Does anyone know how to do it (maybe with with Acrobat SDK) ?
Thanks in advance!
A.
PS: Well done working example :-)

Searching APIs are provided, but there no APIs for replacing since that's not a standard operation on a PDF (given the rendering model).

Similar Messages

  • How to search specific text/string in pdf files from command prompt?

    Hi,
    How to search specific text/string in pdf files from command prompt?
    Will be great if you can refer to any adobe provided command base utility to achieve the above target.
    Best Regards,

    You can't. The commandline parameters for Acrobat and Adobe Reader do not allow any type of commands to be run.

  • How to search for text inside multiple pdf file at once in ipad

    Hi
    I am student and i need search a word or subject or sentences on my all pdf files,i have tested some applications like ibook, ipdf, addobe reader, good reader ,....  But couldn't find what i need to have.
    Please kindly help me to find the best application.
    Thanks

    I found an article, that claims PDF Expert does exactly what you are asking.
    Article: http://www.imore.com/pdf-expert-ipad-brings-full-text-search-pdf-library
    PDF Expert: https://itunes.apple.com/us/app/pdf-expert-fill-forms-annotate/id393316844?mt=8

  • I can't edit text on a pdf file in adobe acrobat

    I need to edit the text on the pdf file but I can't and this message keeps showing up: " This form cannot be edited in Acrobat. Please use Adobe LiveCycle Designer to edit this form.
    There are no security on this file. The only thing that is not allowed is to create templates. When I check the document properties description, on the PDF producer it says adobe distiller 7.0.5 (windows)
    I downloaded the adobe livecycle designer but I couldn't edit the text there either... When I open the file it says the text is not downloaded so it replaced it with another text, I clicked ok but then the text didn't change, This message showed up:
    I really need to edit the text on this pdf file because it's important. Can anyone help? Greatly appreciate it. By the way, this is a pdf fillable form that you can fill out on acrobat and that is the only thing it seems like it will let me do this file. I don't want to fill it out, I want to edit whats on it. It's one of those forms that you get from NJ courts.

    Ok, what we can tell you is that if this is a LiveCycle form (and we can be pretty sure it is), that you are absolutely right. Acrobat can fill it, and nothing else. These are a very special kind of PDF, where all the text is in a special XML format that Acrobat can only show, not edit.
    So, you are on the right track: if it can be edited, you need LiveCycle Designer. Unfortunately, we don't know much about it in this forum, so please try posting here: http://forums.adobe.com/community/livecycle/livecycle_modules_and_development_tools/livecy cle_designer_es
    If the form is publicly available, it may help if you include the URL (web address) when you post.

  • Find and replace text in multiple Photoshop files?

    Hi there,
    Let us say I have six Photoshop files: 1.psd, 2.psd, ..., 6.psd. All of these files contain the word “LoremIpsum” in random text layers, within each document. Is there a way I can search for “LoremIpsum” in all documents and replace it with “Dolor Sit Amet”, all in one go? This is just an example, I need to replace various words, not just one.
    I have tried "batch find and replace" software (including powerful tools like Power Grep) but they do not work with psd files… Is there a javascript of external plugin for this kind of task?
    Thanks!

    You’re welcome, advice given here is free.
    If you want to donate something nonetheless you could do so over at
    http://ps-scripts.com/bb/
    Many of the same people used to contribute there as here and I for one have benefitted considerably from their generous advice on Scripting issues.
    A Script can read (or create) txt files, but I do not have a lot of experience with this.
    This might work (amend the line »var theTexts = readPref ("….txt", false);« according to your txt-file’s path):
    // replace text elements in type layers;
    // 2013, use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
              for (var n = 0; n < app.documents.length; n++) {
                        app.activeDocument = app.documents[n];
                        app.activeDocument.suspendHistory("replace text", "main()")
    // the opertation;
    function main () {
              var myDocument = app.activeDocument;
              var theTexts = readPref ("….txt", false);
              var theArray1 = theTexts.slice(0, Math.round(theTexts.length/2));
              var theArray2 = theTexts.slice(Math.round(theTexts.length/2), theTexts.length);
              alert (theArray1.join("\n")+"\n\n\n"+theArray2.join("\n"))
              for (var b = 0; b < theArray1.length; b++) {
                        replaceText (theArray1[b], theArray2[b])
    ////// reoplace text //////
    function replaceText (replaceThis, replaceWith) {
    // =======================================================
    var idreplace = stringIDToTypeID( "replace" );
        var desc22 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref3 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idreplace = stringIDToTypeID( "replace" );
            ref3.putProperty( idPrpr, idreplace );
            var idTxLr = charIDToTypeID( "TxLr" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idAl = charIDToTypeID( "Al  " );
            ref3.putEnumerated( idTxLr, idOrdn, idAl );
        desc22.putReference( idnull, ref3 );
        var idUsng = charIDToTypeID( "Usng" );
            var desc23 = new ActionDescriptor();
            var idfind = stringIDToTypeID( "find" );
            desc23.putString( idfind, replaceThis );
            var idreplace = stringIDToTypeID( "replace" );
            desc23.putString( idreplace, replaceWith );
            var idcheckAll = stringIDToTypeID( "checkAll" );
            desc23.putBoolean( idcheckAll, true );
            var idFwd = charIDToTypeID( "Fwd " );
            desc23.putBoolean( idFwd, true );
            var idcaseSensitive = stringIDToTypeID( "caseSensitive" );
            desc23.putBoolean( idcaseSensitive, false );
            var idwholeWord = stringIDToTypeID( "wholeWord" );
            desc23.putBoolean( idwholeWord, false );
            var idignoreAccents = stringIDToTypeID( "ignoreAccents" );
            desc23.putBoolean( idignoreAccents, true );
        var idfindReplace = stringIDToTypeID( "findReplace" );
        desc22.putObject( idUsng, idfindReplace, desc23 );
    executeAction( idreplace, desc22, DialogModes.NO );
    ////// read prefs file //////
    function readPref (thePath, binary) {
      if (File(thePath).exists == true) {
        var file = File(thePath);
        file.open("r");
        if (binary == true) {file.encoding= 'BINARY'};
        var theText = file.read();
        file.close();
        return String(theText).split(",")
    In this case the comma is used to split the text into Strings in Arrays, if your search/replace texts include commas you could use something else, I guess.

  • Using browser javascript to copy selected text from a pdf file opened in Air app.

    I have posted this question on reader forum as well, but I think it is more suited here...
    I am trying to create a note-taking application in air. I want to extract selected text from pdf file as a string object or to the clipboard.
    Obviously, all pdfs in my local storage will not be scripted to recieve postMessages and act accordingly, and that is not practical either. So, my problem is, how can I copy the selected text in the pdf file (opened as an object in htmlloader within my Air app) to clipboard or directly in another control by say clicking a button in air application? I suppose, this is possible using javascript, however, I don't know which reader methods are exposed to the wrapper htmlloader control. In short, I want to execute app.execMenuItem("Copy") command through htmlloader javascript. Any alternate solutions are also welcome.
    This is similar to passing inbuilt commands/methods/functions (of adobe reader) to pdf-reader plugin embedded in a webpage via javascript. This is possible in IE where the pdf is rendered as activex object, and hence JSObject interface of pdf document/reader is accessible to the browser javascript. I have also read that this same JSObject is accessible to VB as interface for IAC, so as the Air is Adobe's own product, I was wondering if equivalent of JSObject is accessible to htmlloader control as well.
    Thanks in advance...
    Mits

    Thank you Thom for your reply...
    from
    http://www.adobe.com/devnet/acrobat/javascript.html
    ...Through JavaScript extensions, the viewer application and its plug-ins expose much of their functionality to document authors, form designers, and plug-in developers...
    As it is explicitly mentioned, that the functionality of adobe reader are exposed for plugin development, I thought someone here might have used external javascript to execute some safe methods in adobe reader. The functionality (i.e. external javascript interface-JSObject) is already available for VB programmers to develop IAC. Further, the Acrobat SDK example called "AcroPDFinHML" shows how one can embed a pdf-reader in a html page and execute some safe methods (like gotonextpage(), zooming etc.) in IE as ActiveX plugin. I have checked it myself for adobe reader 9, and it works perfectly, so there is no security issue as such to implement the same for another browser (like in my case, the htmlloader control in flex/air app).
    I intend to create a note taking application in air, where it is very much required that I should be able to copy selected text from various pdf documents, that are open in my app, and subsequently paste/collect/save the collected notes and process them afterwords (offcourse, from the pdfs that allow me copying text). However, it is not happening for me here. As the pdfs are opened through adobe reader plugin, it does not register the copy command executed by my air app. It registers the system level copy command (by keyboard shortcut Ctrl+C), but my air app has no way to execute the system level copy command programmatically. So I am kind of stuck here...
    Thanks again for your reply. Having known what am I intend to accomplish, any other (may be alternative) solutions will be appreciated nonetheless...
    Mits

  • Editing text in all PDF files

    Hello,
    I am very new to Acrobat and am trying to change some text in some of my documents, but can't seem to be able to do so. I am using Acrobat X Pro and i use the "Edit Document Text" tool, but the cursor does not change to the text editing cursor. I tried opening other PDF documents and it seems that I am able to edit text in some PDF files, but not the text in others. For the one that I am trying to edit, I did the "Recognize Text" function. I can high-light the text and even search the document for certain words, but can't seem to change any of the text. I can select the text to cross out or put a comment in them, but still can't remove some words/letters & retype.
    This is really frustrating, as these documents are the only reason I wanted Acrobat X - so I can edit a few words on them.
    Please help!

    Nono, I've been trying to say that I CAN high-light it. I can high-light any text in there, select it for commentating, do the strike-out notes on it. I can even do ctrl+F and search for a word that's within the document and it will find that word. There is no "original" PDF because that IS the original.
    I can do everything else to the text except actually edit it (basically deleting or changing the words).
    This is frustrating because other files that people send me that are generated via an automated system are editable, but my own PDF files are not, and I want to know what that difference is and how I can change it so that I can edit my own PDF files.

  • Search in a folder of pdf files

    Is it possible to proceed informations search by keyword from a folder without having to open it before? This folder contains several text documents files in pdf format.

    --I don't think that's doable with automator. extracting a particular line from a pdf document is not a trivial task. unless there is automator or applescript support for this function for some particular apps like acrobat, maybe, this isn't going to be possible.--
    wait, strike all that. there is an action to extract text from particular pdf files. this will extract all text not just some line but you can then search the extracted text for particular text string that you want.
    Message was edited by: V.K.

  • How to extract text from a PDF file?

    Hello Suners,
    i need to know how to extract text from a pdf file?
    does anyone know what is the character encoding in pdf file, when i use an input stream to read the file it gives encrypted characters not the original text in the file.
    is there any procedures i should do while reading a pdf file,
    File f=new File("D:/File.pdf");
                   FileReader fr=new FileReader(f);
                   BufferedReader br=new BufferedReader(fr);
                   String s=br.readLine();any help will be deeply appreciated.

    jverd wrote:
    First, you set i once, and then loop without ever changing it. So your loop body will execute either 0 times or infinitely many times, writing the same byte every time. Actually, maybe it'll execute once and then throw an ArrayIndexOutOfBoundsException. That's basic java looping, and you're going to need a firm grip on that before you try to do anything as advanced as PDF reading. the case.oops you are absolutely right that was a silly mistake to forget that,
    Second, what do the docs for getPageContent say? Do they say that it simply gives you the text on the page as if the thing were a simple text doc? I'd be surprised if that's the case.getPageContent return array of bytes so the question will be:
    how to get text from this array? i was thinking of :
        private void jButton1_actionPerformed(ActionEvent e) {
            PdfReader read;
            StringBuffer buff=new StringBuffer();
            try {
                read = new PdfReader("d:/getjobid2727.pdf");
                read.getMetaData();
                byte[] data=read.getPageContent(1);
                int i=0;
                while(i>-1){ 
                    buff.append(data);
    i++;
    String str=buff.toString();
    FileOutputStream fos = new FileOutputStream("D:/test.txt");
    Writer out = new OutputStreamWriter(fos, "UTF8");
    out.write(str);
    out.close();
    read.close();
    } catch (Exception f) {
    f.printStackTrace();
    "D:/test.txt"  hasn't been created!! when i ran the program,
    is my steps right?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to extract text from a PDF file using php?

    How to extract text from a PDF file using php?
    thanks
    fabio

    > Do you know of any other way this can be done?
    There are many ways. But this out of scope of this forum. You can try this forum: http://forum.planetpdf.com/

  • Why cannot I copy selected text from a pdf file opened in Adobe Reader XI?

    Hi all,
    I had a problem when I tried to copy some selected text on a pdf file([Linux.System.Programming(2nd,2013.5)].Robert.Love.文字版.pdf) , which was opened in Adobe Reader XI as below (non-English version):
    The error's text could be primarily translated as "An error occured when copied to clipboard. Internal Error." I'm not sure about the reason of this. I guess it is a problem or bug related to operating system or Adobe Reader XI. I had this problem when I used other versions of Adobe Reader though I cannot remember the exact number of versions now.
    The version of XI I'm using is 11.0.0.  The operating system is XP SP3.
    As I was writing this question, the problem disappeared and I cannot reproduce it again now.
    Could anyone help explain why the error message appearred or why the problem disappearred? If there is referrence provided, that would be finer. Thank you.
    Message was edited by: photonxp

    The document has been protected.
    Even if it doesn't have a password, the original author has applied "plagiarism" prevention to it.
    There is a program from Wondershare, called PDF Password remover, that will remove such restrictions, but I'm not allowed to recommend it, only to point out it's existence.

  • Embedding Full-text Index into PDF File

    Hello Everyone,
    I've tried to create and embed full-text index into PDF file, but with no luck. I've followed steps described at http://help.adobe.com/en_US/Acrobat/9.0/Standard/WSC28D4DBB-6A78-4027-9E04-F50FE411CFB9.w. html - there can be seen progress of collecting of data and at the end the button Update index is enabled. This is signal for me that Index was created. After clicking on Ok button, saving document as new one and then reopening "new created" document, there is info that no Index is embedded in the Manage Embedded Index dialog. Is there any other step necessary to do? Or is it bug? Adobe Acrobat Pro 9.1 on Windows Vista 32bit is used.
    Jan
    PS: Interesting is also comment at the bottom of above mentioned help page...

    Thanks for the response. It is true that if I make changes and look at the embedded index status, it shows that it needs updating
    However the problem I can't get around after extensive testing is that sometimes for no apparent reason the index is dropped on save. This can happen if I check the status of the index to make sure it is valid, save the file, and reopen it.
    I've concluded that this must be a bug and am using other indexing options for the time being.

  • Hello, in former Versions it was available to mark text in a pdf file and change it. How do I have

    Hello, in further Versions it was available to mark text in a pdf file and change it. How do I have to act, to do the same in Acrobat XI? Also I need to now, how can I import a graphic file into a pdf to add my handwrote signature or a picture of mine? Please help me soon. It is urgent.

    Moving the discussion to Acrobat Forums

  • How do I edit the text in a pdf file that has been converted to a Word doc

    How do I edit the text in a pdf file that has been converted to a Word doc?

    Hi BridgetteJean,
    Please go through this video this explains how to edit text in a pdf document.
    http://tv.adobe.com/watch/acrobat-tips-and-tricks/editing-text-with-the-typewriter-tool/

  • Unable to highlight text in my PDF files

    Iam unable to highlight text in my PDF files ,The tool shows in the toolbar and  i am able to select it .But when i go to the related text which i wish to highlight ,nothing happens . kindly advise, what am i doing wrong. The comment tool is working fine , and i am able to put text comments in the box.But i need to highlight certain text also.
    .I am using Adobe reader version 10.1. I reinstalled the program two times but still the highlight tool does not works .

    May be that the PDF files doesn't contain any text. What did you get when you use File > Save As > Text...

Maybe you are looking for

  • Windows 8.1 and Officejet Pro 8620

    I bought a new Officejet Pro 8620 for my office and installed it on 4 machines. All of them could print but only one coupld scan. There happened to be a hardware issue and I had to return it to the store. When I went to install the new printer (the s

  • PI does not combine .wsdl file with .xsd files.

    Hi, I imported .wsdl file with necessary .xsd files in PI system (7.1). PI does not find fields in .wsdl already necessary .xsd files imported with .wsdl file. Is there anyone to help me to solve problem with test it in PI system. I send .wsdl file a

  • An issue with WLC 5508 and 7921 phone

    Hello all! I have a system with WLC 5508 and some 1242 APs. And I use a lot of 7921 phones. One of 7921 phones was in trouble. It loses registration, disconnect conversations... I installed the trial WLC and run voice diagnostics. I  saw some of "Pot

  • Oracle Universal Installer Error when Installing Oracle database Software

    Hi Guru's we are installing SAP ECC 6.0 on Linux:Oracle, we start the installation fine until we reach the oracle software installation step. we login as ora<sid> then set the DISPLAY variable setenv DISPLAY 192.168.1.155:0.0 The csh shell is the one

  • Tips for best way to transfer from XP to MacBook?

    My new Mac book should arrive anytime now, in fact I'm watching the window as I type. This is my first Mac and I have had my current PC (desktop) for several years. Are there tips or things to make sure not to do in transferring information from one