FOSSredder 0.5.0
Loading...
Searching...
No Matches
PopplerCore.cpp File Reference

Implements Poppler-based PDF rendering and metadata extraction. More...

#include "pdf-rendering/pch.h"
#include "pdf-rendering/PopplerCore.h"
#include "core/ports/diagnostics/IDiagnostics.h"
#include <poppler-document.h>
#include <poppler-page.h>
#include <poppler-image.h>
#include <poppler-page-renderer.h>
#include <nlohmann/json.hpp>
#include <filesystem>
#include <fstream>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
Include dependency graph for PopplerCore.cpp:

Go to the source code of this file.

Typedefs

using json = nlohmann::json

Functions

static void safeWriteText (const std::shared_ptr< core::ports::diagnostics::IDiagnostics > &debugger, const std::string &path, const std::string &text)
static void safeWriteBytes (const std::shared_ptr< core::ports::diagnostics::IDiagnostics > &debugger, const std::string &path, const std::vector< uint8_t > &data)
static ports::RenderedPage extractPageMeta (poppler::page *page, int pageIndex, double dpi, std::shared_ptr< core::ports::diagnostics::IDiagnostics > debugger)
static std::filesystem::path resolveOutputDir (const std::filesystem::path &outputDir)
static std::vector< uint8_t > encodePngBytes (poppler::image &img)
static std::string prefix_base (const std::string &uniqIdPrefix, const std::string &filePrefix)

Detailed Description

Implements Poppler-based PDF rendering and metadata extraction.

Definition in file PopplerCore.cpp.

Typedef Documentation

◆ json

using json = nlohmann::json

Definition at line 19 of file PopplerCore.cpp.

Function Documentation

◆ encodePngBytes()

std::vector< uint8_t > encodePngBytes ( poppler::image & img)
static

Definition at line 109 of file PopplerCore.cpp.

Here is the caller graph for this function:

◆ extractPageMeta()

ports::RenderedPage extractPageMeta ( poppler::page * page,
int pageIndex,
double dpi,
std::shared_ptr< core::ports::diagnostics::IDiagnostics > debugger )
static

Definition at line 40 of file PopplerCore.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prefix_base()

std::string prefix_base ( const std::string & uniqIdPrefix,
const std::string & filePrefix )
static

Definition at line 133 of file PopplerCore.cpp.

Here is the caller graph for this function:

◆ resolveOutputDir()

std::filesystem::path resolveOutputDir ( const std::filesystem::path & outputDir)
static

Definition at line 103 of file PopplerCore.cpp.

Here is the caller graph for this function:

◆ safeWriteBytes()

void safeWriteBytes ( const std::shared_ptr< core::ports::diagnostics::IDiagnostics > & debugger,
const std::string & path,
const std::vector< uint8_t > & data )
static

Definition at line 31 of file PopplerCore.cpp.

Here is the caller graph for this function:

◆ safeWriteText()

void safeWriteText ( const std::shared_ptr< core::ports::diagnostics::IDiagnostics > & debugger,
const std::string & path,
const std::string & text )
static

Definition at line 22 of file PopplerCore.cpp.

Here is the caller graph for this function: