fix SetCMapMemory

This commit is contained in:
Kulikova Svetlana
2022-09-09 12:16:46 +03:00
parent 4ee24be05f
commit 99c2f645f4
5 changed files with 17 additions and 3 deletions

View File

@ -47,7 +47,7 @@ public:
if (nType == 0)
{
pReader = new PdfReader::CPdfReader(pApplicationFonts);
((PdfReader::CPdfReader*)pReader)->SetCMapFolder(L" ");
((PdfReader::CPdfReader*)pReader)->SetCMapMemory();
}
else if (nType == 1)
pReader = new CDjVuFile(pApplicationFonts);

View File

@ -481,6 +481,11 @@ return 0;
if (globalParams)
((GlobalParamsAdaptor*)globalParams)->SetCMapFolder(m_pInternal->m_wsCMapFolder.c_str());
}
void CPdfReader::SetCMapMemory()
{
if (globalParams)
((GlobalParamsAdaptor*)globalParams)->SetCMapMemory();
}
NSFonts::IFontManager* CPdfReader::GetFontManager()
{
return m_pInternal->m_pFontManager;

View File

@ -94,7 +94,8 @@ namespace PdfReader
bool ExtractAllImages(const wchar_t* wsDstPath, const wchar_t* wsPrefix = 0);
int GetImagesCount();
void SetCMapFolder(const wchar_t* wsCMapFolder);
void SetCMapFolder(const wchar_t* wsCMapFolder);
void SetCMapMemory();
NSFonts::IFontManager* GetFontManager();
std::wstring ToXml(const std::wstring& wsXmlPath, bool isPrintStreams = false);

View File

@ -47,6 +47,13 @@ void GlobalParamsAdaptor::SetCMapFolder(const std::wstring &wsFolder)
toUnicodeDirs->append(sFolder->copy()->append("/CMap"));
}
void GlobalParamsAdaptor::SetCMapMemory()
{
cidToUnicodes->add(new GString("Adobe-GB1"), new GString());
cidToUnicodes->add(new GString("Adobe-Korea1"), new GString());
cidToUnicodes->add(new GString("Adobe-KR"), new GString());
cidToUnicodes->add(new GString("Adobe-Japan1"), new GString());
}
void GlobalParamsAdaptor::AddNameToUnicode(const char* sFile)
{
char *tok1, *tok2;

View File

@ -38,7 +38,8 @@ public:
m_wsTempFolder = folder;
}
void SetCMapFolder(const std::wstring &wsFolder);
void SetCMapFolder(const std::wstring &wsFolder);
void SetCMapMemory();
private:
void AddNameToUnicode(const char* sFile);