DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle, FPDF_BYTESTRING bsText, FPDF_DWORD size) { if (stringHandle == NULL || bsText == NULL || size <= 0) return FALSE; CFX_ByteStringArray* stringArr = (CFX_ByteStringArray*)stringHandle; CFX_ByteString bsStr(bsText, size); stringArr->Add(bsStr); return TRUE; }
void PDF_GetPageText(CFX_ByteStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage, int iMinWidth, FX_DWORD flags) { lines.RemoveAll(); CFX_WideStringArray wlines; PDF_GetPageText_Unicode(wlines, pDoc, pPage, iMinWidth, flags); for (int i = 0; i < wlines.GetSize(); i ++) { CFX_WideString wstr = wlines[i]; CFX_ByteString str; for (int c = 0; c < wstr.GetLength(); c ++) { str += CharFromUnicodeAlt(wstr[c], FXSYS_GetACP(), "?"); } lines.Add(str); } }