-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make horizontal offset configurable (#505)
* Make horizontal offset configurable * Remove redundant comment * Add type hinting * Add horizontal offset test
- Loading branch information
1 parent
1991526
commit ddb14ae
Showing
6 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/** | ||
* @file This file is part of the PdfParser library. | ||
* | ||
* @author Konrad Abicht <[email protected]> | ||
* @date 2020-06-01 | ||
* | ||
* @author Sébastien MALOT <[email protected]> | ||
* @date 2017-01-03 | ||
* | ||
* @license LGPLv3 | ||
* @url <https://github.com/smalot/pdfparser> | ||
* | ||
* PdfParser is a pdf library written in PHP, extraction oriented. | ||
* Copyright (C) 2017 - Sébastien MALOT <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. | ||
* If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. | ||
*/ | ||
|
||
namespace Tests\Smalot\PdfParser\Integration; | ||
|
||
use Smalot\PdfParser\Config; | ||
use Tests\Smalot\PdfParser\TestCase; | ||
|
||
class ConfigTest extends TestCase | ||
{ | ||
public function testHorizontalOffset() | ||
{ | ||
$filename = $this->rootDir.'/samples/bugs/Issue494.pdf'; | ||
|
||
$config = new Config(); | ||
$config->setHorizontalOffset(''); | ||
|
||
$parser = $this->getParserInstance($config); | ||
$document = $parser->parseFile($filename); | ||
$text = $document->getText(); | ||
|
||
$reference = '11 ADET DERGİ İÇİN 3 KALEM HİZMET ALIMI İHALE EDİLECEKTİR '; | ||
$firstLine = explode("\n", $text)[0]; | ||
$this->assertEquals($reference, $firstLine); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters