I downloaded the chromium6307 version of pdfium source code and compiled it, after compiling, call the export interface to achieve the function of extracting text, but put the tool into windows7 system, the use of tools will crash, using windbg to view the stack as follows:
pdfium!partition_alloc::internal::logging::LogMessage::~LogMessage::<lambda_0>::operator()
pdfium!partition_alloc::internal::logging::LogMessage::~LogMessage+0x152
pdfium!partition_alloc::internal::base::RandBytes+0xc7
pdfium!partition_alloc::internal::base::RandUint64+0x14
pdfium!partition_alloc::internal::base::InsecureRandomGenerator::InsecureRandomGenerator+0x3c
pdfium!partition_alloc::RandomGenerator::GetGenerator+0x4d
pdfium!partition_alloc::RandomGenerator::RandomValue+0x5e
pdfium!partition_alloc::internal::RandomValue+0x63
pdfium!partition_alloc::GetRandomPageBase+0xa
pdfium!partition_alloc::AllocPagesWithAlignOffset+0x48
pdfium!partition_alloc::AllocPages+0x1c
pdfium!partition_alloc::internal::PartitionAddressSpace::Init+0x3d
pdfium!partition_alloc::PartitionRoot::Init+0x62
pdfium!partition_alloc::PartitionAllocator::init+0x32
pdfium!partition_alloc::PartitionAllocator::PartitionAllocator+0x10
pdfium!pdfium::base::NoDestructor<partition_alloc::PartitionAllocator>::NoDestructor<const partition_alloc::PartitionOptions &>+0x3b
pdfium!`anonymous namespace'::GetArrayBufferPartitionAllocator+0x59
pdfium!FX_InitializeMemoryAllocators+0x1e
pdfium!FPDF_InitLibraryWithConfig+0x16
This seems to be a problem with FPDF_InitLibrary, but it doesn't work on windows10.
I use the command line to compile, enter the command line as follows:
gn args out/x64
ninja -C out/x64 pdfium
My
args.gn file looks like this:
is_component_build = false
is_debug = false
pdf_enable_v8 = false
pdf_enable_xfa = false
pdf_is_standalone = true
target_cpu = "x86"
target_os = "win"
treat_warnings_as_errors = false
Now I can't find the problem, I hope to get your reply, thank you