Hi<br><br>Hello, we have a problem with the PDF content editor with some PDF files.<br>Here a simple code that throws error :<br><br>public class AsposeTest {<br> <br> public static void main(String[] args) throws Exception {<br> PdfContentEditor editor = new PdfContentEditor();<br> <br> FileInputStream in = new FileInputStream("C:\\LOCALAPP\\singapour_in\\SIFMAG1G213.pdf");<br> editor.bindPdf(in); // Error is here<br> <br> editor.replaceText("test", "test1");<br> <br> editor.save("C:\\LOCALAPP\\singapour_in\\test.pdf");<br> }<br><br>}<br><br><br>And the error : <br><br>java.io.IOException: Wrong dictionary declaration<br> at com.aspose.pdf.kit.nh.do(Unknown Source)<br> at com.aspose.pdf.kit.nh.for(Unknown Source)<br> at com.aspose.pdf.kit.j.n(Unknown Source)<br> at com.aspose.pdf.kit.j.m(Unknown Source)<br> at com.aspose.pdf.kit.gl.a(Unknown Source)<br> at com.aspose.pdf.kit.PdfContentEditor.bindPdf(Unknown Source)<br> at com.dexia.lndm.AsposeTest.main(AsposeTest.java:17)<br>java.lang.NullPointerException<br> at com.aspose.pdf.kit.fs.a(Unknown Source)<br> at com.aspose.pdf.kit.PdfContentEditor.replaceText(Unknown Source)<br> at com.dexia.lndm.AsposeTest.main(AsposeTest.java:19)<br><br><br>The PDF File is not corrupted because I am able to read it with Acrobat Reader without problem.<br>Where can come the error?<br><br>Thanks in advance for your precious help.<br><br>Best regards,<br><br>Gildas Cuisinier<br><br>
Hi,
Thank you for considering Aspose.
Could you please attach the source pdf(SIFMAG1G213.pdf) in this thread to let us check it?
Thanks,
Sure, here it is
Hi,
Thanks for your reporting. I am able to reproduce the error and have logged it as PDFKITJAVA-6849 in our issue tracking system. We will try to resolve it ASAP.
Thanks,
Hi,
The issue PDFKITJAVA-6849 has been resolved, please download the attached Beta version(v2.2.0.1) of aspose.pdf.kit.jar and try it.
And please note that your attached pdf file could not be support well (would lose infomation after replacing text). It is because that the font used for some characters of the pdf is very special, which induce an known but unresolved issue of font substitution. We will try to resolve that issue in our next version. Sorry for the inconvenience.
Thanks,
The issues you have found earlier (filed as 6849) have been fixed in [this update](http://www.aspose.com/community/files/51/file-format-components/aspose.pdf.kit-for-.net-and-java/entry169389.aspx).