Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

Replace text in PDF

Last post 10-11-2011, 2:38 AM by jan-hendrikroehrs. 37 replies.
Page 2 of 3 (38 items)   < Previous 1 2 3 Next >
Sort Posts: Previous Next
  •  09-22-2007, 8:34 PM 95837 in reply to 95836

    Re: Replace text in PDF

    Can you please attach your pdf document and code and let us check it?

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-25-2007, 8:44 PM 96165 in reply to 95837

    Re: Replace text in PDF

    Attachment: Present (inaccessible)

    Hello.

    Yes sure.

    I will attach the file, and the code is as follows:

    PdfContentEditor ced = new PdfContentEditor();

    ced.BindPdf(@"\the\file\path\test1.pdf");

    ced.ReplaceText("<<APR1>>", "ABC12345");

    ced.Save(@"\the\file\path\test1_out.pdf");

    Thats all. And also i have tryed to optimised the input pdf for lower versions of pdf formats ,but the problem is still there.

    But I noticed that the output pdf get broken only when a replacement is about to be done. I mean, when I enter some matching string that I know it exists in the input PDF and it has to be related , the output file gets broken. otherwise, it gets OK, as a copy of the input file.

     

    Thank You

     
  •  09-25-2007, 10:01 PM 96173 in reply to 96165

    Re: Replace text in PDF

    Hi,

    Can you please provide us with the input file as well so that we can more accurately determine the cause of the problem.

    Thanks.

     
  •  09-26-2007, 4:59 AM 96221 in reply to 96173

    Re: Replace text in PDF

    Attachment: Present (inaccessible)
    Hi,
    Yes sure. I somehow missed to provide it.
    Here it is.
    Thank You
     
  •  09-26-2007, 10:16 AM 96270 in reply to 96221

    Re: Replace text in PDF

    Hi,

    I have been able to reproduce this error. I have logged this issue as PDFKITNET-3790 into our issue tracking system. Our developers will try their best to rectify this problem as soon as possible.

    Thanks.

     
  •  09-26-2007, 11:04 AM 96281 in reply to 96221

    Re: Replace text in PDF

    Hi,

    you can go to the page (http://www.aspose.com/Community/Forums/thread/96008.aspx )

    to download the new dll to test. this problem has been solved in the new fix version.

    but until now, the function of replacing text is not perfect, for some special document, it may exist some problems. we will try best to improve this function.


    Allen Wen
    Developer
    Aspose Changsha Team

    About Us
    Contact Us
     
  •  09-18-2008, 12:13 AM 144560 in reply to 79834

    Re: Replace text in PDF

    Hello,

    I am sorry to say but the replaceText method of this API is a complete failure. I wrote the same syntax as you in version 2.0 as well as 2.1 which is the latest release with all hot fixes. i.e.

     PdfContentEditor pdfContent = new PdfContentEditor();
            try{
                pdfContent.bindPdf("c:\\Curves.pdf");
                pdfContent.replaceText("curve", "ZZZZZZZZ");
                pdfContent.save("c:\\ReplacedCurves.pdf");
            }catch(Exception ex){
                ex.printStackTrace();
            }

    But now i am getting the execption below :

    java.lang.NullPointerException

    at com.aspose.pdf.kit.f4.a(Unknown Source)

    at com.aspose.pdf.kit.PdfContentEditor.replaceText(Unknown Source)

    at Test.main(Test.java:56)

     

    Thanks & Regards

    Anand

     
  •  09-18-2008, 2:20 AM 144588 in reply to 144560

    Re: Replace text in PDF

    Hi Anand,

    Can you please provide your PDF file and let us check it?


    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-19-2008, 12:51 AM 144707 in reply to 144588

    Re: Replace text in PDF

    Attachment: Present (inaccessible)
    Hello I  have attached x.pdf. please try to replace

    Gramm-Leach-Bliley in this document with any word. Try to change Edward L. Stull with any other word. observe that it will not work. also see that the justification of the document gets distorted in the output pdf file.

     

    Thanks & Regards

    Anand

     
  •  09-19-2008, 3:47 AM 144726 in reply to 144707

    Re: Replace text in PDF

    Hi,

    I am able to reproduce the error, and it has been logged as PdfKitJava-6004 in our issue tracking system. We will try to resolve it ASAP.

    Thanks,


    Felix Liu
    Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  10-09-2008, 7:13 PM 147387 in reply to 144726

    Re: Replace text in PDF

    I did find with PDF files that wouldn't replace the text I could open it save it and then open it again at which point the replace function would work.   Not sure what pdfkit does when it writes out the file but it seems to like it when it reads it in again.

    pdfContent.BindPdf("c:\\temp\\junk.pdf");

    pdfContent.Save("c:\\temp\\junk2.pdf");

    pdfContent.BindPdf("c:\\temp\\junk2.pdf");

    pdfContent.ReplaceText("Sept", "Oct");

    pdfContent.Save("c:\\temp\\Replaceddate.pdf");

    Hope they find a solution to this.

     

     
  •  10-09-2008, 7:33 PM 147389 in reply to 147387

    Re: Replace text in PDF

    Hello mark,

     

    Thanks for considering Aspose.

     

    Please share the Pdf file that you are using, so that we can test the issue at our end.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  10-10-2008, 2:06 AM 147407 in reply to 147387

    Re: Replace text in PDF

    Hi Mark,

    You are using a .NET edition of Aspose.Pdf.Kit, so the workaround may not work for Anand's project which uses a JAVA Kit. But your solution is very special and may be useful to us. Could you pease share the source Pdf file here to help us to resolve the issue?

    Thank you,

    Felix Liu
    Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  10-10-2008, 5:59 PM 147548 in reply to 147407

    Re: Replace text in PDF

    Attachment: Present (inaccessible)

    I have a three for one special. The first file junk.pdf is the starting pdf.  Junk2 is the file after aspose saves it out and the third file  is after I have replaced some text in junk2.  I will say that it might have something to do with color in the pdf.  I will be getting my license soon so I will try it with the full version shortly.

     

     
  •  10-14-2008, 3:19 AM 147818 in reply to 144707

    Re: Replace text in PDF

    Attachment: Present (inaccessible)
    Hi Anand,

    The issue of PdfKitJava-6004 has resolved, and we also added a new method of PdfContentEditor.replaceText(String, int, String) for replacing words in one appointed page. Please download the attached Beta version(2.1.0.4) of aspose.pdf.kit.jar and try it.

    Note that replacing words like Gramm and Edward with any words could be supported, but words such as "Gramm-Leach-Bliley" and "Edward L. Stull" may not be successfully replaced with other words by this Beta version. We will try to enhance the feature to support the latter form of words in our next version.

    Thanks,

    Felix Liu
    Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
Page 2 of 3 (38 items)   < Previous 1 2 3 Next >
View as RSS news feed in XML