pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Replace string in pdf
Date Wed, 09 Dec 2015 17:32:29 GMT
There is no replacement. The reason is that it doesn't work most of the 
time, because strings are not in one piece in a PDF. It may look like 
this this:

[ (S) 3 (t) 2 (r) 4 (in) -1 (g) ] TJ

(not an exact example, but it should show the problem).

Place a string is easy if you want to create a new PDF, just look at the 
PDPageContentStream.showText() method or at examples that us it.

If your work assignment is e.g. to replace "Readsoft" with "Lexmark" 
everywhere in thousands existing PDF documents - forget it.


I wonder if we should create a FAQ entry about that.


Tilman


Am 09.12.2015 um 11:41 schrieb Lakshmikiran.N:
> Dear,
>
> https://svn.apache.org/repos/asf/pdfbox/tags/1.5.0/pdfbox/src/main/java/org/apache/pdfbox/examples/pdmodel/ReplaceString.java
>
> In this example many class are deprecated in PDFBox 2.0.0
>
> Can you please tell me what r the replacement for those classes
>
> or else can you please tell me an example to place a String in a pdf or replace a String.
>
> Regards
>
> N L Kiran
> 9789477523
>
> BEYONTEC 2nABLE SOLUTIONS PRIVATE LIMITED
> “ BAHWAN IT PARK” ,2nd Floor, (West Wing), No. 148,
> Rajiv Gandhi Salai (OMR), Okkiyyam Thoraipakkam, Chennai – 600 097.
> Phone : 044 - 24962426, 27, 28.
> www.beyontecsolutions.com
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message