My goal is to relace the “Transaction” with “Black Rock Assest Management” . The output format goes funky. Here is my code:
Hello, i’m having an issue with the opposite, longer string being replaced by a shorter string. The formatting will be off. Any clues with this? I’m using PdfContentEditor witih .net
Hi Jing,jing.luo:
My goal is to relace the “Transaction” with “Black Rock Assest Management” . The output format goes funky. Here is my code:public static void main(String[] args) {Document pdfDocument = new Document(“C:/Users/jing.luo/CoverLetterTemplateA.pdf”);TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(“Transaction”);textFragmentAbsorber.getTextReplaceOptions().setReplaceAdjustmentAction(TextReplaceOptions.ReplaceAdjustment.WholeWordsHyphenation);pdfDocument.getPages().accept(textFragmentAbsorber);TextFragmentCollection textFragmentCollection =textFragmentAbsorber.getTextFragments();for (TextFragment textFragment : (Iterable) textFragmentCollection) {textFragment.setText(“Black Rock Assest Management”);}pdfDocument.save(“C:/Users/jing.luo/CoverLetterTemplateA_long_replacement.pdf”);}
Hi Jonathan,jcunanan:
Hello, i’m having an issue with the opposite, longer string being replaced by a shorter string. The formatting will be off. Any clues with this? I’m using PdfContentEditor witih .net
Can you please share the input PDF file and code snippet, so that we can test the scenario in our environment. We are sorry for this inconvenience.
Thanks for looking into this. Do you have any updates? Could you provide any ETA? Our project has a hard deadline and is depending on this.
Hi Jonathan,jing.luo:
Thanks for looking into this. Do you have any updates? Could you provide any ETA? Our project has a hard deadline and is depending on this.
The issues you have found earlier (filed as PDFJAVA-36828) have been fixed in Aspose.PDF for Java 19.11.