Skip to content

Commit

Permalink
added a few PDFs generated with various tools to check conformance
Browse files Browse the repository at this point in the history
  • Loading branch information
k00ni committed Aug 25, 2023
1 parent 81bcfd3 commit c2453a8
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions tests/PHPUnit/Integration/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,58 @@ public function testPDFDocEncodingDecode(): void
$testSubject = '•†‡…—–ƒ⁄‹›−‰„“”‘’‚™ŁŒŠŸŽıłœšž';
self::assertStringContainsString($testSubject, $details['Subject']);
}

/**
* Test getText result.
*
* PDF generated with Chromium 116 via SaveAs-dialog.
*/
public function testGetTextPull634Chromium(): void
{
$document = (new Parser())->parseFile($this->rootDir.'/samples/R2RML-Spec_Generated_via_Chromium-SaveAs-PDF.pdf');

// PROBLEM: ,---- too many whitespaces between characters!
self::assertStringContainsString('R 2R M L: R D B to R D F M apping Language', $document->getText());
}

/**
* Test getText result.
*
* PDF (1.4) generated with LibreOffice Writer (6.4).
*
* @see https://help.libreoffice.org/6.4/en-US/text/shared/01/ref_pdf_export.html
*/
public function testGetTextPull634LibreOffice(): void
{
$document = (new Parser())->parseFile($this->rootDir.'/samples/RichDocument_Generated_via_Libreoffice-6.4_PDF-v1.4.pdf');

self::assertStringContainsString(
'Some currency symbols: £, €, ¥'."\n".'German characters: ÄÖÜß',
$document->getText()
);
}

/**
* Test getText result.
*
* PDF (v 1.4) generated with Inkscape 0.92.
*/
public function testGetTextPull634InkscapePDF1_4(): void
{
$document = (new Parser())->parseFile($this->rootDir.'/samples/SimpleImage_Generated_via_Inkscape-0.92_PDF-v1.4.pdf');

self::assertEquals('TEST', $document->getText());
}

/**
* Test getText result.
*
* PDF (v 1.5) generated with Inkscape 0.92.
*/
public function testGetTextPull634InkscapePDF1_5(): void
{
$document = (new Parser())->parseFile($this->rootDir.'/samples/SimpleImage_Generated_via_Inkscape-0.92_PDF-v1.5.pdf');

self::assertEquals('TEST', $document->getText());
}
}

0 comments on commit c2453a8

Please sign in to comment.