Pdfbox ReplaceString works but the result is unreadable
-------------------------------------------------------
Key: PDFBOX-1113
URL: https://issues.apache.org/jira/browse/PDFBOX-1113
Project: PDFBox
Issue Type: Bug
Components: FontBox, PDModel
Affects Versions: 1.6.0, 1.5.0, 1.4.0
Environment: Windows, Eclips 3.5, Adobe Reader 9
Reporter: Andreas Münzenmaier
with a PDF document containing text like this:
TEST: «TEST0123»
TEST BOLD: «TEST0123»
TEST: «TEST012345678901234567890»
used the following test code
frist problem :
the "ABCDEF" ist not show in the PDF. ( Will try to attach the PDF)
second:
the «TEST012345678901234567890» isn't replaced at all ( not critical...)
###############################################
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.apache.pdfbox.examples.pdmodel.ReplaceString;
public class testPdfReplaceTest extends TestCase {
final Logger log = Logger.getLogger( this.getClass() );
public void testPdfMod() throws Exception
{
String in = "test/TEST.pdf";
ReplaceString x;
ReplaceString r = new ReplaceString();
r.doIt(in, "tmp/ok1.pdf", "«TEST0123»", "TEST0123"); // OK
r.doIt(in, "tmp/fail1.pdf", "«TEST0123»", "ABCDEFG"); //
FAILES SCRAMBELD
r.doIt(in, "tmp/fail2.pdf", "«TEST012345678901234567890»",
"TEST0123"); // FAILES, string not replaced
}
}
##################################
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira