Tim Heffernan wrote:
> Hoping for some guidance on a perplexing issue.  Thanks in advance.

You're doing something that is (almost) forbidden.
See chapter 18 of the first edition of "iText in Action".

> Our .NET C# application currently uses iTextSharp to perform the 
> following on a .pdf document…
> ·         Iterate the pages of a .pdf
> ·         Use pdfReader.GetPageContent() to write the contents of the 
> page to a string variable…

Those are not really "the content of the page".
You're forgetting the XObjects that are also part of the content.

> ·         Do some manipulation of the PageData string variable using a 
> regular expression. 

That's blasphemy! Vade retro!!!

> ·         Over write the existing page data with our manipulated PageData…
> pdfReader.SetPageContent(page, 
> System.Text.Encoding.UTF8.GetBytes(PageData));

Very bad idea!

> The execution of the pdfReader.SetPageContent() method(above) is 
> generating a bug wherein specialized Unicode characters that render 
> correctly in the original text are
> no longer rendered correctly  following the execution of this method.

Why the surprise?

> I’ve tried modifying the code to
> pdfReader.SetPageContent(page, 
> System.Text.Encoding.Unicode.GetBytes(PageData));
> This at first appears to fix the rendering issue(visually) but when the 
> page with the specialized Unicode
> 
> Characters exist loads, Adobe Reader persents an error message box 
> saying the page has errors.

Those who play with fire should not be surprised to get their fingers
burned (or worse).
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to