Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpunit pdf tofu characters detection #741

Open
8ctopus opened this issue Oct 10, 2024 · 0 comments
Open

phpunit pdf tofu characters detection #741

8ctopus opened this issue Oct 10, 2024 · 0 comments

Comments

@8ctopus
Copy link

8ctopus commented Oct 10, 2024

I'm trying to design a phpunit test to detect tofu characters within a generated pdf. (If none of the fonts included in the pdf supports the language within the pdf, tofu characters will appear.)

First, I tried to get the pdf text, however the getText method always returns the correct unicode text, even if tofu characters are seen within the pdf.

Second, I've considered listing the available fonts and simply reviewing that all the required fonts are present.

$parser = new PdfParser();
$document = $parser->parseFile($pdf);

$fonts = $document->getFonts();

foreach ($fonts as $font) {
    $font->getDetails();
}

Would anyone have a better approach to suggest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant