We are using Crystal Reports, C# and PDFsharp to generate PDF documents by individual users. Crystal Reports is first used to create a single monolithic PDF document with all the users' entries, with each user's respective portion delineated by text "tags." Afterwards, a C# program generates individual PDFs from the monolith, by extracting its text with PDFsharp, searching for the tags, and then generating a PDF from each between-tag portion.
This process worked fine for many years, but starting with Crystal Reports Service Pack 23, the encoding of the generated PDFs is no longer readable by PDFsharp, and hence the tags cannot be found. (No such problem occurs when copying from these documents if they are rendered in Chrome or Firefox.)
Is there a setting that can be changed in Crystal Reports to restore the old encoding, or must we either modify PDFsharp or use a different PDF processing library?
The SP16-generated PDFs used WinAnsi encoding, but the SP23 ones use Unicode. SAP said there is no setting in Crystal Reports to force the encoding to WinAnsi.
Solving this problem required adding ToUnicode CMap-retrieval to PDFsharp and using the CMaps at runtime to map each CString text index to its corresponding Unicode character.