I hope this helps someone in the future.

With my PDF, only characters that are in the original document can be
rendered in the generated document.  I solved this problem by adding a
block of text that had every character I intend to use.  I also replace it
with empty string during the substitution phase.

A naive theory is that the font information is only stored in the document
for characters that are represented.  If you have bold text, it will
require another string of the bold text.  Sames goes for each font used.

--pete


On Tue, Jun 5, 2012 at 1:46 PM, pete swulius <[email protected]> wrote:

> I'm very new to PDF and PDFBox, so I'm wondering if it's expected
> behavior.  This is not the common problem of finding your string broken up
> across many objects.
>
> In the original PDF, I'm looking for the string: message
>
> I use the reset() and append(x) methods like the example, but the value I
> pass in to append(x) seems to be interpreted and only the characters [m, e,
> s, a, g] are successfully rendered in the generated PDF.
>
> For instance, if I try to replace it with: foobars
>
> The generated PDF displays the string: as
>
> If I re-create the original PDF to contain the full alphabet in the
> string, it works as expected. (ie: instead of "message", it is
> "abcdefghijklmnopqrstuvwxyz" and the generated PDF displays "foobars" )
>
> --pete
>

Reply via email to